How I built a realistic grass shader in UE5! Shader driven bend, clump, tilt, wind and more!

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 มิ.ย. 2024
  • Files available as a Tier 3 reward on my Patreon: / ghislaingir
    Twitter: / ghislaingir
    Mastodon: @GhislainGir@mastodon.gamedev.place
    Links:
    Ghost of Tsushima Tech Talk: • Procedural Grass in 'G...
    Tech Art Aid - Shader Optimization: • Shader Optimization - ...
    0:00 Intro
    1:00 Context
    2:28 WPO - Base Setup
    4:37 WPO - Cards Rotation
    11:00 WPO - Clumps
    15:50 WPO - Wind
    17:52 WPO - Bend
    20:25 WPO - Camera Facing
    25:53 WPO - Landscape Mask
    27:53 Normals
    34:55 Opacity
    38:41 Pixel Depth Offset
    40:00 Color, Spec & Roughness
    40:34 Conclusion & Outro
    Hey! I'm back with some more shader shenanigans... I hope the breakdown makes sense, I tried my best! :D
    Cheers, thanks for your support :)
  • เกม

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

  • @LFPAnimations
    @LFPAnimations 3 หลายเดือนก่อน +17

    Your channel is such an excellent resource for someone learning tech art. I can't believe something this quality is just posted for free on YT. This is now the definitive UE grass tutorial for me. So much depth, yet delivered in an easy to follow package.

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

    haven't seen yr channel for some reason. now I'm big fan, sir

  • @Vectorr66
    @Vectorr66 3 หลายเดือนก่อน

    This looks amazing!!!

  • @emrice6485
    @emrice6485 3 หลายเดือนก่อน +2

    Wow you are really talented, here i am trying to understand how all these work and yet you were able to create them all from scratch (with years of experience ofc :D )

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

    I was just browsing TH-cam and this randomly poped out. I have never before subscribed so fast. This is gold.

  • @malindurashmika8386
    @malindurashmika8386 3 หลายเดือนก่อน

    Great video. You are so tallented. Best of luck

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

    Incredible!!! Liked and subscribed. Thank you so much!

  • @adrianneit4707
    @adrianneit4707 3 หลายเดือนก่อน

    Thank you very much! Very interesting!

  • @viscid09
    @viscid09 3 หลายเดือนก่อน

    Wow this is brilliant!

  • @liberator21
    @liberator21 3 หลายเดือนก่อน

    the Goat. Thanks Ghislain

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

    Beautiful grass

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

    Thanks for the most amazing grass I've ever seen, Ghislain! It's really great and so interesting. When will you publish the announced final part of the journey? I look forward to it.

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

      Thanks! Not sure about the final part :) Working on it, amongst other things...

  • @shaneldraey827
    @shaneldraey827 3 หลายเดือนก่อน

    Thank you sirrr ✨🙏

  • @chaosordeal294
    @chaosordeal294 3 หลายเดือนก่อน

    Lights out killer.

  • @TahseenUllah-dl2ie
    @TahseenUllah-dl2ie หลายเดือนก่อน +1

    thanks

  • @VisualTechArt
    @VisualTechArt 3 หลายเดือนก่อน +2

    Nice one! :D

    • @ghislaingirardot
      @ghislaingirardot  3 หลายเดือนก่อน

      Ty :D Keep up the good work!

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

    For grass alpha, I like to use a distance field alpha instead of playing with mips.
    You can easily thicken the grass blades by adding to the alpha and you can fix a lot of shadow problems in the shadow pass that way too.
    You can also easily implement a distance fade that “shrinks” the grass blades into nothingness when they are close from the camera with a simple subtraction on the alpha.
    Distance field alpha also look smoother than a typical 1bit alpha (which is why they are used for fonts)

    • @ghislaingirardot
      @ghislaingirardot  3 หลายเดือนก่อน +2

      Yep! DF alpha is very commonly used and has tons of use. It's a technique I briefly explained in my stylized grass video :)

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

      That's cool! Does that help at all with overdraw or is it the same performance hit?

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

      @@evanlane1690 Quite the contrary, DF alpha is used to gradually increase the amount of masked pixels, thus increasing the amount of overdraw.

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

    Amazing work yet again🔥 I put in a request for a volumetric fog and cloud showcase/tutorial!

    • @ghislaingirardot
      @ghislaingirardot  3 หลายเดือนก่อน +2

      Environmental effects are super important and definitely on my todo list. That list is ten foot long at this point tho... no ETA :)

    • @martinberge9237
      @martinberge9237 3 หลายเดือนก่อน

      @@ghislaingirardot understandable😂

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

    I was going to subscribe then realised i was already subscribed

  • @Jbbriant-Ardaria
    @Jbbriant-Ardaria หลายเดือนก่อน

    Regarding your issue for the geometry script at 8:20, if you generate the final mesh with PCG from random grass blades instead of doing it in blender, you could generate LODs yourself and run the geometry script per instance instead of per mesh component.
    Then you also have to encode pivot point in UVs from geometry script.

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

      Interesting! I haven't yet fully explored PCG so this is good information :D

  • @Fjaka
    @Fjaka 3 หลายเดือนก่อน

    That is indeed, a very fluffy looking grass.

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

    I have had great success with using a distance blend for the forward vs upward normal debate. I always let at least a little bit of the up normal in, but by the time the grass is at its cull distance the normal should be fully upward in my opinion. This ensures the shading is fully consistent with the underlying terrain when the blades are culled. You can use the per instance fade to offset the blend which will break up the transition and prevent a noticeable radius.
    Contact shadows (aka screen space shadows) are also often a good option for grass, as after a certain distance I find they're often nearly indistinguishable from shadow maps. I've been using proper cast shadows for the near LoDs but disabling them and using contact shadows instead for farther LoDs. This also helps make it more feasible to use virtual shadow maps, as the WPO cache invalidation is limited to only the nearest grass.

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

      Very good points! I totally agree with the upward normal making the distance culling a bit easier to deal with. Contact shadows can be a life saver for grass as well, yup :D

    • @cedric7751
      @cedric7751 27 วันที่ผ่านมา +1

      I hide the transition by simply sinking the grass blades into the ground at a distance.
      It's super cheap (just a Z axis offset) and it allows you to pop grass meshes out of existence at much shorter distances (as long as your grass color matches the landscape).
      Using PCG, I also distribute grass with a very high cull distance on top of slopes and edges, where you need the grass silhouette to be visible.

    • @Ninja1Zombie1Master
      @Ninja1Zombie1Master 27 วันที่ผ่านมา

      @@cedric7751 Both are great approaches I've also used - although I haven't tried using PCG to automate the process of placing the higher draw distance grass - that's a great idea, thanks.

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

    I'm sorry that I can't afford to get into Patreon as I am a student right now. I was super amazed by your work, and I am currently trying to replicate it using the pivot painter addon. I figured out most of the ways across on how to use the pivot painter addon however I have one key questions that I can't seem to figure out.
    How did you create the super weird looking grass models? I thought of creating one by one but I am not much confident whether I can achieve similar results and it is super time consuming
    I understand that you have a patreon for a person like me to by pass these difficulties but I seriously can't afford to use money as it is my parents. Would you please just teach me on how you created the models.
    Kind Regards
    Kota

  • @pierrecadeot
    @pierrecadeot 3 หลายเดือนก่อน

    Wow, pas spécialement concerné par le sujet, je lance la lecture par curiosité, juste pour jeter un oeil, et pouf 44 minutes plus tard je suis positivement ravi de m'être laissé entrainé par la richesse de la présentation : tout simplement passionnant ! Merci maitre !!

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

      Merci pour le message! 🙂

  • @threedai
    @threedai 3 หลายเดือนก่อน

    Welcome to our environement !

  • @lucasbaron5500
    @lucasbaron5500 5 วันที่ผ่านมา

    when is the grass model tutorial, its awesome

    • @ghislaingirardot
      @ghislaingirardot  4 วันที่ผ่านมา

      Let's say it's a work in progress... :p The scope of that third video changed and requires a lot of work. I'm trying to finish other things first.

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

    Looks so realistic & cool.
    This should be default behaviour of Megascan grass.

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

      Ty! But no, not something that can applied to existing assets. Grass mesh has to be modeled with this very specific approach in mind :) Plus, it's probably too costly to be the "default" grass.

    • @IamSH1VA
      @IamSH1VA 3 หลายเดือนก่อน

      @@ghislaingirardot ohhh…
      Is there anything that can be done to Megascans/existing assets?
      Stationary megascan looks great but when wind effects are applied they look so weird and unnatural.

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

      @@IamSH1VA I don't know, I don't actually use megascan assets. I doubt megascan assets have baked pivots tho, so there's only so much you can do with them.

    • @IamSH1VA
      @IamSH1VA 3 หลายเดือนก่อน

      @@ghislaingirardot thanks for the info…

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

    Yes that looks great but let me give you a new challenge: realistic lawn grass. It's something I've really struggled with.

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

    Where is the 10h loop with asmr wind sound, crickets etc.? 😌

    • @ghislaingirardot
      @ghislaingirardot  3 หลายเดือนก่อน

      Hehe, I'll have to think about it :D

  • @Jbbriant-Ardaria
    @Jbbriant-Ardaria หลายเดือนก่อน

    Hey Ghislain,
    The content is excellent! I've been following all the tech talks you mentioned and watched the Visual Tech Art video on grass-thanks a lot for bringing the GOD x Ghost grass to Unreal with such a clear process.
    However, I'm a bit stuck on one part of the implementation. Why use cards that all face the same direction? I get that it's not just for encoding data in the normal channel since you override that anyway. And since you're encoding the rotation in the normal channel anyway, you end up with static rotations.
    Is the reason for keeping the cards unrotated because you need to access their rotation programmatically in the shader? Having rotated cards would make this more complicated, right?
    Why not leting the card rotated, use the normal to get the rotation and compute a random rotation relative to that one?
    It would avoid recomputing the normals, no ?

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

      Thanks. The x-aligned cards are to programmatically roll cards along their up axis to best face the camera and increase pixel coverage. I mention that in the video somewhere :D That way I can also easily compute the cards forward vector and modulate the wind effect based on it

    • @Jbbriant-Ardaria
      @Jbbriant-Ardaria หลายเดือนก่อน

      ​@@ghislaingirardot Ok I got it! That point on getting better pixel coverage made a lot of sense when I've been watching this part (I binge watch all your videos on grass).
      I will get my head around why recomputing that X vector from normal orientation is a more complex idea, I still not quite understand all the vector manipulations.
      I will use PCG to generate clumps and the script you shown for geometry scripts which I'm super familiar with.

    • @Jbbriant-Ardaria
      @Jbbriant-Ardaria หลายเดือนก่อน

      Exact reason at 18:55, the shader code bends the mesh around the X axis!

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

      @@Jbbriant-Ardaria oh yeah, that reason first and foremost :D I already forgot most of that video tbh

  • @altindublaj7452
    @altindublaj7452 9 วันที่ผ่านมา

    How's performance? It's for big projects?

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

    How to get random vertex normal in maya

  • @ryanalbracht2308
    @ryanalbracht2308 3 หลายเดือนก่อน

    Could this grass shader be applied as a material to an imported site model that is a static mesh actor?

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

    I'm trying to get this to work on my custom landscape I made with a heightmap. Is there a good way to achieve this?

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

      What's the issue exactly? This grass shader isn't tied to the landscape in any way, besides the grass/dirt layer trick I explained.

  • @1221fun
    @1221fun 7 วันที่ผ่านมา

    Why your wind texture uv can scroll by it texture node self without any time node? 16:01

    • @ghislaingirardot
      @ghislaingirardot  7 วันที่ผ่านมา +1

      It doesn't scroll, it's a render target generated via my wind system. I made a video about it.

    • @1221fun
      @1221fun 7 วันที่ผ่านมา

      ⁠​⁠@@ghislaingirardot oh! Thanks!

  • @Pengman19
    @Pengman19 21 วันที่ผ่านมา

    Does this grass properly move when a player character walks through it? I apologize, but I watched the video and I still am not clear if it's physicalized in this manner.

    • @ghislaingirardot
      @ghislaingirardot  21 วันที่ผ่านมา +2

      No but it would be fairly easy to implement thanks to the way wind is added. You can inject extra offset at the same time as wind, for things like interaction and let the shader do its thing.

    • @Pengman19
      @Pengman19 20 วันที่ผ่านมา

      @@ghislaingirardot My 2 cents for your next video! 😀😅🤣

    • @ghislaingirardot
      @ghislaingirardot  20 วันที่ผ่านมา +2

      @@Pengman19 My existing advanced grass interaction system/video outputs a velocity map that could simply added to the wind offset as-is. No need for an extra video :)

    • @Pengman19
      @Pengman19 15 วันที่ผ่านมา

      @@ghislaingirardot I will check it out

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

    i was wondering if you have time for personal mentorship, i want to learn shaders for games, tech art in general. I have no resource or a complete solution for learning tech art, unlike texturing and sculpting where you gradually get good at these skills, i find math in general is difficult to self teach.

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

      No mentorship, sorry.

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

      @@ghislaingirardot can you recommend me some sources where I can learn tech art? Online schools, courses or maybe someone you know who teaches?

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

      @@devjitpaul1191 I don't know any TA that offers mentorship and I'm unfamiliar with game dev schools. It's a way too broad of a domain to recommend one 'course' or one specific way to learn being a TA. I fear you just gotta be curious and start figuring shit out on you're own like we all did :D good luck