shown in other instead.
The article describes all settings located on the Grasstab of theNodes window. This tab becomes available when a grass node is selected.
To add grass to the world, perform the following:
- On the Menu bar, click Create -> Object -> Grass.
- Place the grass object somewhere in the world.
- Set the required grass parameters described below.
|Num textures||Sets how many grass clusters (or plants, or flowers) are lined up horizontally in the diffuse texture. Learn more about this parameter here.|
|Radius||Distance to draw additional grass blades outside the view frustum. This option allows eliminating popping of shadows at the edges of the screen when the camera is turning.
The shadow radius to set depends on the grass size and the angle of the sun (which determines how long the shadows from it would be).
Set the minimum possible value, as this parameter increases rendering load (check RTriangles counter in the performance profiler).
|Size X||Specifies the length of the grass area along the X axis.|
|Size Y||Specifies the length of the grass area along the Y axis.|
|Step||Sets the size of the cells into which the grass field is split.
|Subdivision||Subdivides each cell into the specified number of parts.|
|Density||Determines how many grass quads are to be rendered per square unit taking into account the step of division and the number of cells.|
To randomize appearance of grass quads, two types of values are used:
- Mean value(i.e.Aspect, Minimum/Maximum Height, Offset) defines the average value. With its help the designer can set setting milestones to control the parameter.
- Spread valuedefines the range for possible variation of the parameter. The higher the value, the more diverse the final result will be.
Spread value is optional: if set to 0, it will not influence the simulation process and only the mean value will be uniformly used.
After these values are specified, the following formula is used to calculate the final result for the parameter:
Spread value is optional: if set to 0, it will not influence the simulation process and only the mean value will be used for all objects.
|Variation||On the randomly chosen quads, flips the diffuse texture horizontally, automatically giving two variants available for rendering of varied blades.|
|Min height||Determines the mean value for the minimum height of the grass blades quad that is rendered in areas with low density according to the image mask. The higher the Min height value, the higher the grass will be in areas with low density.
|Max height||Determines the mean value for the maximum height of the grass blades quad that is rendered in areas with high density according to the image mask. The higher the Max height value, the higher the grass will be in areas with high density.
|Aspect||Sets an aspect to calculate the width of a grass quad:
Width = Max height * AspectAspect is set for each of the diffuse texture columns separately and can be randomly varied if spread value is set in addition to mean one.
|Offset||Specifies the offset in units up the surface normal, thus accurately repeating its relief. It is set by mean value (only positive) and additional spread value (positive or negative), if variation is required.|
|Probability||Sets the grass rendering probability per diffuse texture column.|
|Seed||Sets an integer value used to generate pseudo-random successions of numbers. The parameter is used to randomly position grass blades quads across an area by an image mask.
To get a random seed value, press the Randomize button.
The same Seed value will always generate the same successions of numbers.
Masking Grass Areas
|Mask image||Mask that determines the density distribution of the grass.
|Threshold||Controls starting from what density (according to the mask), the grass should grow. This means, that if in some particular place the threshold value is higher than the color or alpha value of the mask, it is rendered grassless.
|Min value||Image mask minimum value of the color density range. Read more here.|
|Max value||Image mask maximum value of the color density range. Read more here.|
|Flip X||Flips an image mask horizontally.|
|Flip Y||Flips an image mask vertically. For example:
After flipping the image mask by the Y axis, the grass has started growing on the stony area. Density and color of grass growing on the presented area have also changed.
|Mesh mask||Mesh-based mask that is used to specify areas where grass can grow. A mesh for masking should be a simple planar mesh.
Mesh used as a mask
|Inverse||Toggles the value that indicates if grass grows inside or outside the mesh contour.|
The field mask set for the grass object must match the field mask of a Fieldnode applied to the grass object.
Orienting Along the Relief
|Intersection||Flag indicating whether grass should follow the relief.|
|Orientation||Flag indicating whether grass polygons are oriented along the normal of its parent node (for example, terrain).
Read more here.
|Angle||Sets the ground slope angle.
|Thinning||Flag indicating whether grass is thinned out with a distance.
|Spawn||Sets the number of cells rendered each frame. The higher the spawn rate, the more likely a performance spike will occur.|
|Triangles||Counter that shows the total number of grass polygons. The shown values can be, for example, compared after changing some parameters in order to improve performance.|