Stylized Grass Shader Documentation

Stylized Grass Shader

Stylized Grass Shader
Version: 1.4.0

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.

Note that the shader uses vertex animations. Complex meshes such as “tubes” of grass or other meshes with thickness will deform by the wind animations and bending. Using simple planes gets the best results, the simpler the mesh, the better.

Yes No Suggest edit
Last updated on June 4, 2022
5 of 5 users found this section helpful
Suggest Edit