Module mip_generation

Source
Expand description

Downsampling of textures to produce mipmap levels.

Currently, this module only supports generation of hierarchical Z buffers for occlusion culling. It’s marked experimental because the shader is designed only for power-of-two texture sizes and is slightly incorrect for non-power-of-two depth buffer sizes.

Structs§

DepthPyramidDummyTexture
Stores a placeholder texture that can be bound to a depth pyramid binding if no depth pyramid is needed.
DownsampleDepthNode
The nodes that produce a hierarchical Z-buffer, also known as a depth pyramid.
DownsampleDepthPipeline
A single depth downsample pipeline.
DownsampleDepthPipelineKey
Uniquely identifies a configuration of the downsample depth shader.
DownsampleDepthPipelines
Stores all depth buffer downsampling pipelines.
MipGenerationPlugin
A plugin that allows Bevy to repeatedly downsample textures to create mipmaps.
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.
DOWNSAMPLE_DEPTH_SHADER_HANDLE
Identifies the downsample_depth.wgsl shader.

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.
prepare_view_depth_pyramids
Creates depth pyramids for views that have occlusion culling enabled.