Files
wgpu/examples/features/src/water
renovate[bot]andErich Gubler a200e41f6c Update Rust to 1.96.1 (#10526)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
2026-10-05 13:31:38 +00:00
..
2026-09-14 21:10:55 +00:00
2026-10-05 13:31:38 +00:00
2025-01-20 18:07:22 -05:00
2025-01-20 18:07:22 -05:00
2025-01-20 18:07:22 -05:00
2025-01-20 18:07:22 -05:00

Water example

This example renders animated water.

It demonstrates Read only Depth/Stencil (abbreviated RODS), where a depth/stencil buffer is used as an attachment which is read-only. In this case it's used in the shaders to calculate reflections and depth.

Files:

water
├── main.rs ------------------ Main program
├── point_gen.rs ------------- Hexagon point generation
├── README.md ---------------- This readme
├── screenshot.png ----------- Screenshot
├── terrain.wgsl ------------- WGSL Shader for terrain
└── water.wgsl --------------- WGSL Shader for water

To run

cargo run --bin wgpu-examples water

Screenshot

Water example