Dissecting and Optimizing UE's Simple Grass Wind material function

Поділитися
Вставка
  • Опубліковано 26 січ 2025

КОМЕНТАРІ •

  • @BenCloward
    @BenCloward 2 роки тому +12

    This video is fantastic! I think I might want to pivot around the object's origin with a multiplier based on vertical distance from the origin so the tops of the grass blow more than the bottom.

    • @VisualTechArt
      @VisualTechArt  2 роки тому +1

      Yeah, that would result in a nice enough motion :D The only issue I may see is that it wouldn't preserve the mesh length throughout the bending

  • @Xperto_
    @Xperto_ 2 роки тому +3

    This is timely as I'll be doing tree shaders soon :D

  • @QuakeProBro
    @QuakeProBro 2 роки тому +3

    The simple grass wind always looks like everything‘s under water. If you want to create realistic wind motion, you need to push the whole object (minus vertices that are „attached“ to the ground) in the wind direction and then after it passes a threshold, let it swing back to 0. I used the rotate about axis for that. With the per instance random and a multiply, you can get rid of the synced motion. After that we need some secondary movement for the details, for that you could actually use the simple grass wind in a super subtle way, however there are much simpler ways of doing so, for example using a texture based approach.
    This approach doesn’t really work with clustered grass meshes and is best used with single small patches of grass or taller plants where everything is near the pivot on x and y.
    Great Video!

    • @VisualTechArt
      @VisualTechArt  2 роки тому +1

      You definitely did your homeworks man :D I agree with you! Looks like your approach would lead in a more than decent result, I probably would try to not rely on textures at all though. And maybe for grass patches some baking could be used to retain the single grass blades position, etc ;)

    • @QuakeProBro
      @QuakeProBro 2 роки тому

      @@VisualTechArt Yeah true, using textures could also lead to some weird choppy movement (pixels to vertices), also saving the extra instructions is nice^^ Textures are useful if you want to handcraft exactly how the grass should behave. In my most recent attempt I use time with a sine and a vertex color gradient for additional wind detail. The gradient has multiple uses: Fake ambient occlusion, masking out the wind effect where the grass is connected to the ground and the extra wind detail.
      Also regarding the rotate about axis method above, the curve of the vertex color gradient could be modified to create different effects. Smooth for wind and an abrupt falloff if the grass was damaged by the player…

    • @VisualTechArt
      @VisualTechArt  2 роки тому +1

      @@QuakeProBro Yes, there's an endless amount of possibilities :D

  • @malebeery6832
    @malebeery6832 2 роки тому +1

    you are so professional, thank you

  • @Xperto_
    @Xperto_ 2 роки тому +2

    Here early! Will watch this later

  • @TXNNGVGX
    @TXNNGVGX 2 роки тому

    [SM6] (Node RotateAboutAxis) Cannot cast from smaller type float2 to larger type float4. ue5.1

    • @VisualTechArt
      @VisualTechArt  2 роки тому

      You're plugging in a node that has only RG into a pin that accepts RGBA, can you pin more precisely when/where are you getting that error? :)

    • @Kermitable
      @Kermitable Рік тому

      @@VisualTechArt 4:43, Mask RGB -> Mask RG into Normalize results in the error the comment made.

  • @ArianVik_Art
    @ArianVik_Art 2 роки тому

    I just tried dissecting the simple wind node, and found myself utterly confused -- thanks for the clarification!
    Also I cannot understand why they by default have an Append node not fed into anything right before RotateAboutAxis lol

  • @YuuJer
    @YuuJer 2 роки тому

    is that shader playground a website? It doesn't seem to want to work right in my chrome or edge, are you using an app?

    • @VisualTechArt
      @VisualTechArt  2 роки тому

      It is the website, if you're using the last Radeon compiler, last time I checked it was broken :)

    • @YuuJer
      @YuuJer 2 роки тому

      @@VisualTechArt oh it's working now, maybe it was under maintenance at the time or something

  • @dragondev2617
    @dragondev2617 2 роки тому

    Can you share the new function file so we can replace it?

    • @VisualTechArt
      @VisualTechArt  2 роки тому

      I sometimes do share stuff, looking to do more of it in the future :)

  • @AndrewRafas
    @AndrewRafas 2 роки тому

    There might be a reason to use multiple instructions instead of sin: if there are much more execution units which can calculate the longer code than units calculating sin/cos, then it can be faster to use multiple instructions, as the trigonometry unit can become a bottleneck.

    • @VisualTechArt
      @VisualTechArt  2 роки тому

      I see, I didn't consider that! Thank you :D

  • @cmds.learning7426
    @cmds.learning7426 2 роки тому +1

    cool

  • @schrottiyhd6776
    @schrottiyhd6776 2 роки тому

    Pivot Painter 2 is very useful to make those animations look realistic!

    • @fddesign
      @fddesign 2 роки тому

      But, it's hard to generate a PP2 without going in 3DSmax to generate texture map :(...Maybe PP3 will make it easier in the future?

    • @schrottiyhd6776
      @schrottiyhd6776 2 роки тому

      @@fddesign there is a pretty good blender add-on that's working for 3.0 I think

    • @fddesign
      @fddesign 2 роки тому

      @@schrottiyhd6776 Do you know a great and simple tuto about this? Or a link to the addon?

  • @TorQueMoD
    @TorQueMoD 2 роки тому +1

    I've never hated a shader more than Unreal's grass wind. The guy who wrote it should be forbidden from ever creating shader effects again.

    • @ethanwasme4307
      @ethanwasme4307 Рік тому +1

      could be wrong, but we've had the same simple wind node since UDK xD

  • @Moliser3
    @Moliser3 8 місяців тому

    整挺好!

  • @laughingjackaso8163
    @laughingjackaso8163 22 дні тому

    mind blown. i hate this function as well, it just looks wierd. i wish my maths ability was more than smooth-brain to actually understand and appreciate what you do. i watch Ben Cloward as well, and the maths just looses me, so i revert to copying and fiddling to see what happens.

  • @Maniac-Design
    @Maniac-Design 2 роки тому

    I always found Simple Grass Wind not realistic at all, the best is to use pivot painter 2 in addition to an additional wind movement, even if you do stylized style, a good wind system makes the difference visually.

    • @VisualTechArt
      @VisualTechArt  2 роки тому +1

      Yes! Pivot painter is definitely a good tool :D

  • @zsenkrad
    @zsenkrad 2 роки тому

    first of all, I am not a fan of the original function, it just don't look good at all.
    the so-called optimizations you did there are just mambo jumbo. the only really effective thing was the cutting of the z- component of the calculation. the rest had little to no effect.
    I would have gotten rid of the rotate about axis node first. this is by far the most expensive operation in the function.
    also don't use const bias it cost one instruction more than just doing the range remapping with mult and (neg) add.

    • @VisualTechArt
      @VisualTechArt  2 роки тому

      I actually pointed out that stripping the Z component was the most effective thing :)
      As I pointed out when I was doing something to make the function more flexible and/or readable.
      How would you have rewritten the rotation without the RotateAboutAxis?
      And why you say that about the ConstBiasScale? In shader toy (not displayed in the video) I tryied remapping with both MultAdd and AddMult. While the instructions called were different, the clock cycles didn't change... Unless the ConstantBiasScale does something more other than AddMult, but it isn't the case as far I know