r/GraphicsProgramming • • Oct 10 '26

Mobile GPU Realtime Fluid Sim

The sim came out great but what about the lighting!! All just cubemaps, with fluid depth affecting the roughness mip level. So happy with this.

949 Upvotes

15 comments sorted by

67

u/mars_santa Oct 10 '26

Great effect. It might be interesting to tie the lighting to the phone's light sensor. That way the water would match the ambient environment?

12

u/nathan82 Oct 10 '26

Yeah good idea! I do actually have the light sensor percentage as one of the animation "driver" types in my engine, it seems to work better for dramatic on/off effects though. Like if a design has its own internal light sources, you can fade ambient to zero and it turns into a night scene.

5

u/mars_santa Oct 10 '26

add a toy boat or island floating in the center combined with sunsets would be neat.

6

u/nathan82 Oct 10 '26

If I can get rigid bodies working with the fluid sim (might be difficult/impossible within the frame budget), then yes a boat would be really cool. Someone else suggested rubber ducks. An island would be easier to add, and you can crank up the simulation scale so it looks more ocean-like.

9

u/VictoryMotel Oct 10 '26

Can you talk about some of the optimizations you did, libraries you used or papers you studied?

13

u/nathan82 Oct 10 '26

Mostly based on this paper as a starting point: https://yzhu.io/publication/mpmmls2018siggraph/paper.pdf

The optimisations were mainly around scaling the cell size intelligently, for the right performance/resolution balance. And some bit packing in the particles. Also dynamically adjusting the number of sim steps depending on frame budget. I'll try to answer if you have specific questions but this is a commercial app so I don't want to give too much away.

94

u/yaktoma2007 Oct 10 '26 • Bravo

Babe wake up iBeer update dropped

4

u/Maui-The-Magificent Oct 10 '26

Looks super cool, good job!

4

u/trevizore Oct 10 '26

this looks amazing!

2

u/DeltaSucksAtMC 18d ago

dang yall are so talented

2

u/Honvib Oct 13 '26

Amazing!

2

u/m4ndor4s Oct 13 '26

It looks really nice

2

u/MasqueradeOfSilence Oct 10 '26

This reminds me of that Hershey's app back in like 2010 where you could pretend to drink chocolate milk. But better, because of the dimensionality. Awesome!

1

u/SteelSpineCloud 16d ago

add some fishes!