I made a fluid simulator which runs in the browser with WebGPU

So I played DnD and wanted to make more realistic maps - got into hydraulic erosion. One thing led to another, and 50 youtube tutorials later I’m neck deep in fluid simulation.

This is the result.

6 Likes

Cool little demo. Glad to see people using WebGL. A really good WebGL Framework I would recommend for future projects like this: Introduction - React Three Fiber

1 Like

This isn’t made with WebGL. It’s made with WebGPU, which supports compute shaders.

I’m actually terrible at graphics, so something like Three.js really does help with abstracting away the complexities involved in rendering. In fact, in a different project, I did the computation with WebGPU and the rendering with Three.js. Worked out pretty good - although you pay a price for the context switching and transferring data from the CPU to the GPU and back again.

You can play with it here here.