Removed overhead entirely. The nice thing about the way the SpeedTree wind animation works is that you basically just have to set the wind parameters once and then plug in the current time which is already available in shaders via the _Time.y variable. You only lose that you can fade-in/-out each variable with a different graph.
These are the parameters you have to set
_ST_WindVector.xyz = Wind direction, will be normalized if it isn’t; Vector length can’t be used for wind strength
_ST_WindVector.w = Amount of fine detail? 0-1 where 0=coarse and 1=fine but very subtle - default 0.5
_ST_WindGlobal.x = _Time.y, SpeedTree8 automatically adds instance pos for variation
_ST_WindGlobal.y = Amount of oscillation independent of wind direction? 0-20, default 10
_ST_WindGlobal.z = How much height contributes to wind linearly?, 0.001-0.1 (must not be zero), default 0.015
_ST_WindGlobal.w = How much height contributes to wind exponentially?, 1.0-10.0, default 1.75
_ST_WindBranch.x = _Time.y
_ST_WindBranch.y = How much branches are affected by wind, 0-1
_ST_WindBranch.zw = unused
_ST_WindBranchTwitch.x = Amount of branch twitching, 0-1, default 0.5
_ST_WindBranchTwitch.y = Frequency scale factor for branch twitching, 0.01-5.0, default 1.0
_ST_WindBranchTwitch.zw = unused
_ST_WindBranchWhip.x = Amount of whipping for palm tree branches, 0-1, default 1.0
_ST_WindBranchWhip.yzw = unused
_ST_WindBranchAnchor.xyz = Anchor point for palm branches, must have positive adherence
_ST_WindBranchAnchor.w = How much of an effect the anchor has on palm branches, 0-1, default 1.0
_ST_WindBranchAdherences.x = How much the branches react to wind direction, 0-1, default 1.0
_ST_WindBranchAdherences.y = How much frond branches react to wind direction in addition to the global value, 0-1, default 1.0
_ST_WindBranchAdherences.zw = unused
_ST_WindTurbulences.x = Time scale factor for branch turbulence, 0.01-100.0, default 1.0
_ST_WindTurbulences.yzw = unused
_ST_WindLeaf#Ripple.x = _Time.y
_ST_WindLeaf#Ripple.y = Amount of ripple for leaves in group 1 or 2, 0-1, default 1.0
_ST_WindLeaf#Ripple.zw = unused
_ST_WindLeaf#Tumble.x = _Time.y
_ST_WindLeaf#Tumble.y = Amount of lifting for leaves in group 1 or 2, 0-1, default 0.2
_ST_WindLeaf#Tumble.z = Amount of twisting for leaves in group 1 or 2, 0-1, default 0.3
_ST_WindLeaf#Tumble.w = Amount of rotation for leaves in group 1 or 2, 0-1, default 0.0 (the LeafTumble parameter is called fAdherence but I think this is rotation)
_ST_WindLeaf#Twitch.x = Amount of twitching for leaves in group 1, 0-1, default 1.0
_ST_WindLeaf#Twitch.y = Contribution power of leaf twitching in group 1, 0.01-100.0, default 1.0
_ST_WindLeaf#Twitch.z = _Time.y
_ST_WindLeaf#Twitch.w = unused
_ST_WindFrondRipple.x = _Time.y
_ST_WindFrondRipple.y = Amount of frond ripple, 0-1, default 1.0
_ST_WindFrondRipple.z = Time scale factor for frond ripple, 0.0-100.0, default 1.0
_ST_WindFrondRipple.w = How much lighting is adjusted for frond ripple, 0-1 default 1.0
_ST_WindAnimation.x = _Time.y (just for palm tree turbulence)
_ST_WindAnimation.yzw = unused
The following parameters must be multiplied by wind strength:
_ST_WindBranch.y
_ST_WindBranchAdherences.y
_ST_WindLeaf#Ripple.y
_ST_WindLeaf#Tumble.xyz
_ST_WindLeaf#Twitch.x
_ST_WindFrondRipple.y
Also _WindEnabled must be set and != 0 (boolean)
I recommend scaling _Time.y by a random number near 1 to break synchronization between trees
You may want to convert the original parameters to static globals so that you can set them in the shader. Make sure to put your own parameters into an instancing block. You can add some turbulence to the wind direction but you have to do it per tree because otherwise it looks like a choreography.
You need an additional component on the same object that has the WindZone component because the WindZone component doesn’t set any shader parameters. The wind direction is simply the forward vector of the object that has the WindZone compoonent. The wind strength is windZone.windMain. You can also pass windZone.winTurbulence to the shaders.
Disclaimer: I found this by trial and error and by looking a SpeedTreeWind.cginc- no guarantee that it is correct. Some of it is also documented here: https://docs.speedtree.com/doku.php?id=advancewind
PS: This is what we did but it’s pretty crazy and I’m not saying everybody should do it.