This is a small WebGPU cloud playground built with Three.js WebGPU. React. and Vite.
The short idea is simple. We are not drawing flat cloud sprites. We build 3D cloud data on the GPU. march rays through that data every frame. then composite the result over the sky.
That is what volumetric means here. the cloud has thickness. light can travel through it. and the final image depends on scattering and transmittance instead of just alpha.
A normal fake cloud is often just a textured shape.
This project does something more physical.
- A compute pass generates 3D noise.
- A compute pass generates a 3D signed distance field for the big cloud bodies.
- Another compute pass ray marches the cloud volume every frame.
- A fullscreen pass composites clouds over the sky.
That gives us a much better base for learning real time volumetric rendering.
bun install
bun run devOpen http://localhost:5173.
For checks.
bun run test
bun tsc
bun lintUse bun run test. not bun test. The project uses Vitest through the script.
If you want the volumetric path only. start here.
src/clouds/renderer.tssrc/clouds/compute/noise-generator.tssrc/clouds/compute/sdf-generator.tssrc/clouds/compute/cloud-march.tssrc/clouds/composite.ts
If you want a short file map with a bit more guidance. read volumetric-clouds-reference.md.
If you want the bigger architecture explanation. read webgpu-architecture.md.