Real-time water wave simulation using WebGPU compute shaders.
This is a learning project to learn how water based simulation/rendering works using WebGPU. I am relying on three.js only to load the cubemap.
- Modern browser with WebGPU
npm install
npm run devOpen http://localhost:5173
npm run build
npm run previewsrc/water/- Water simulation (compute + render)src/scene/- 3D scene components (skybox, bathtub, floor)src/camera/- Orbit camera controlssrc/wgpu/- WebGPU context managementsrc/shaders/- WGSL shader code
The skymap was taken from polyhaven
- Dispersion - Frequency-dependent wave speed for more realistic propagation
- Refraction - Scene distortion through water surface
- Caustics - Light patterns on bathtub floor
- Foam/spray - Particle effects at wave peaks
MIT