A UV animation question related to my previous post about foliage (if anyone saw that, but it’s not super relevant).
I am currently trying something out using sine wave animation with UVs. I currently have this result using the following shader map (the single enlarged plane to the side has the vertex animation disabled so I could fiddle with the UV animation more easily).
It’s a fairly decent start when combined with the vertex animation, but of course far too constant. I was using noise with panner, rotation and world position before, but I wasn’t liking the results I was getting (something about the noise was really janky looking unless I made it really subtle, but then it was too subtle, lol).
For this attempt, I would like to have the speed of the sine wave animation vary, and preferably driven by the same noise texture/world position that I’m using for the vertex animation so that the different parts of the tree can vary. I was able to get something put together, but it was changing the shape of the animation, which is not what I want. I just want it to vary the speed per plane, not per pixel (or whatever it was doing).
Secondary question, but less important as I’m not sure I even want to do this, but if I could get the effect to be stronger on one side than the other, similar to this gif, that would be interesting to experiment with. I could use vertex color I suppose, but I’m hoping something simpler/more editable would work.
EDIT: I solved the masking to one side part, so no worries. Just needed to add this bit in. Can add a one minus node to switch to the other side if need be.
This does not have direct answers to what you want, but he explains some nodes like object location.
Also shows how to make gradient in mesh space. You could make gradient (from Z position) then use lerp with texture for various strength.
Also there was some clever material function (random done entirely in material) that derp aii hineted me to create. I just need to find it. And since it is in material it does not need any blueprints input. You can seed that random with mesh location.
search actually found it (scroll down i made pic with that function).
Drive a sine into time, use the output and some multiplier to define the first sine, then based on that sine value being over whatver you want (another scalar you control) drive a lerp that offsets the regular sine into some other sine (or the one you are using to drive so long as you dont jerk between one and the other by picking a different merge value?).
Should be fairly simple, its just more (fairly basic) math and the lerp that garner costs.
Alterbative map range clamped, clamp out values, or hard set If branches use custom node hlsl.
But i think that ultimately what you may actually want is to just use a random noise texture to drive the foliage globally in world position so that it looks like a realistic wind effect.
Wind comes in gusts. As such, a tiling noise pattern (possibly converted vectorfield using wind direction) shuffling though the x/y of the world over sine being used to drive the motion direction and intensity across all foliage will look more natural.
You can actually check out the dev logs for ghost of sushima (or whatver im sure i butcherd that name) or basically anything except stuff made with Unreal for source of learning…
That, and just scrap using the material nodes epic makes and learn HLSL.
Its faster, and you can do more with it.
I actually did have a global position/noise driven version before, but I wasn’t getting a result I liked. It’s actually pretty nice, and I could just call it done there, but there’s something kind of “stiff” about it. I dunno, maybe I’m just being overly perfectionist, but I would like further variation/exaggeration with the wind gusts. I’ve tried a few different noise textures, but so far haven’t found one that gets what I want.
So while I was struggling with that, I thought to try something else out just to see if it shook loose some other ideas. Just experimenting with a bunch of things.
But I think you’re right, and some combination of this along with a sine wave might be what I’m looking for. I will keep messing around! Thanks for the tips!
So - I cant tell precisely off the gif, but I think the leaves and the branch arent moving at the same pace?
That could be a thing if you have the WPO running on the UV localized.
Or if the tree mesh is somehow disconnected - generally have vertex at the attachment of the leaf branch to prevent movement divergence.
Combined the two styles together by literally just using a single lerp node just before plugging everything into the leaf texture. I was over-complicating things.
And was able to effect the speed of the sine wave with world position, panner and noise instead of the time node.