Setting Up Grass

Overview

For grass objects, CRYENGINE has some special shader parameters, which improve their look and behavior. Use the Vegetation Shader on all vegetation objects to make use of the specific features for vegetation objects.

Shader and Surface Type

  • Make sure you choose "Vegetation" as the shader model being used on the model.
  • For small grass patches, turn on "Grass" in the Shader Parameters section of the grass material.
  • For Big Grass patches turn on "Grass" and "Fit to terrain" in vegetation shader generation parameters.
  • Read more information on the Vegetation Shader here.

Align to Terrain and Fit to Terrain

Both technologies are available for vegetation objects, but an object may be better suited to use one of these settings instead of the other.

To illustrate the two different approaches, we'll see below how vegetation objects are distributed along the terrain.

DefaultAlign Terrain

Fit TerrainAlign & Fit Terrain
  • Align to Terrain: This option is turned on in the objects properties in the Vegetation tool. It rotates the whole object to align its local z-Axis with the terrain's normal.
    Do not use it at 90 degree angles, as it will look wrong. Turn off "align to terrain" for big grass patches in the Option Parameters, otherwise this will create an unnatural look for the object.
  • Fit to Terrain: This option is turned on in the Shader Generation Params of the object's material. It moves the polygons along the local z-Axis to perfectly attach to the terrain. The object is not rotated.

Grass Placed as Procedural Vegetation

The placement of procedural vegetation is controlled by the texture layer with which the vegetation object is associated. Wherever the texture layer is painted, procedural vegetation objects are being displayed. This is a quick and dirty way to automatically cover a huge area with grass.

Object Setup in the Vegetation Tool

The setup within the vegetation tool is almost the same as for manually placed vegetation objects. To enable procedural placement, the asset needs to associated with one or more texture layers.

In the "Use On Terrain Layers" section (see the red box below), you simply turn on and off whether the object is being used by a terrain layer. This automatically distributes the asset in all the places, the texture has been painted.

Important Notes About Procedural Vegetation
  • You can use any object you use as a vegetation object, i.e. trees.
    Still, only smaller objects should be used as procedural vegetation as this kind of vegetation is only rendered in sectors around the player and big objects might appear with very obvious popping effects.
  • Procedural vegetation needs a memory cache of 8 MB. Therefore it is advisable to manually place grass, in order to save memory. Procedural vegetation makes most sense in huge levels.
  • Keep the overall radius of the procedural vegetation object small.
  • The placement on the terrain texture layer is based on the pivot of the object and bigger objects might overlap with other terrain texture layers. This is most obvious if you have two very different materials meeting, like grass and mud. (see below)