mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-11-22 06:44:14 +00:00
765c20235e
This change uses `include_wgsl!(…)` in usages where an `include_str!("….wgsl")` was used to construct a `ShaderModuleDescriptor`'s `source, but the `label` was set to `None`. This should (1) showcase a nice idiomatic convenience we offer in our examples better, (2) make code more concise, and (3) get some automatically generated labels in diagnostics where it seems it won't hurt. |
||
---|---|---|
.. | ||
mod.rs | ||
README.md | ||
screenshot.png | ||
shader.wgsl |
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