r/GraphicsProgramming • • 11d ago

breakdown of a real-time stream, shallow water equations on the GPU, advected ripples and caustics from the flow

my own project, one 512 x 512 shallow water grid runs in compute shaders with 8 substeps per frame, and every layer in the video is read from it, depth, velocity, foam where the flow converges, ripple coordinates advected by the velocity and a caustics pass projected on the bed

solver is Chentanez and Müller 2010 on a staggered grid, three.js WebGPU with TSL

live (WebGPU) : https://stream.mulualem.com

ai disclosure : I built this with claude code, it wrote most of the code under my direction and helped draft this post too

347 Upvotes

24 comments sorted by

•

u/AutoModerator 11d ago

Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:

  • No showcases.
  • Disclose AI usage in post or project.
  • Present a topic to talk about, e.g. how something works.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

→ More replies (1)

20

u/StrontLulAapMongool 11d ago

That claude music is horrible but besides that nice job!

-23

u/Key_Calligrapher6269 11d ago

yupe, agree 100%, need to work more on the music generation skill I've hacked together, it uses too much whoosh sounds for some reason

8

u/AnSkinStealer 11d ago

ai is fine for coding, not for art and it will always unevitably sound like shit

3

u/Memerenok 9d ago

finally somebody said that

-8

u/Key_Calligrapher6269 10d ago

and yet it held your attention long enough to write this

3

u/moschles 11d ago

This could be an academic paper for siggraph.

28

u/mattD4y 11d ago edited 11d ago

It literally already was…in 2011.

https://developer.nvidia.com/siggraph-2011

https://youtu.be/Jl54WZtm0QE?is=8QOjzfGgtP2Q_Lcw

Chentanez and Müller are both amazing researchers who have actually contributed a lot to the field.

https://matthias-research.github.io/pages/publications/publications.html

10

u/blackrack 11d ago

Nah these are old techniques

1

u/Obvious-Profit-5597 9d ago

How to learn this anybody guide me

0

u/Key_Calligrapher6269 9d ago

start with a simple heightfield wave sim so the idea clicks, Matthias Müller's Ten Minute Physics videos are great for that, the shallow water part here is Chentanez and Müller 2010 on a staggered grid, get it working on the CPU first then move it into compute shaders, foam and caustics come last since they just read from the sim

1

u/BoiraGames 2d ago

It has a very good looking feeling to it, nice job.

1

u/Key_Calligrapher6269 2d ago

appreciate it man, glad the look lands 🙂

1

u/cybereality 11d ago

Works on my phone no problem

2

u/Substantial_Host_403 11d ago

Damn, flagship. My phone is bugging

0

u/cybereality 11d ago

I have a Pixel 8 a bit old at this point but was good at the time

1

u/Substantial_Host_403 11d ago

My Oppo Reno 12F cannot compare at all😂

-2

u/lampmaker 11d ago

Very Nice!

Few years back I made landscapes with a fluid sim, added some erosion to it. But the flow itself didnt look as nice as this one.

0

u/Key_Calligrapher6269 10d ago

appreciate it, erosion on top sounds dope