menu

Procedural Grass

2022

A system created for Sky Sailors that procedurally generates grass on floating islands. This was a bit of a problem because the islands are procedurally generated at runtime so the grass positions also must be.

The grass blades are completely rendered using a procedural shader, without any physical game objects. A grass script generates a number of random grass positions on the loaded islands each frame until the grass quota is met. These positions are passed to the shader, which is then told to create a quad for each position. The shader is also passed some random per-island data, such as the grass height, color map, and mask map. It draws each quad and calculates color and lighting per vertex. The system can easily handle millions of grass blades.

Grass Example Grass Example Grass Example Grass Example