Ben 3 times now you have created the exact tutorials I needed at the times I've needed them the most. First was rock layers, than water and now this one with tree swaying to directional wind. Thank you so much, your tutorials are very informative and have been of so much use.
Hi there, I know this is an old video, recently I found that, if we use preskinned local bounds node's Max output, shader works with foliage tool. We dont need to manually enter the value. And Object scale Z value deforms foliage wrong. At least for me. But one thing is, after replacing Object radius with preskinned local bounds node, we need to edit nodes values after that node. I used different nodes for more controll than video. After divide node, I used cheapcontrast, power, add, multply to correct bending "artefact" and to controll from how low bending happens. Hope it will help to anyone.
I'd like more tutorials on the water: - boundless ocean (LODs?) - waves layering on top of each other - get the height value at a given position out of the material (for buoyancy outside the shader). Typically most oceans compute the waves twice (in C++ and in shader) cuz 'there is no way' to get the height data out of the material. Maybe they're wrong - sprays at the waves crest - foam on the waves Etc.
This does not work for instance foliage type component as instanced foliage types return the origin of first instance. Instanced static mesh component works. Both UE5 demo medival village and megascan packages all use pivot painter. Hopefully Ben can do a video explaining the pivot painter implementation.
A very interesting lesson, but I would like there to be dependencies on the values of the wind class, so that through this class it would be possible to control the settings of all vegetation.
why in yours the smaller the object the much larger the sway? Like if i have a tube for a wire as a mesh thats 1meter it sways off 30 meters ot the left.. but if the wire isl like 100 meters it sways very little...
Getting really weird moving shadows when using hardware ray traced shadows, the evaluate world position offset doesn't seem to work on the static mesh or foliage instance.. very weird
Love whatever you'll give me but I wouldn't mind a more thorough explanation on something's. I know you're keeping this channel pretty focused on shader math and not touching assets but definitely would enjoy a few topics. Pivot painter, more vertex displacement examples, some interaction with blueprints (even simple character/ object interaction), post processes materials, you could discuss things that deal with old school techniques ( ie faking cube maps using fresnel and reflection vectors), using custom hlsl node to do meta balls or anything raymarching. really anything. I look forward to these each week definitely a truly enjoyable channel.
Ah, solved thanks to commenters below!! Basically the object radius node prevents it from working as foliage, so replacing the node with a scaler value (around 81 in my case for wheat) multiplied by the 'z' output of an 'object scale' node.
Hi can you make a video about rotatin and perhaps translating leafs on the ground, like leafs on the floor been affected by the wind like a spring season?
Hello Ben! Great tutorial, i just have a problem when painting foliage with a foliage tool. Sway works perfectly when it's a static mesh but it doesn't move at all when i use foliage tool, is there a way to fix it?
Thank you! I haven't made any videos about tree trunks specifically. I think I just left the trunks using the material that they came with. If you're looking to make the trunk sway, you should be able to just use the sway from the leaves but leave our the detailed movement.
Ok, thanks for letting me know. I haven't used the foliage tool yet. I think generally you'll want to hand-place larger trees anyway - and those would be using this sway method. Then you could use the foliage tool for placing bushes, grass, and smaller things like vines.
@@BenCloward procedural foliage spawner was developed by Epic mainly how quick tool to spread a lot of trees, by simulating seeds and growing process, so for big maps, place every tree by hands its a old school way) maybe you'll check how this sway shader can be modified for foliage tool ) thx a lot!)
I was having the same issue as well - I believe this is due to the object radius node towards the end - if you can set it manually then it has solved the problems for me.
Setting the value manually as Delta au said worked but the sway of the tree seems to be determined by the tree size. I fixed this by multiplying the value by ObjectScale on the z axis and its much more uniform.
Im Just confused. Rotation axis of the leaf should always match to wind direction. But in the video you make cross product between wind direction and Z axis. Im very dump at match. So....🙄. If anyone figure it out. Please let me know🥺
This would be easier if I could draw you a picture to explain it. The z axis is pointing straight up. If you cross that with the wind direction, you get an axis that is perpendicular to both of them. So if you then rotate around that axis, you will be rotating in the wind direction. If you were to rotate around the wind direction you would get a side to side rotation relative to the wind - which is 90 degrees off from what you want.
@@BenCloward ahhh. I get it. Leaf will rotate around the axis, not follow along the axis . 😅. Now i know. Well, It would be easy to visualize if leaf just gone to the wind direction. My brain hurt
Ben 3 times now you have created the exact tutorials I needed at the times I've needed them the most. First was rock layers, than water and now this one with tree swaying to directional wind. Thank you so much, your tutorials are very informative and have been of so much use.
Right to the point. Figured out what I was looking for immediately. Great tutorial!
your tutorials are amazing, greetings from Russia
Спасибо!
used this in a game jam thank you so much
Hi there, I know this is an old video, recently I found that, if we use preskinned local bounds node's Max output, shader works with foliage tool. We dont need to manually enter the value. And Object scale Z value deforms foliage wrong. At least for me. But one thing is, after replacing Object radius with preskinned local bounds node, we need to edit nodes values after that node. I used different nodes for more controll than video. After divide node, I used cheapcontrast, power, add, multply to correct bending "artefact" and to controll from how low bending happens. Hope it will help to anyone.
Hello, please tell me, do you have a video where you animated the trunk of your tree
You're the best Ben thank you!!!!
thanks a lot buddy.. keep up the good work,, i really wish you best of luck to grow the channel because you are the best on youtube..
I'd like more tutorials on the water:
- boundless ocean (LODs?)
- waves layering on top of each other
- get the height value at a given position out of the material (for buoyancy outside the shader). Typically most oceans compute the waves twice (in C++ and in shader) cuz 'there is no way' to get the height data out of the material. Maybe they're wrong
- sprays at the waves crest
- foam on the waves
Etc.
This does not work for instance foliage type component as instanced foliage types return the origin of first instance.
Instanced static mesh component works.
Both UE5 demo medival village and megascan packages all use pivot painter. Hopefully Ben can do a video explaining the pivot painter implementation.
Do the tree assets have to be SpeedTree Assets? When i try to use this shader, the trees dont sway, so much as get thicker and thinner.
seems late but do you have the grass, I've tried subtracting the LinearGradient but still same output.
A very interesting lesson, but I would like there to be dependencies on the values of the wind class, so that through this class it would be possible to control the settings of all vegetation.
why in yours the smaller the object the much larger the sway? Like if i have a tube for a wire as a mesh thats 1meter it sways off 30 meters ot the left.. but if the wire isl like 100 meters it sways very little...
Getting really weird moving shadows when using hardware ray traced shadows, the evaluate world position offset doesn't seem to work on the static mesh or foliage instance.. very weird
intro sounds a lot like goose bumps hahaha
It appears to me the property : wind speed of wind node is not a constant .it keep increasing?? otherwise it cant be animation...
Love whatever you'll give me but I wouldn't mind a more thorough explanation on something's. I know you're keeping this channel pretty focused on shader math and not touching assets but definitely would enjoy a few topics. Pivot painter, more vertex displacement examples, some interaction with blueprints (even simple character/ object interaction), post processes materials, you could discuss things that deal with old school techniques ( ie faking cube maps using fresnel and reflection vectors), using custom hlsl node to do meta balls or anything raymarching. really anything. I look forward to these each week definitely a truly enjoyable channel.
Great tutorial, I managed to create some great looking wind, for some reason though it doesn't work on foliage instances in UE5.2, any ideas?
Ah, solved thanks to commenters below!! Basically the object radius node prevents it from working as foliage, so replacing the node with a scaler value (around 81 in my case for wheat) multiplied by the 'z' output of an 'object scale' node.
Hi can you make a video about rotatin and perhaps translating leafs on the ground, like leafs on the floor been affected by the wind like a spring season?
These two videos may be what you're looking for: ruclips.net/video/q62CdbKNdJQ/видео.html, ruclips.net/video/aLCgoI0oYUo/видео.html
@@BenCloward Thanks!!
Hello Ben! Great tutorial, i just have a problem when painting foliage with a foliage tool. Sway works perfectly when it's a static mesh but it doesn't move at all when i use foliage tool, is there a way to fix it?
Nevermind, I found answer in the comments below!
为什么刷出来的植被不会动,摆出来的才会动,是因为绝对世界位置吗?
Yes. You'll need a different wind solution for vegetation that's applied with the brush tool.
Awesome :D
Hi Ben! do you have a video on the tree trunk shader ?
ps. your channel is a gem for anyone interested in game development. Learning a ton
Thank you! I haven't made any videos about tree trunks specifically. I think I just left the trunks using the material that they came with. If you're looking to make the trunk sway, you should be able to just use the sway from the leaves but leave our the detailed movement.
Very usefull lesson! but it`s way of swy work only for static meshes and didn`t work for meshes spawn by foliage (
Ok, thanks for letting me know. I haven't used the foliage tool yet. I think generally you'll want to hand-place larger trees anyway - and those would be using this sway method. Then you could use the foliage tool for placing bushes, grass, and smaller things like vines.
@@BenCloward procedural foliage spawner was developed by Epic mainly how quick tool to spread a lot of trees, by simulating seeds and growing process, so for big maps, place every tree by hands its a old school way) maybe you'll check how this sway shader can be modified for foliage tool ) thx a lot!)
I was having the same issue as well - I believe this is due to the object radius node towards the end - if you can set it manually then it has solved the problems for me.
Setting the value manually as Delta au said worked but the sway of the tree seems to be determined by the tree size. I fixed this by multiplying the value by ObjectScale on the z axis and its much more uniform.
@@static2601 multiplying what value mate? ) can u show more correctly plz)
Im Just confused. Rotation axis of the leaf should always match to wind direction. But in the video you make cross product between wind direction and Z axis. Im very dump at match. So....🙄. If anyone figure it out. Please let me know🥺
This would be easier if I could draw you a picture to explain it. The z axis is pointing straight up. If you cross that with the wind direction, you get an axis that is perpendicular to both of them. So if you then rotate around that axis, you will be rotating in the wind direction. If you were to rotate around the wind direction you would get a side to side rotation relative to the wind - which is 90 degrees off from what you want.
@@BenCloward ahhh. I get it. Leaf will rotate around the axis, not follow along the axis . 😅. Now i know. Well, It would be easy to visualize if leaf just gone to the wind direction. My brain hurt
@@BenCloward OMG. I think now I know how to animate my Palm tree leaves as I want. :D Why I didnt read this coment before? Thank you again.
8:50 - 1.5 radians should be only ~ 90 degrees not 180, why did the leaves rotate 180? (I'm at halfway point of video)
Yep, that's my mistake. 1.57 radians is 90 degrees. I don't know why it rotated all the way. I'll need to go back and look at it. Good catch!
@@BenCloward perhaps in Unreal, from 0 to 1 equal 0 to 360 degree. So 1.5 is 360(+180) degree?
인정한다. 킹갓 혜자아저씨
I wish one could do the same in Maya
That's what I'm wondering! Why can't we just animate the planes in Maya like the trunk? Just for optimizing I assume?