Tony Yiding Tian

Vulkan Grass Renderer

A million blades of grass, simulated and culled on the GPU

Vulkan, GLSL, C++ · Oct – Nov 2025

A dense field of grass blades bending in the wind under a pale sky

A real-time grass renderer in Vulkan, after Jahrmann and Wimmer's "Responsive Real-Time Grass Rendering for General 3D Scenes" (I3D 2017). Up to 2²⁰ blades, about a million, are simulated and culled in a compute pass every frame, then tessellated into geometry by the graphics pipeline.

A blade is a curve

Each blade is a quadratic Bézier curve, its three control points packed with its parameters into 64 bytes:

struct Blade {
  vec4 v0;  // base position, and orientation θ
  vec4 v1;  // Bézier guide point, and height
  vec4 v2;  // tip, moved by the forces, and width
  vec4 up;  // resting up direction, and stiffness
};

The forces move only the tip, v2. The guide point v1 follows from it, so the blade keeps a smooth curve.

Forces

Grass blades standing straight up, tessellated with no forces applied
No forces
The same blades curving and drooping under gravity, held up by recovery
Gravity and recovery

Culling

The same compute pass decides which blades get drawn. The survivors are appended to an output buffer through an atomic counter, and the count feeds an indirect draw, so the CPU never needs to know how many are left.

Tessellation

The tessellation control shader sets each blade's level of detail from its distance to the camera along the ground, falling off exponentially from 10 subdivisions close up to 2 far away. The evaluation shader walks the curve by de Casteljau's algorithm and offsets each point sideways by the blade's width, tapering to the tip, and the fragment shader lights a dark-to-light green gradient with Lambert.

Measuring it

An ImGui panel tunes every force and culling parameter live, sets the blade count on a power-of-two slider from 1 to 2²⁰, and shows the current, average and 1% low frame rates, with a frame-time graph. One button runs the benchmark: 8 blade counts × 5 culling setups, 40 configurations, each warmed up for 0.5 s and measured for 5, into a CSV named after the CPU and GPU it ran on.

BladesNo cullingOrientationFrustumDistanceAll three
8,192995.1903.21,002.31,442.41,452.5
16,384564.7566.5569.71,290.31,283.9
32,768288.2304.2291.7962.01,005.0
65,536144.4157.8148.1494.7512.2
131,07276.686.279.5266.1284.5
262,14441.144.441.3149.1160.1
524,28821.122.620.976.282.3
1,048,57610.711.610.642.746.2
Average FPS on an RTX 5080 at 1920×1080, from a fixed overhead camera. With all three, a million blades run 4.31× faster.

Distance culling does nearly all the work. From a fixed overhead camera few blades are edge-on or off-screen, so orientation and frustum culling cost about what they save; orientation culling even makes the smallest field 9% slower. Below about 32K blades the frame is bound by the CPU and the driver, and above about 262K, by compute.

GitHub

[email protected] · LinkedIn · GitHub · Resume