The live demo starts when it’s in view.Shift-drag across the grass to trample and wear it · drag to orbit · try Loose stones and Contact shade
Hundreds of thousands of curved blades decided on the GPU every frame.
What it costs a frame
GPU
1.44 ms
CPU
0.28 ms
02468101216.7 ms
GPU
1.44 ms
CPU, median
0.28 ms
CPU, 95th pct
0.41 ms
Draw calls
4
Compute passes
4
Weight
Moderate
Measured 3 November 2026 on RTX 4060 Laptop, 13th Gen Intel(R) Core(TM) i9-13900H, Chrome 156, 1920×1080 at 1×. 600 frames × 3 rounds, median kept. What ran: Balanced density over an 80 m square round the focus (the game’s default), the ball rolling, wind 1: one placement compute pass and three indirect draws. Phones: tiers are being measured next.
apple · Apple A19 Proin a browser tab · 16 November 2026
3.35
0.10
0.18
Intel Arc 140V (Xe2-LPG) · Intel Core Ultra 7 258Vin a browser tab · 15 November 2026
20.8
0.90
1.78
Bars against one 16.7 ms frame. A browser-tab run is timed in a visible tab without the tool’s scripted input, so read it as close, not exact.
What it needs
Renders with
WebGPU or WebGLWebGPU where there is one, WebGL2 where there is not.
Your browser
Runs hereNo WebGPU needed
Depends on
three.js 0.187.0No other packages
What it’s for
Open-world fields and lawns
Paths that characters and vehicles leave
Wind you can see
Stylised or realistic landscapes
Hero shots of nature
Worn paths across a lawn or a field
No grass through crates, walls and posts
Pebbles and gravel on paths, tracks and yards
Grounding characters and props without a shadow map
Pitfalls, in brief
Work a blade out once in compute (placement, culling, LOD list), not per vertex: the vertex shader only rebuilds the blade from its spot by hashing.
Blades under a pixel wide cost far more to draw than wider ones and flicker as single bright pixels: widen them to a minimum on screen (setPixelsPerMetre) and fade short ones.
Light blades by hand (sun + sky, a little light through the tips) instead of a PBR light loop: hundreds of thousands of fragments.
The gusts’ pattern must travel by the wind summed frame by frame, not wind × clock: a change of wind would jump the whole pattern.
Soft edges need the canvas’s MSAA (antialias: true) for alpha to coverage.
11 more in brief
The density field is 192 cells a side (96 m at 0.5 m): the ground-under-grass texture is shared at that size, and the meadow checks it.
Measure uncapped: at a frame cap the GPU drops its clocks and the timer swings by ±2 ms.
Keep grass off fixed things by rasterising their footprints into the field, not by casting a ray down every cell: HaTac_FP’s ray bake was a 90 ms hitch while driving and up to 33 ms a mask; the footprints from above (a box’s eight corners as a hull, a round thing a circle) filled a span a row are about four times faster and give the same cells.
Wear and trampling are different clocks: trampling bends grass for seconds (the layer’s recovery), wear thins it to earth over many passes and grows back over minutes.
A new density is a 147 KB upload: make it a few times a second at most (WearField does, every 0.2 s), never every frame, and only while something changed.
Draw every kind of loose stone in one indirect draw: put all pieces’ triangles in one storage pool padded to the longest (a padded triangle is three points at the origin and draws nothing), and let each row carry its piece above its turn (turn + piece × 8).
Store nothing per stone: hash a spot’s cell for its jitter, piece, size, turn, tilt and tint, so a stone is where it was when the camera comes back.
Draw loose stones larger than real (1.6–2.4 ×): at a game camera a 3 cm pebble is a pixel, and a shimmer of pixels reads as noise, not gravel.
On an integrated GPU (an Intel Arc 140V draws the Balanced bench in about 21 ms, 14× the reference laptop) cut blades, not effects: the cost goes with (area ÷ spacing)², most of it the far ring of one-segment blades, so the game’s Mobile spacing and a shorter reach (MEADOW_TIERS.low: 0.12 m over 64 m) do more than anything else; then drop alpha to coverage and end the curved blades nearer (tier).
A contact shade is see-through, writes no depth and is pulled toward the camera (polygon offset): set into the ground it fights it, and drawn with depth it hides what stands on it.
Without WebGPU, set webgl: !meadowOnGpu(renderer) (and check meadowRunsOnWebGL: it needs float colour targets).
16 pitfalls in full, the hook-up guide, the module source and its tests come with the part.
Where it comes from
From HaTac, and in the garden walk showcase. Fully custom code.
False Earth, “How we made the grass” (Codrops, 2026): The roadmap the meadow follows: blade shading, distance LOD, GPU placement and culling, curved blades. The write-up, not its code.
A. M. Andrew, “Another efficient algorithm for convex hulls in two dimensions” (1979): The monotone-chain hull a footprint’s outline is taken with (footprints.ts).
grasscomputeindirect drawlodwindtramplingalpha to coveragetslwearfootprintsbare groundloose stonesgravelscattercontact shadowblob shadowrender-target placementwebgl fallback