Procedural-generation feature flags packed into the page-gen uniform.
Bit 0 = erosion, bit 1 = plateaus/dunes. Toggle via setFeatureFlags.
World-generation seed (u32). Folded into the page-gen hash so each value
yields a completely different terrain pattern. Toggle via setSeed.
ReadonlygeomReadonlyshadowActive quality preset, as passed to create().
Vertices per patch side (33 = Medium default).
Indices per patch triangle list — for callers building bind groups or draw calls without going through the indirect path.
Texels per VT page side (256 = Medium default).
StaticcreateForce the VT residency to evict; next update() rebakes around the camera.
Per-frame uniform upload + page streaming. Also resets the indirect args (the LOD compute pass bumps instance_count from zero each frame).
OptionalheightScale: numberToggle erosion / plateau-dune features and trigger an immediate atlas rebake around the camera so the new formula is visible. No-op when both flags already match.
Swap to a different quality preset at runtime. Destroys and rebuilds the VT atlas, the page-gen / geom / shadow-geom bind groups, and the patch index buffers; resets page residency so the new atlas refills on the next frame. No-op when the requested quality already matches.
Pipelines and bind-group layouts are untouched — they describe binding shapes, not sizes, so they remain valid across the swap.
Safe to call between frames (e.g. from a UI handler). The first frame after the call shows the old atlas's last residency invalidated and the new atlas progressively baking around the camera, same as the initial startup pass.
Set the world-generation seed and rebake all resident pages. No-op when the seed already matches.
Switch the page-gen height source to a heightmap texture and rebake all
resident pages. The texture's R channel is read as normalized height in
[0, 1] and scaled by opts.heightScale (defaults to the current
heightScale); the page-gen normals are still derived from finite
differences of the sampled field, so they stay correct at page seams.
The texture must be sampleable as texture_2d<f32> with a filtering
sampler — r16float / rgba16float / rgba8unorm all work. The caller
keeps ownership; it is bound, not copied. Pair this with a small
worldExtent + bounded: true at create() for a self-contained island.
Switch back to procedural noise generation and rebake.
When true, terrain G-buffer renders as line-list using
lineIndexBufferinstead of triangle-list. Affects indirect-argsindexCountwritten byupdate(). Shadow casters keep using triangles.