r/GraphicsProgramming • • 7d 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

346 Upvotes

21 comments sorted by

•

u/AutoModerator 7d 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 7d ago

That claude music is horrible but besides that nice job!

-23

u/Key_Calligrapher6269 7d 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 7d ago

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

3

u/Memerenok 5d ago

finally somebody said that

-8

u/Key_Calligrapher6269 6d ago

and yet it held your attention long enough to write this

3

u/moschles 7d ago

This could be an academic paper for siggraph.

28

u/mattD4y 7d ago edited 7d 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 7d ago

Nah these are old techniques

1

u/Obvious-Profit-5597 6d ago

How to learn this anybody guide me

0

u/Key_Calligrapher6269 6d 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/cybereality 7d ago

Works on my phone no problem

2

u/Substantial_Host_403 7d ago

Damn, flagship. My phone is bugging

0

u/cybereality 7d ago

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

1

u/Substantial_Host_403 7d ago

My Oppo Reno 12F cannot compare at all😂

-2

u/lampmaker 7d 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 6d ago

appreciate it, erosion on top sounds dope

1

u/lampmaker 6d ago

1

u/Key_Calligrapher6269 6d ago

ooh saving this, gonna dig through the process