Adaptive raster culling #41

Merged
embeddedt merged 9 commits from adaptive-raster-culling into stonecutter 2026-09-17 10:10:54 -04:00
Owner

Currently, rasterized occlusion culling costs the same amount of CPU time regardless of how much geometry it manages to remove. This algorithm attempts to make its cost proportional to the benefit, so raster culling can default to on.

RasterBudget sets a distance limit each frame. Sections inside it use rasterized occlusion culling. Sections beyond it are simply treated as visible by the raster system. After each frame, the limit doubles if raster culled enough sections and halves if not enough did. Otherwise, it stays the same. If it reaches the render distance, the search is exactly the same as the old full pass.

Numbers (search time per frame, rd 32, synthetic worlds):

Scene No raster Old raster Adaptive Old raster culls
Open plains 0.31 ms 0.62 ms 0.37 ms 0%
Hills, no caves 0.31 ms 0.65 ms 0.41 ms 3%
Forest over caves 0.46 ms 0.74 ms 0.74 ms 27%
Cave 0.09 ms 0.06 ms 0.06 ms 99%

In general, where rasterization helps, adaptive matches the old always-on approach in both culling and cost. Where it doesn't, adaptive pays roughly a fifth of the old overhead.

This technique is due to Claude Fable 5.1.

Currently, rasterized occlusion culling costs the same amount of CPU time regardless of how much geometry it manages to remove. This algorithm attempts to make its cost proportional to the benefit, so raster culling can default to on. RasterBudget sets a distance limit each frame. Sections inside it use rasterized occlusion culling. Sections beyond it are simply treated as visible by the raster system. After each frame, the limit doubles if raster culled enough sections and halves if not enough did. Otherwise, it stays the same. If it reaches the render distance, the search is exactly the same as the old full pass. Numbers (search time per frame, rd 32, synthetic worlds): | Scene | No raster | Old raster | Adaptive | Old raster culls | | ----------------- | --------- | ---------- | -------- | ---------------- | | Open plains | 0.31 ms | 0.62 ms | 0.37 ms | 0% | | Hills, no caves | 0.31 ms | 0.65 ms | 0.41 ms | 3% | | Forest over caves | 0.46 ms | 0.74 ms | 0.74 ms | 27% | | Cave | 0.09 ms | 0.06 ms | 0.06 ms | 99% | In general, where rasterization helps, adaptive matches the old always-on approach in both culling and cost. Where it doesn't, adaptive pays roughly a fifth of the old overhead. This technique is due to Claude Fable 5.1.
embeddedt added 8 commits 2026-09-16 13:57:55 -04:00
The raster was all-or-nothing: on open terrain it doubled the search
time and hid nothing. RasterBudget now limits how far from the camera
sections are tested and drawn, and grows or shrinks that limit each
frame from the fraction of tests that culled. Where the raster earns
its keep the search is identical to before; where it doesn't, the cost
drops to a small standing probe.

The coverage buffer is sized to the tested distance rather than the
render distance, so the probe draws into a much smaller buffer.

The option now defaults to on. Bench gains PLAINS/HILLS worlds where
the raster culls nothing, a budgeted column with timings, and a
transition trace between worlds. The report tasks read -Dreport.*
through a tracked provider so they work with the configuration cache.
The raster budget's probes alternate between a small buffer and a large one, which reallocated both every time.
A cull also hides the search behind it, so yield cannot tell gentle hills, where a full pass barely pays for its tests, from terrain where it removes far more.
embeddedt force-pushed adaptive-raster-culling from c1cc6cf284 to 441443e310 2026-09-16 13:57:55 -04:00 Compare
embeddedt added 1 commit 2026-09-17 10:08:36 -04:00
Keep raster disabled by default
ci / build (push) Successful in 6m15s
d9bbfd5f57
embeddedt merged commit 727b464d07 into stonecutter 2026-09-17 10:10:54 -04:00
embeddedt deleted branch adaptive-raster-culling 2026-09-17 10:10:54 -04:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: embeddedt/celeritas#41