Unreal Engine 5.2 PCG Tutorial - Sampling Landscape Auto Materials

Поделиться
HTML-код
  • Опубликовано: 10 дек 2024

Комментарии • 57

  • @scottcourtney8878
    @scottcourtney8878 Год назад +2

    Another excellent and useful tutorial! One question: At about 8:50, you hook up a lerp node with constant inputs of A=0 and B=1. Unless my pre-coffee brain is entirely dormant, that's going to be the same as the input alpha on the lerp. Is there a reason you needed the lerp to exist as opposed to just connecting the alpha straight through to the multiply? There is another lerp of this type later, and the other two lerps could probably just be the cheaper OneMinus node instead of lerps. Or am I missing something?
    BTW, big thanks for the detailed contents list. I already know how to make automaterials, but didn't know the PCG part yet, so I started at the PhysicalMaterial section and saved some time. It's great that the end-to-end process is here for those who need it. Best of both worlds. :)

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      Wow. No, there is no reason why I use a lerp node there. I sort of gave myself a crash course in physical materials, and along the way I didn't realize I was working with floats that were the exact same input as the alpha. Alpha and OneMinus-Alpha would be a much better way to go, thanks for pointing that out!
      I'm happy the contents list helped! I was thinking this would be a super short tutorial, but it ballooned because I wanted to make sure anybody could follow it from scratch, so I made sure to set up the ToC for the more experienced people like yourself.

  • @scottcourtney8878
    @scottcourtney8878 Год назад +1

    The point rotation at about 18:15 is a great tip!

  • @xjuliussx
    @xjuliussx Год назад +1

    Great videos and tutorials, makes the summer worth the time !

  • @Kiran.KillStreak
    @Kiran.KillStreak Год назад

    Nice Tutorial, Getting material info by its physics material by ray casting is the key. got it.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Exactly! It's taking advantage of the existing system, just like footstep sounds.

  • @HenryRronbertson
    @HenryRronbertson 10 месяцев назад

    You are a life saver man!!!!

    • @MichaelRoyalty
      @MichaelRoyalty  9 месяцев назад

      If you're using version 5.3 you can get the physical material from the world ray hit query node! That might save you some effort.

    • @HenryRronbertson
      @HenryRronbertson 9 месяцев назад

      @@MichaelRoyaltyThank you so much!!

  • @tyrheo738
    @tyrheo738 Год назад

    Good job MR

  • @unrealitybites763
    @unrealitybites763 Год назад +1

    Excellent work, Michael. This is the missing link between landscape and PCG.
    It would be interesting to create a C++ version of your Blueprint Element to see what the performance gains are.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Exactly! I'm happy that the two procedural systems, materials and PCG, can interact in this way.
      The performance gains would be very interesting. I'm also running into a couple stability problems with this blueprint, when you start to create many points and refresh them, and I bet a C++ version would help with that.

  • @ethanwasme4307
    @ethanwasme4307 8 месяцев назад

    smart using the physical material.

  • @AaronFhd
    @AaronFhd Год назад +1

    This stuff is great. Keep up the goods vids. Also would be great to see some stuff on Static meshes, Maybe a Project to that if we can't use landscapes

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      Good idea. Maybe treating one of those enormous Quixel mountain static meshes as a landscape would be a fun thing to look at.

    • @AaronFhd
      @AaronFhd Год назад +1

      @@MichaelRoyalty that would be great as now I am using more Nanite meshes as I need more details

  • @KrolPower
    @KrolPower Год назад

    Loving your tutorials man, thanks! Any chance you're planning a Skyscrapers part 3? Some ideas for it could be, unique ground floor and top floor, setting the parameters to variables for various building footprint sizes, and spawning things between the buildings like roads/sidewalks.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      Eventually! I think I've about dead-ended on my current iteration of skyscrapers, but I have one update planned -- making more diverse blocks, instead of just single buildings. I've experimented with creating spline-based sidewalks around the buildings but the results aren't very satisfying.
      I'm planning to revisit the problem from scratch soon, and see if I can make the construction more flexible.

  • @wilismatrix9847
    @wilismatrix9847 10 месяцев назад

    crazy genius !!

  • @mesterKG
    @mesterKG Год назад +1

    Another solution to the ignore actor issue would be to create a collision channel specific for the landscape and change the line trace to use that channel instead.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      I was thinking along those lines, but didn't realize you could create a separate collision channel. Would changing the landscape's collision channel cause problems with other systems, or can you just make sure that all collision that previously impacted landscape is still connected to the new channel?

    • @mesterKG
      @mesterKG Год назад

      A new channel for this purpose would only be added to whatever collision settings already set up so I don’t think it will affect other stuff. I set mine up with default ignore so I must opt in for anything that should block the channel. Of course I then forget to set this to block on the landscape and get confused for a moment until I realize my mistake 🙂.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      @@mesterKG Haha, I hate it when that happens! You've set everything up right but something has mysteriously changed.
      Awesome, so using a new channel sounds like the easiest way to maintain, since you don't have to worry about any new elements added to your world. Thanks for the advice!

  • @midnightruin6983
    @midnightruin6983 Год назад

    i came up with a similar , except with the traces i used a box trace and getting the extents of the point i added a few filter controls

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      That sounds really handy. Yeah, the key is just the physical material plus the trace to get it in, the rest can be iterated and improved a lot!

  • @tylercottington1461
    @tylercottington1461 7 месяцев назад

    This is a really great tutorial and one of the only ones I've found that tackle how to use PCGs with auto landscapes. I do have a question regarding the physical materials logic. In my case, I have 4 textures that are all being used as an auto material(Layer "Auto" in layer blend). I have them as snow, stone, dirt, and grass. Grass uses the same logic as my stone but with slightly different blend bias/sharpness(they both use the world align blend logic used for your sandstone). However, when using the same logic for physical materials, I get PM_dirt instead of grass and when testing the blend between stone and snow, I get grass. Where did I go wrong?

  • @ParikshitBhujbal
    @ParikshitBhujbal Год назад +1

    HELP pls !
    At 11:30 the ' Get Surface Type ' function is not showing as an option for me at all :s

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      It works for me in 5.2 and 5.3, I can just right click inside the blueprint and select the 'Get Surface Type' node. I'm not sure why it wouldn't work for you.

    • @ParikshitBhujbal
      @ParikshitBhujbal Год назад

      @@MichaelRoyalty Hi, I went through your video again and figured out what caused that, it was my bad I accidently selected get multi line trace instead of a single line trace hence it was not showing me get surface type but was instead showing as an array.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      Ooh! Yeah when you do that you can add a for each loop to it. I use multi line trace a lot with pcg, it's very useful, as long as you notice you're using it 😅

  • @jamerach
    @jamerach Год назад

    I like the approach. There's one weird issue that I came across, if you put the spline and PCG separately, not in the same blueprint, the editor handles it far better. Why...? No clue :D

  • @bleedcraft
    @bleedcraft Год назад

    Great method for landscape material. I'm not sure what I'm missing, but the Sample Physical Materials in the Point Loop will not work for me. I see the columns including Auto and Concrete, but no information is there. Not sure what I missed.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Thanks! Have you set the Trace Channel on the line trace to use "Camera" instead of "Visibility"?

    • @bleedcraft
      @bleedcraft Год назад

      Yes, it is set to Camera.@@MichaelRoyalty

  • @dapxful
    @dapxful Год назад

    Nice tutorial, thanks! but I have a question, Is it necessary to add physical materials to the auto material in order to sample what kind of texture is applied?

    • @dapxful
      @dapxful Год назад

      Ok, I see now. We need the physical material to detect the parts of the automaterial that have not been manually painted

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Exactly -- Without a physical material, you can just detect "Auto Material", but not what texture the auto material has applied. Using physical material is a workaround.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Also 5.3 has updated the World Ray Hit node to allow it to return physical materials, so you don't need a custom blueprint anymore!

    • @dapxful
      @dapxful Год назад

      @@MichaelRoyaltyI understand. What I have end up doing is to create a blend layer in the material (in my automaterial I was not using them), add a non-weight info layer, and uploading a texture with flow mask for that layer created with houdini,using the same project file that I have used for the heightmap. Then I have used the flow mask to add debris using PCG. Thanks for your tutorials ;)

  • @netcodedev
    @netcodedev Год назад

    Hi
    I ran into a problem in UE 5.3...
    As soon as I try to hook up the PCG Blueprint to a node UE5 just crashes. I cant seem to find the error... Do you have any ideas?

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      Hi, I don't have any idea why it would crash but I have heard in 5.3 you can now get the physical material from the ray hit node. So I would look at that rather than a blueprint element.

    • @netcodedev
      @netcodedev Год назад

      @@MichaelRoyalty ah cool. Do you have any sources for that?
      I managed to fix the crashing by disabling the debug render on the line trace. At least I think that's what fixed it

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      I just made a new tutorial on world ray hit! It's very straightforward.

  • @MrWorth
    @MrWorth Год назад

    hi can u help me for something? I wanna use a mesh(mountains) like landscape for cover somewhere on the landscape.. When i try "Get Data Actor" i can't use the "Normal to Density".. i don't know why but it's just not working. When i try "Mesh to Points" i couldn't scale the PCG. Can u make a video for it?

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      You can do two things. World Ray Hit will work a lot like the surface data, you can then plug it into a surface sampler.
      You can also use "Mesh Sampler" if you install the "Procedural Content Generation Geometry Script Interop" plugin. To scale the results, send the sampled data through the Source of a Copy Points node, and scale the point you are using as the Target.

  • @willembuiting
    @willembuiting Год назад

    Love these tutorials. Very helpfull. I do have a question; is there a way to turn on and off PCG like a switch? It constantly interfears my work when working on other stuff within my level. Thanks again for all your great work!

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад +1

      There are a couple ways. You can click "Pause Regeneration" on the graph, and it should stop recalculating as you make changes.
      If you want a more powerful and flexible method, Adrien Logut has made a document with some useful tips. Look for "Emulate Branch Node" about 5 pages into this document: docs.google.com/document/d/1n8Zq31Cnf1uqqkdRve1md0GLweTe7SHp8U4lbP4XEvY

    • @mesterKG
      @mesterKG Год назад +1

      I've made an editor utility widget that looks for all actors with a PCG Component and toggles its Activated flag (not the IsActive flag, but "activated"). Also I force a cleanup or generate with the toggle. This widget can then be placed in your editor layout so it is super easy to toggle on/off any PCG stuff in a level.

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      @@mesterKG That sounds incredibly handy. I've locked up my engine so many times regenerating a large PCG by accident when I just was trying to edit the bounds. Do you have a guide on what you've done?

    • @mesterKG
      @mesterKG Год назад +1

      I don’t have a guide ready, but I can see if can get something out somewhere to share.. nothing before tomorrow night though..

    • @mesterKG
      @mesterKG Год назад

      Here's a short video showing me editor utiltity widget - ruclips.net/video/19A5N8iumDg/видео.html

  • @twigz7003
    @twigz7003 Год назад

    The engine seems to crash whenever I increase the size of the spline or volume? If I keep it small it works... Any ideas why that might be?

    • @MichaelRoyalty
      @MichaelRoyalty  Год назад

      I've run into crashes when I'm working with many points and modify my PCG with static meshes spawned. I'm guessing it's running into memory limits. Try cleaning up your PCG graph and pausing its generation before modifying the spline.

    • @peterkovac6251
      @peterkovac6251 Год назад

      yes it crashes almost with any settings ... its unuseable this way :/ ... cannot make area big enough or points dense enough ... both crashes engine and there is no way to solve it with turning off autogenerate because once you turn it back on it crashes again ... shame .. its nice approach but works only with very small scales whats not very practical ...

  • @k0cc425
    @k0cc425 9 месяцев назад +1

    honestly the ignore list looks like a bother - You're probably better off doing a multi line trace -> loop -> actor has tag (e.g. "Landscape") -> sample -> break
    a bit more performance intensive, but for something like PCG, it really doesn't matter all that much

    • @MichaelRoyalty
      @MichaelRoyalty  9 месяцев назад

      Thanks for the suggestion, that's a better way of doing it, and easier than setting up a separate trace channel.
      I'd recommend using version 5.3, getting the physical material is now a native part of the world ray hit query node!

  • @888marcinb
    @888marcinb 6 месяцев назад

    I came here to see how was the thing on the thumbnail done... and got dissapointed cuz it was fake