A deep dive into rendering realistic grass foliage in Unity using real 3D geometry instead of flat quads. Covers creating a grass blade mesh in Maya, fragment shader-based coloring with gradients and ambient occlusion, and a scrolling wind animation using noise-distorted sine waves sampled via a compute buffer. The second half tackles the severe performance cost of instancing millions of grass blades and introduces GPU frustum culling via the scan-and-compact algorithm (prefix sum scan) to cull non-visible blades while keeping the position buffer contiguous in memory, achieving nearly 50% performance improvement when facing the grass field.

11m watch time

Sort: