Design decisions
- Screen-space error LOD selection. Refine where a voxel covers more than
maxPixelErrorpixels (default 8). One threshold adapts to resolution, field of view and distance. - LRU eviction. Bricks are touched every frame they are desired; the least recently used one is evicted when the atlas is full, which keeps the current working set.
- Differential updates. Only missing bricks are loaded, so small camera moves cost few requests and uploads.
- Empty-brick skipping. The sharded index's statistics skip empty bricks before any request; OME-Zarr bricks found empty are never requested again. This pays off for CT with air around the object and microscopy with dark background.
- Coarse bricks fill many cells. A coarse brick writes its slot into every indirection cell it covers, and finer bricks overwrite theirs, so the shader always reads the finest loaded data without choosing a LOD itself.
- 255 = empty. An explicit empty marker stops coarse data from showing through regions known to be empty at a finer level.
- 66³ physical bricks. The one-voxel border lets hardware trilinear filtering work across brick edges with no special cases in the shader.
- Pinned base level. The coarsest level is loaded first and never evicted, so the whole volume is always visible at some resolution.
- Compute shader raymarching. The ray loop is one thread per pixel, equivalent to a fullscreen fragment shader, and uses no compute-only features yet. Compute makes the pipeline simpler: accumulation chains compute to compute, results go out with
textureStore, and resolution scaling is a smaller dispatch instead of an intermediate framebuffer. It also leaves room for shared memory, subgroups and indirect dispatch. See WebGPU notes.