Stylized Grass Shader Documentation

Stylized Grass Shader

Stylized Grass Shader
Author: jonathan
Version: 1.1.4
Dated: 31 Aug 2019

7.Blending with terrain colors #

The grass had the ability to seamlessly blend in with the underlying terrain’s color. This can also be seen in many AAA games nowadays.

Notes:

  • If you are using a terrain shader which differs from standard shading (eg toon/flat shading) the color blending cannot be accurate. Both the grass and the default terrain shader share the same lighting model, which is part of which makes the blending possible.
  • It works best when the terrain material doesn’t have a lot of high-frequency details.
  • Glossiness of terrain materials (eg wet stone or puddles) cannot be blended into the grass, since these effects depend on the viewing angle.

Setup

The following steps can be followed to set this up:

  • Select a GameObject (or create an empty one) and go to Add Component -> Stylized Grass -> Color Map Renderer

  • Assign your terrain GameObjects (these can also be mesh terrain tiles)
  • Set the size of the render area. Or choose to calculate it based on the total terrain size.
  • Click the Render button

In order for the color map to apply at runtime, this Color Map Renderer component must be present. Alternatively, you can save the color map asset and assign it to an active Stylized Grass Renderer component.

The grass shader has a “Colormap Strength” parameter. If this is set to 0, the color map will not be visible on the material.

The rendering functionality only works as an editor tool, so can’t be executed at runtime. Therefore it’s not suitable for runtime generated terrain

Yes No Suggest edit
Last updated on January 20, 2021
5 of 6 users found this section helpful
Suggest Edit