wgpu/examples/stencil-triangles
Christopher Fleetwood 3305e88d63
feature: Timestamp queries (#3636)
Co-authored-by: Andreas Reich <r_andreas2@web.de>
Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>
Co-authored-by: Connor Fitzgerald <connor@modyfi.io>
2023-08-02 18:04:24 -04:00
..
src feature: Timestamp queries (#3636) 2023-08-02 18:04:24 -04:00
Cargo.toml Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00
README.md Formatting and example command fixes (#3872) 2023-06-15 20:05:26 +00:00
screenshot.png Move Examples and Tests to Their Own Crates (#3841) 2023-06-10 18:35:46 +00:00

hello-triangle

This example renders two different sized triangles to display three same sized triangles, by demonstrating the use of stencil buffers.

First it draws a small "mask" triangle, which sets the stencil buffer at every pixel to 1.

Then, it draws a larger "outer" triangle which only touches pixels where the stencil buffer is less than 1.

To Run

cargo run --bin stencil-triangles

Screenshots

Stencil Triangles window