Stylized Grass Shader
8.Using custom meshes
The package includes several pre-made grass prefabs, ready to use. If you’re looking to use your own grass meshes that is possible as well.
For the shading and animations to function properly, part of the mesh must have vertex colors painted into it (only the red color channel is needed). You can do this in any 3D modeling tool. Please refer to their manuals on how to achieve this.
For grass, you’d want to paint just the top vertices of the mesh. Whilst leaving the root black. The color should represent a vertical gradient.
For more complex meshes, such as shrubs, baking Ambient Occlusion into the vertex colors usually works well too.
The vertex color denotes which parts of the mesh should be affected by wind and bending. It is also used as a mask for the Ambient Occlusion and Color Map Height parameters.