Files
wgpu/examples/src/stencil_triangles
Gerard Fabregó 12ee31d6f9 Update examples readme files (#4774)
* Fix indentation in main examples readme file

* Update examples readme files

* Update hello_compute example readme and fix example not running with new command

* Fix srgb_blend example not working correctly and set readme accordingly
2023-11-25 22:59:40 +00:00
..
2023-11-25 22:59:40 +00:00

stencil_triangles

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 wgpu-examples stencil_triangles

Screenshots

Stencil Triangles window