Stylized Grass Shader Documentation

Stylized Grass Shader

Stylized Grass Shader
Version: 1.4.2
Review

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. 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.

On the grass material itself you can specify which color channel should be used for: shading, wind & bending. Though typically, you can use a simple gradient in the Red channel for everything (default configuration).

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 April 18, 2024
5 of 5 users found this section helpful
Suggest Edit