Skip to main content

Module effects

Module effects 

Source
Expand description

Pixel post-processing pipelines

There is a notable difference between voxel and pixel post-processing: instead of producing a fully-populated RGBA image to be drawn to the screen, we produce two images: one containing RawDistancePixel values, and one containing RGBA values (as 4-byte words).

This is because – when the final shader draws to the screen – we can improve visual fidelity by interpolating between distance values (typically by the texture unit). If we baked the final RGBA image, then drawing it at a different scale (e.g. the user has zoomed and we’re waiting for the next image to be completed) would simply be blurry; with distance interpolation, it remains sharper (though not pixel-perfect).

Output is stored in the MergeWorkspace object, and may be accessed with output_distance and output_color. Note that if color has not been computed, output_color will return None.

Re-exports§

pub use crate::voxel::effects::ColorError;

Structs§

ColorSettings
Settings for per-pixel color evaluation
Context
WGPU context for applying various effects
ImageSizeMismatch
Type indicating an image size mismatch
MergeWorkspace
Handle to a set of buffers used when merging images
PixelColorBufferTag
Buffer tag for on-GPU color images
PixelDistanceBufferTag
Buffer tag for on-GPU distance images

Enums§

MergeError
Error returned when submitting a merge operation

Type Aliases§

ColorWorkspace
Workspace for evaluating color expressions