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§
- Color
Settings - Settings for per-pixel color evaluation
- Context
- WGPU context for applying various effects
- Image
Size Mismatch - Type indicating an image size mismatch
- Merge
Workspace - Handle to a set of buffers used when merging images
- Pixel
Color Buffer Tag - Buffer tag for on-GPU color images
- Pixel
Distance Buffer Tag - Buffer tag for on-GPU distance images
Enums§
- Merge
Error - Error returned when submitting a merge operation
Type Aliases§
- Color
Workspace - Workspace for evaluating color expressions