Using the shaders with custom assets
Should you like to use the FAE/Branch shader on a tree outside of this package it must conform to a requirement, namely the Ambient Occlusion (AO). Which must be baked into the mesh’s vertex colors. This is used for shading and animation purposes.
Certain information is required to be baked into a tree mesh’s vertex colors:
Red: Ambient Occlusion
Green: Wind influence
Blue: Thickness (used for color transmission)
Generally any software that can bake Ambient Occlusion into the RGB vertex color channels will suffice. The Wind influence and Thickness information is the same as AO, just with slightly different finetuned settings.
Stiffness (Alpha channel) is less straight forward, since this represents a gradient from the base of the tree, to its tip. Without the gradient in the Alpha channel, the entire tree will appear to move. To mitigate this, set the “Trunk Weight” value on the WindController component to 0.
This information was calculated and baked using a proprietary tool, which will not be made available to end-users as it pertains source files and some third party source code.
For vegetation assets using the FAE/Foliage and FAE/Grass shader much of the same holds true. Where the AO information is used to determine which parts are not affected by wind or player interaction. As well as several other shading functions.
The tree shaders will also work with SpeedTree trees made using the Unity SpeedTree modeler.
To enable the wind animations check the “Sample SpeedTree wind” box on your branch and trunk material. The wind implementation is not the same as the SpeedTree shaders, so the animations you see in the modeler will not be the same, but similar.