Realtime Grass Rendering

Update, 19 July 09: Kevin has got a tutorial on his site. He's also posted his thesis which has got the latest versions of his algorithm, including extensions for uneven terrain.

Kevin Boulanger presented a novel and effective grass rendering technique as a sketch during Siggraph 2006.

The key to the technique is that there are three regions of level of detail, in which a different rendering method is used for each. In the foreground, grass meshes are instanced. This grass is rendered with a shadow map, and so self-shadows.

This is a close up of the red region, the highest level of LOD. Each blade is a quad strip with associated texture and alpha cutout mask.

The next region, shown in blue, is rendered as vertical volume slices, not unlike the method described in this article on forest rendering. The furthest region shown in green, is rendered using horizontal volume slices.

A hand drawn density map is used to control where the grass appears. For the near field, the density map controls instancing of mesh geometry. The field grass itself is divided into a quadtree of cells. Each blade of grass is assigned a threshold compared against the value in the density field to determine whether it will be rendered. Random symmetries of these cells are used to avoid visual repetition.

For mid and far field grass, the density map controls the probability that an individual blade of grass will be rendered as the GPU does the volume slicing. The texels in the volume slices encode the threshold value for comparison versus the density map. The GPU rejects blades of grass whose threshold is below the encoded density. This technique is a nifty way to avoid storing massive amounts of instancing information.

The volume slicing method uses bi-directional texture functions as described in "Real-time rendering of realistic grass", by Shah, Konttinen, and Pattanaik in Proc. 3rd Intl. Conf. on Comp. Graphics and Interactive Techniques in Australasia and South East Asia, 2005.


Content by Nick Porcino (c) 1990-2011