Optional ReadonlybuffersOne texture per stored mip. WebGL keeps the finest levels outside a single mip chain. WebGPU stores every level on texture and leaves this unset.
When false, update and updateSceneDepth do nothing and testers skip the pyramid.
ReadonlyheightHeight of the first stored mip.
ReadonlymipNumber of stored mips, including the first.
ReadonlyscreenHeight of the depth source the pyramid was built from.
ReadonlyscreenWidth of the depth source the pyramid was built from.
ReadonlytexturePyramid texture: WebGL's first ping-pong target, or the WebGPU mip chain. Null before the first resize.
Scale from screen UV to the first stored mip. Testers multiply the screen rectangle by this before sampling.
ReadonlywidthWidth of the first stored mip.
Pyramid is a color texture.
The packed RGBA8 path stores device Z and is decoded with uint2float.
A depth attachment would return false.
Pyramid texels are R16F. Sampling reads .r.
Pyramid texels are R32F. Sampling reads .r.
Max-downsample the hardware depth grab (requestSceneDepthMap / renderPassDepthGrab)
into the pyramid. Device Z is stored as-is. No-op without a grab texture, or when disabled.
Call after opaque depth.
Same pyramid as update, from camera.sceneDepthMap.
The encoding comes from camera.shaderParams (sceneDepthMapLinear,
sceneDepthMapPacked, sceneDepthMapReciprocal): view-space metres, packed RGBA8,
or 1 / viewZ. The first pass point-samples that texture and stores device Z.
Later mips and the occlusion test stay in device Z.
No-op until the map is published, or when disabled.
Call from postrender or frameend.
Device-Z pyramid built from the camera depth. Testers compare an AABB's closest device Z with the mip that covers its screen rectangle.