Project

GPU-driven procedural grass rendering

grass rendering system that generates, animates (via Bézier curves and Perlin noise wind), and draws grass blades entirely on the GPU using compute shaders and DirectX 12's ExecuteIndirect to minimize CPU overhead.

🔧 C++ Custom engine 👤 Solo 💻 DirectX 12

Article going deeper into the implementation details of the grass system:

Procedural Grass with GPU Driven Rendering In DirectX12

Procedural Grass with GPU Driven Rendering In DirectX12 This is a short blog post on how I managed to draw 2 million grass blades in DirectX12 using a GPU driven technique while keeping the overall...

My contributions

Procedural Grass Blade Generation

Created grass blades from predefined vertex positions, deformed per-instance using hash-generated random values for position, rotation, and height.

Using Bézier Curve To Displace Blades

Displacing the vertices of the grass blades in the vertex shader using the Bézier curve to get a natural looking bend. In the same shader we also calculate the derivative to get the normals.

Perlin Noise Wind System

Animated grass by offsetting the top Bézier control point with a scrolling Perlin noise, with configurable settings to modify wind direction, strength, frequency, and amplitude of the noise.

GPU Driven Rendering

Generated draw commands on the GPU via compute shaders and executed them with DirectX 12's ExecuteIndirect to minimize CPU overhead.

Base For Frustum Culling & LOD System

Level of Detail system of the grass blades and culling techniques are still a work in progress, but the base implementation is there via indirect rendering.