wgpu/examples/src/conservative_raster
2024-10-23 15:29:42 -04:00
..
mod.rs Avoid breaking change: set_bind_group now takes Into<Option<...>> rather than Option<...> (#6452) 2024-10-23 15:29:42 -04:00
README.md Update examples readme files (#4774) 2023-11-25 22:59:40 +00:00
screenshot.png Move to A Single Example Executable (#4756) 2023-11-23 05:26:42 -05:00
triangle_and_lines.wgsl Move to A Single Example Executable (#4756) 2023-11-23 05:26:42 -05:00
upscale.wgsl Move to A Single Example Executable (#4756) 2023-11-23 05:26:42 -05:00

conservative_raster

This example shows how to render with conservative rasterization (native extension with limited support).

When enabled, any pixel touched by a triangle primitive is rasterized. This is useful for various advanced techniques, most prominently for implementing realtime voxelization.

The demonstration here is implemented by rendering a triangle to a low-resolution target and then upscaling it with nearest-neighbor filtering. The outlines of the triangle are then rendered in the original solution, using the same vertex shader as the triangle. Pixels only drawn with conservative rasterization enabled are depicted red.

To Run

cargo run --bin wgpu-examples conservative_raster

Screenshots

Conservative-raster window