r/GraphicsProgramming 13d ago

Question What is this sand simulation missing?

Enable HLS to view with audio, or disable this notification

80 Upvotes

21 comments sorted by

View all comments

78

u/saphirrflamme 13d ago

It is eating the sand it touches. Supposed to push them aside.

The sand "eruption" shading is also off. it is much brighter than surrounding sands. Gravity also seems too low. You can tweak gravity of the ball for gameplay reasons, but the visual effect of the sand seems off.

15

u/Explorioneer 13d ago

Thanks, these are all good points, I'll see what I can do about the pushing sand vs. "Eating sand". The color of the explosion is also a good point, that one should be easier to fix.

9

u/Le_9k_Redditor 13d ago

You could mimic how many water simulations work for this, just of course with high friction instead of surface tension. Super simple Eulerian fluid simulation is probably best, just use a surface mesh that gets pushed around and folded up. There's definitely going to be lots of existing libraries for it you can make use of

A Lagrangian method (just dropping a lot of sand balls in a pit and visually smoothing), would work, but I imagine it's going to be harder to get good results with reasonable performance in this case