Unreal Engine 5.2 PCG Tutorial - Using a Height Filter to Place Trees on a Mountain

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ธ.ค. 2024

ความคิดเห็น • 77

  • @MostafaMohamed-bc9wh
    @MostafaMohamed-bc9wh ปีที่แล้ว +1

    I've been searching and watching tutorials about PCG for weeks, This one is the best !!

  • @FeatureBugEntertainment
    @FeatureBugEntertainment 4 หลายเดือนก่อน +1

    Thank you! The "Get Height Only" checkbox in 5.4 was making "Normal To Density" not work in my project, and you set me on the right path!

  • @danielnikolov1885
    @danielnikolov1885 ปีที่แล้ว +4

    That was one of the best tutorials I have ever seen

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      Wow, thanks! I'm glad you enjoyed it!

  • @tomtomkowski7653
    @tomtomkowski7653 ปีที่แล้ว +3

    Best tutorial about PCG so far! Great job!

  • @agentdanger
    @agentdanger ปีที่แล้ว +3

    Straight to the point and very clear. Very helpful.

  • @fluffybunnykins
    @fluffybunnykins ปีที่แล้ว

    Amazing tutorial! I couldn't figure how to get my trees to not spawn in my water and what you taught here enabled me to fix it! Thank you so much

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      You're welcome, I'm glad it helped!

  • @DjSadhu
    @DjSadhu ปีที่แล้ว

    Lovely style of tutorial. Subscribed 👍

  • @artemaung5274
    @artemaung5274 7 หลายเดือนก่อน

    Learned a lot about PCG in a short time, thanks!

  • @marcelenderle4904
    @marcelenderle4904 ปีที่แล้ว

    excellent job, solutions alot simplier and efficient than other tutorials, thank you

  • @seansanderson
    @seansanderson ปีที่แล้ว +1

    Very clear. Great explanations of why and how. Very useful. Thank you.

  • @GlassesAndCoffeeMugs
    @GlassesAndCoffeeMugs ปีที่แล้ว

    Nice man. Between the height filter and being able to spawn foliage on only a certain material layer, this seems like a suitable replacement for the Landscape Grass Type stuff.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      I think you're right. My ideal workflow would be to create almost everything procedurally, then paint a few touch ups as necessary.
      Once someone figures out a way to spawn foliage based on auto landscape materials, that'll make everything very easy!

    • @GlassesAndCoffeeMugs
      @GlassesAndCoffeeMugs ปีที่แล้ว +1

      @@MichaelRoyalty I posted a response to this earlier but I'm not sure if it actually posted due to Yt being weird
      This works with auto landscape materials. Using your guide, and the material layers guide here th-cam.com/video/SlgMFBcsWKs/w-d-xo.html and the Auto landscape material by Unreal Sensei here th-cam.com/video/3hmRN8bXMM0/w-d-xo.html I was able to get everything working

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      @@GlassesAndCoffeeMugs I've only been able to get a value when the auto landscape material is in use, not the individual textures within it. I'll have to try again!

  • @alexgomez-bi2bk
    @alexgomez-bi2bk ปีที่แล้ว

    That's a lot of nodes, still amazing explanation and not over complicating something that seems complex.

  • @DefinitelyNotCIA
    @DefinitelyNotCIA 9 หลายเดือนก่อน

    Amazing tutorial and presentation, thank you

  • @FrancoSciaraffia
    @FrancoSciaraffia 10 หลายเดือนก่อน

    Top tier video! Thanks for this!

  • @sarpozsk1016
    @sarpozsk1016 6 หลายเดือนก่อน

    Hi! Great tutorial thank you. I have a question have you ever used steepness instead of position? I couldn't figure out how to make it work

  • @andrewswihart1011
    @andrewswihart1011 ปีที่แล้ว +1

    Very helpful! Thank you

  • @legato3067
    @legato3067 9 หลายเดือนก่อน

    wow the best ever. thx you so much for this...By any chance is there a node that remove point if it collide with a static mesh in the world ( rocks-cliff) ?

  • @gillgonzalez8479
    @gillgonzalez8479 ปีที่แล้ว +1

    Request: Can you show us how to exclude trees from spawning on landscape layers, such as rocks and gravel? Great video liked and subbed.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +1

      You should check out this tutorial on that exact subject by FreetimeCoder. He explains it better than I'd be able to. th-cam.com/video/SlgMFBcsWKs/w-d-xo.html

    • @gillgonzalez8479
      @gillgonzalez8479 ปีที่แล้ว

      Thanks man. I watched it but I couldn't understand what he was doing. Still too green I guess. I wish he had begun that video from scratch instead of showing the already created code.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +1

      @@gillgonzalez8479 I had the same problem. Once I sit down and figure out what magic he's worked I'll try to make a step-by-step tutorial on the process.

    • @gillgonzalez8479
      @gillgonzalez8479 ปีที่แล้ว

      ​@@MichaelRoyaltycant wait until you figure it out. Ill be looking forward to the videos. Keep up the great work.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +1

      ​@@gillgonzalez8479 Good news and bad news -- You can get the landscape layers from a Landscape node or a Surface Sampler node, then it's easy to filter based on them! The bad news is, depending on your landscape setup, the layer data sampled might be offset incorrectly.

  • @tariq0513
    @tariq0513 10 หลายเดือนก่อน

    1:00 - i don't have the drop down arrow icon that you have on your 'Input' and 'Surface Sampler' node. How can i expand the nodes? i have tried with UE 5.1 - 5.3.
    Right-clicking does not have any such option either. Thank you for any help in advance.

    • @MichaelRoyalty
      @MichaelRoyalty  10 หลายเดือนก่อน +1

      In 5.3 you'll want to use the landscape node instead of the input node. I think the landscape node is in 5.2 as well

  • @J-Pepi
    @J-Pepi ปีที่แล้ว +1

    Really good video :)

  • @antoniosuarez7881
    @antoniosuarez7881 ปีที่แล้ว

    Thanks, grate tutorial

  • @gurrrgurrr8194
    @gurrrgurrr8194 ปีที่แล้ว +1

    thank you for the tutorial. could you please make another tutorial about density and scale size falloff in PCG. something like closer to cliff the smaller size and density, the higher the altitude the smaller density and scale. thank you very much👍👍👍

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +1

      Those are fun ideas! I'll see what I can do. Altitude to density should be pretty easy. For distance to the cliff I may be able to use a DistanceToNeighbors node, which I haven't looked at yet. This is a great chance to do that!

    • @gurrrgurrr8194
      @gurrrgurrr8194 ปีที่แล้ว

      @@MichaelRoyalty Thank you very much~ I just started to use UE5. Also I would like to ask if there is a way to make plant cluster like using Forest pack in 3Ds max☺☺

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      @@gurrrgurrr8194 Nice, I've only been working in UE for a few months, I find it very easy to work with. I haven't used 3ds Max, do you have an example of plant clustering I can check out?

    • @gurrrgurrr8194
      @gurrrgurrr8194 ปีที่แล้ว +1

      @@MichaelRoyalty Hi, there is a Forest Pack example, cluster at 4:20. th-cam.com/video/a8fc-4QTUs0/w-d-xo.html&ab_channel=ArchVizArtist

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      @@gurrrgurrr8194 Sorry, I missed your reply! I think I understand, the plants should spawn in patches. You should be able to do that with two levels of randomness, one creating large points that define the plant clusters, and one creating the individual plants that fall within those clusters. I'll play around with a couple methods of doing it and see which works!

  • @theone8625
    @theone8625 ปีที่แล้ว +1

    THANK YOU!!!🎯🤙😊😀

  • @jorricktv9550
    @jorricktv9550 4 หลายเดือนก่อน

    hey.. i have a wierd question, regarding pcg .... say you have a pcg set up for your map, and create a massive open world. When you export the project, or launch the finished game. Is every tree saved as actor, or is the pcg graph saved and the actors placed on runtime (somewhat like a seed)

    • @MichaelRoyalty
      @MichaelRoyalty  2 หลายเดือนก่อน

      I'd approach it from spawning them in when the player gets close, and despawning them when the player leaves. But you can also use world partition in addition to the hierarchical generation features in later versions of PCG to smoothly load in objects as players get close to them.

  • @juiceLoosner
    @juiceLoosner ปีที่แล้ว

    Hello. Love your videos. I have learned alot. Is there a way to orient spawned meshes to align to a face normal they are sitting on? I have a bay that has rocks spawned on the shore line but i want the rocks to align to the terrain face normals around the z axis. ie so that the rocks align to the shore line but only rotated around the z axis. I have played around with the normal to density but seems to only filter out certain orientations or levels of grading.

    • @juiceLoosner
      @juiceLoosner ปีที่แล้ว

      If i put a transform points node after a normal density then i can get the desired effect by unchecking "absolute rotation" but this rotates the x and y so that the spawned meshes align to face normal. ie I wish all the spawned meshes to only rotate about the z axis so as to align to the shore but remain un altered in x and y. Hope this makes sense :)

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      So it's like a line of rocks facing outwards? You might be able to approach the problem from a different direction. How is your shore line defined?

    • @juiceLoosner
      @juiceLoosner ปีที่แล้ว

      ​@@MichaelRoyaltyshoreline is not really defined by any geometry only by the intersection of terrain and water.

    • @juiceLoosner
      @juiceLoosner ปีที่แล้ว

      And yes i want to place rocks facing out from shoreline but they are scans so only one side has vertical geometry which i need to face the water

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      Hm, yeah I was hoping you had a spline or something that you could base your rotation off of. It sounds like you need to translate the xy axis of rotation.up into the rotation you'll actually use. That's difficult but not impossible.

  • @danielmiller2462
    @danielmiller2462 3 หลายเดือนก่อน +1

    I am not sure what I am doing wrong, but I keep getting a warning error on the initial Point Filter node connected to Landscape Height. Can anyone help? Much appreciated!

    • @MichaelRoyalty
      @MichaelRoyalty  2 หลายเดือนก่อน

      Can you tell me what the warning says and what version you're using?

  • @MostafaMohamed-bc9wh
    @MostafaMohamed-bc9wh ปีที่แล้ว +1

    Im getting an error with the point Filter node: Warning: Targetdata doesn't have target attribute/property $position Z

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +2

      Are you filtering on "$position Z" with a space? You need to be using "$position.Z" with a period.

    • @MostafaMohamed-bc9wh
      @MostafaMohamed-bc9wh ปีที่แล้ว

      Can't Thank you enough! I couldn't find out how to solve this by my own, really much appreciated. Im sorry If Im bothering you but Is it possible to drive my points spawning in the PCG using a mask? I mean texture mask. I've an arboreal mask generted by the software I used to generte my landscape -Gaea- that specifies exactly where my trees should grow and where not to. Can I filter my points using this mask?@@MichaelRoyalty

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      Yeah I think so! I made this tutorial with that in mind, but I haven't really worked with masks much. Let me know if it helps! th-cam.com/video/UeaQxnAV7O0/w-d-xo.html

    • @Yoremh
      @Yoremh 11 หลายเดือนก่อน

      Thanks King@@MichaelRoyalty

  • @phantompickle6477
    @phantompickle6477 ปีที่แล้ว

    How did you manage to keep your trees generating straight up on a slant?

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      I set "Absolute Rotation" in the transform node. You can also uncheck "Project Rotations" in your projection / landscape sampler node.

  • @jeromecash3054
    @jeromecash3054 ปีที่แล้ว

    My density filter node doesn’t seem to be removing points located on any slopes. Any help?

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      Are you in 5.2 or 5.3? If it's 5.2, I'd check to make sure your points are rotating with the slope (Use landscape on your projection, instead of landscape height), and that you have a Normal to Density node before your Density Filter.
      If it's 5.3 it's possible the workflow has changed, but I'd still check the above first.

  • @yeohjo
    @yeohjo ปีที่แล้ว

    hi i got a question, may i know what does the outside node of the point filter does?

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว +1

      It gives you any points that don't pass the filter. So if you combine inside and outside you still have every single point.

    • @yeohjo
      @yeohjo ปีที่แล้ว

      @@MichaelRoyalty if i want to use the point filter on my spline for example i want to use the outer part of the spline instead of the interior can i use the outside filter for that ? or do i need to create a mask ( with a different spline and difference it)

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      Are you using a closed spline or an open spline? With a closed spline it's pretty easy, there are tutorials out there showing how to scale objects by distance inside the spline. For an open spline I'm not exactly sure, I'll have to look into it.

    • @yeohjo
      @yeohjo ปีที่แล้ว

      @@MichaelRoyalty using a close spline , but i was trying to ask if its possible to use the splines outer bound to spawn the meshes instead of the interior. Cause there is a setting in the spline sampler for you to choose the interior section but not the outer section.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      That sounds like you want to set your spline sampler to sample on spline, set to distance, instead of sampling on interior. Or are you asking something else?

  • @wpwscience4027
    @wpwscience4027 ปีที่แล้ว

    Anyone else having a weird flicker on foliage that has the world position offset pin in use??

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      What foliage are you seeing this on? I've had an issue with megascans trees where it looks like they stretch up and down instead of swaying in the wind. There's a blueprint you can edit if you're experiencing that.

    • @wpwscience4027
      @wpwscience4027 ปีที่แล้ว

      @@MichaelRoyalty I have a combination of the wind, simple grass wind, and a sine based foliage sway function. I was able to rule out the simple grass wind, by plugging that up by itself. The bug for me looks a bit like a dither that smears like paint rushing towards you constantly. I almost left it because it kind of looks cool when a whole forest does it, but I needed that offset culling otherwise my frames are garbage.

    • @MichaelRoyalty
      @MichaelRoyalty  ปีที่แล้ว

      @@wpwscience4027 That sounds a bit like the problem with the MF_SimpleWind function, which is caused by the function referring to local space at one point. It doesn't cause issues when the static meshes are separate, but when they're generated with a PCG graph they need to use world space.
      If you like it keep it, weird stylized graphics effects are great.
      But if you want to update it, try going to one of the material instances that has this issue, find the parent material, and open its blueprint. Find the MF_SimpleWind node and drill into it. Inside SimpleWind, near the center, there should be a "Main Rotator" comment with an "ObjectPivotPoint" node inside of it. Drill into the ObjectPivotPoint node. There should be two TransformPosition nodes, one or both of them may be set to the destination "Local Space", change them to "Absolute World Space".