Skip to main content

Module depth

Module depth 

Source
Expand description

Generation of hierarchical Z buffers for occlusion culling.

Currently, this module only supports generation of hierarchical Z buffers for occlusion culling.

Structs§

DepthPyramidDummyTexture
Stores a placeholder texture that can be bound to a depth pyramid binding if no depth pyramid is needed.
DownsampleDepthPipeline
A single depth downsample pipeline.
DownsampleDepthPipelineKey
Uniquely identifies a configuration of the downsample depth shader.
DownsampleDepthPipelines
Stores all depth buffer downsampling pipelines.
ViewDepthPyramid
Stores a hierarchical Z-buffer for a view, which is a series of mipmaps useful for efficient occlusion culling.
ViewDownsampleDepthBindGroup
The bind group that we use to attach the depth buffer and depth pyramid for a view to the downsample_depth.wgsl shader.

Constants§

DEPTH_PYRAMID_MIP_COUNT
The maximum number of mip levels that we can produce.

Functions§

create_depth_pyramid_dummy_texture
Creates a placeholder texture that can be bound to a depth pyramid binding if no depth pyramid is needed.
create_downsample_depth_pipelines
Creates the DownsampleDepthPipelines if downsampling is supported on the current platform.
early_downsample_depth
Produces a hierarchical Z-buffer (depth pyramid) for occlusion culling.
init_depth_pyramid_dummy_texture
late_downsample_depth
Produces a hierarchical Z-buffer (depth pyramid) for occlusion culling.
prepare_downsample_depth_view_bind_groups
Creates the ViewDownsampleDepthBindGroups for all views with occlusion culling enabled.
prepare_view_depth_pyramids
Creates depth pyramids for views that have occlusion culling enabled.