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)
UV3 V (vertical): Stiffness
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 (UV3) represents a gradient from the base of the tree, to its tip. Without the gradient, the entire tree will appear to move. You can define the stiffness for a tree by adding a 3rd UV map to the mesh (UV2 is always used for lightmaps/GI) then create a planar UV map on either the X or Z axis.
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.