Skip to content

Virtual texturing ​

Only a small working set of bricks is visible at any moment, so a large volume can be mapped onto a fixed-size cache.

1. Bricks ​

Every dataset is addressed as a pyramid of bricks: 64³ voxels each, stored as 66³ with a one-voxel border. OME-Zarr brings its own levels, and workers cut each brick from the chunks it overlaps on demand. The sharded binary format is bricked ahead of time.

1024 × 512 × 1024 voxels, front view (x × y)LOD 01:116 × 8 × 16 = 2,048 bricksone brick covers 64³LOD 11:28 × 4 × 8 = 256 bricksone brick covers 128³LOD 21:44 × 2 × 4 = 32 bricksone brick covers 256³LOD 31:82 × 1 × 2 = 4 bricksone brick covers 512³

The diagram shows a uniform 2:1 pyramid. Native OME-Zarr pyramids can downsample each axis independently (XY only, for example), so a brick has 1 or 2 children per axis.

2. Indirection table ​

A 3D rgba8uint texture with one texel per LOD 0 brick:

ChannelContent
R, G, BAtlas slot x, y, z
ALOD + 1; 0 = not loaded, 255 = known empty

A coarse brick writes its slot into every cell it covers; in a 2:1 pyramid a LOD 2 brick fills 4×4×4 cells. A finer brick then overwrites just its own cells. The shader reads the cell at the sample position and gets the finest loaded data, with no LOD selection of its own.

Indirection tableone cell per LOD 0 brick (2D slice)Atlas texturez = 0 layer, 10 × 10 slots255empty255empty5,2,0LOD 25,2,0LOD 2255empty255empty5,2,0LOD 25,2,0LOD 23,0,0LOD 13,0,0LOD 15,2,0LOD 25,2,0LOD 23,0,0LOD 13,0,0LOD 15,2,0LOD 25,2,0LOD 20,1,0LOD 10,1,0LOD 16,2,0LOD 16,2,0LOD 10,1,0LOD 10,1,0LOD 16,2,0LOD 10,4,0LOD 0R, G, B = atlas slot · A = LOD + 1 (255 = empty)001122334455667788992 × 2 cells, one LOD 1 bricka finer brick overridesonly its own cell

3. Atlas ​

One 3D texture per channel, divided into 66³ slots: up to 660³ (10 × 10 × 10 slots), chosen at startup by computeAtlasGrid() so that channels × size³ × bytes per voxel fits the budget (atlasBudgetBytes, default ~1.3 GiB).

x: 10 slots × 66 = 660 voxelsy660z: 10 layersslot (3, 1, 0)starts at texel (198, 66, 0)texel origin = slot × 66One brick per slot:66³ voxels = 64³ + ghost border1,000 slots at full size; the gridshrinks to fit the VRAM budget

SourceFormatFull 660³ atlas
uint8r8unorm274 MiB
uint16r16unorm, bit-exact, where the device supports it; else r16float storing value − 2048, exact up to 4096548 MiB
int16, float32r16float, raw values, normalised by the data range in the shader548 MiB

Without r16float the atlas falls back to r8unorm, losing precision.

Multichannel atlas ​

Each channel has its own atlas; the indirection table is shared, so a brick uses the same slot in every channel. One or two 16-bit channels keep 660³; four get 528³ each (~1.1 GiB in total, instead of ~2.1 GiB at 660³).

4. Ghost border ​

The border duplicates the neighbouring bricks' edge voxels, so hardware trilinear filtering never reads across slots, even though neighbours sit anywhere in the atlas.

Brick Aslot (2, 0, 1)Brick Bslot (7, 5, 3)66 = 1 + 64 + 1 voxelsneighbours in the volume,far apart in the atlasA’s edge copied into B’s ghost voxelsB’s edge copied into A’s ghost voxelsA sample at A’s edge filters between A’s last voxel and its ghost copy of B: one slot, no seam.