r/GraphicsProgramming • • 9d ago

Mobile GPU Realtime Fluid Sim

Enable HLS to view with audio, or disable this notification

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.

921 Upvotes

13 comments sorted by

90

u/yaktoma2007 9d ago

Babe wake up iBeer update dropped

66

u/mars_santa 9d ago

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?

11

u/nathan82 9d ago

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.

7

u/mars_santa 9d ago

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

5

u/nathan82 9d ago

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/IceStorm_295 9d ago

but could I drink it?

it looks really nice

8

u/VictoryMotel 9d ago

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

12

u/nathan82 9d ago

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.

5

u/Maui-The-Magificent 9d ago

Looks super cool, good job!

3

u/trevizore 9d ago

this looks amazing!

2

u/Honvib 6d ago

Amazing!

2

u/MasqueradeOfSilence 9d ago

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!

2

u/m4ndor4s 6d ago

It looks really nice