Nature Renderer comes with the Nature Shaders package, which contains 4 different shaders for your vegetation that enables you to use wind:
- Nature Shaders/Grass
- Nature Shaders/Vegetation
- Nature Shaders/Tree Leaves
- Nature Shaders/Tree Bark
These shaders rely on some information from your model's vertex colors to work correctly.
Grass and Vegetation
There are 3 different wind control methods available for the grass and vegetation shaders. These control which parts of your model receive wind, how strong that wind is, and how your model should bend.
1. Baked Vertex Colors
Uses baked data from your model's vertex colors. This data can be calculated by a script or hand-painted in any 3D modeling software.
Channel | Description | Range |
Blue | Rotation Axis | 0 (Horizontal) - 1 (Vertical) |
Red | Mask | 0 (No Wind) - 1 (Default) |
Green | Phase Offset | 0 (Full Offset) - 1 (No Offset) |
Alpha | Height | 0 (Ground) - 1 (Top) |
When using Baked Vertex Colors you can manually paint RGB values (or leave them white/empty) and automatically calculate the alpha (height) channel for your model. Assign a material with either the grass or vegetation shader to your model in the model's import settings and the vertex colors will be calculated for you (you might have to reimport the model).
2. UV
An approximation of your model's shape is calculated using the UV coordinates and vertex positions. When calculating it is assumed that the ground is at the bottom of the texture.
3. Vertex Position
An approximation is calculated using the local vertex positions of the model. Vertices with a Y position of less than or equal to 0 are assumed to be on the ground and will not receive any wind. Vertices with a Y position of 1 are assumed to be at the top of the model and will receive full wind.
If your model is only 0.5 units tall then it will only receive 50% of the wind strength.
Tree Leaves and Bark
1. Baked Vertex Colors
The tree leaves and bark shaders use the same vertex data as Unity's Tree Creator. They work automatically with all trees created with Tree Creator.
2. UV
An approximation of your model's shape is calculated using the UV coordinates and vertex positions. When calculating it is assumed that the branch is at the bottom of the texture.
3. Vertex Position
An approximation is calculated based on the tree's vertex positions. Branch movement will be disabled and leaves will have consistent wind movement across the entire leave mesh. The leaves can move off the branch slightly when using strong wind settings.