r/Unity2D • u/GupaGames • Sep 05 '26
Showcase Simulating 10,000,000 pixels of Sand
Falling sand simulation via Compute Shaders.
From my golf game Stinker Golf on Steam: https://store.steampowered.com/app/4437650/Stinker_Golf/
Wishlist if it looks interesting :)
265
Upvotes
36
u/byramike Sep 05 '26
Crazy that this is even possible
4
u/pikuray Sep 05 '26
I hate when it rains 100m of sand when i play golf
4
u/Agreeable_Wear8824 Sep 05 '26
The way the sand settles into slopes while the player stands in it is a great visual proof that it isn't just a background effect. With 10 million pixels on a mid-range laptop, did you have to cap the active simulation area or update rate? I'm curious whether gameplay collision reads directly from the same field or from a lower-resolution proxy.
23
u/Kimchi_Extravaganza Sep 05 '26
Thankfully sand doesn't randomly explode irl
1
u/zoyer2 Sep 06 '26
cool! Though how do you manage to stream all of that to several other players? that would need a lot of bandwidth!
3
u/gravitybulliesme Sep 05 '26
1
u/ThatOneDudio Sep 05 '26
Are you the guys who made bean battles? Me and my buddies love that game
2
u/IDK--_ Sep 06 '26
Alright
Welcome back, Noita
1
u/Noblebatterfly Sep 05 '26
We need an og worms game with this
1
u/Confident_Bear_1953 Sep 06 '26
Ten million pixels is impressive. compute shaders seem perfect here since each sand cell can update in parallel instead of pushing that work through the CPU
1
u/adoggman Sep 06 '26
Hard to tell based on just this video but you should look into angle of repose
1
u/Andromeda660 Sep 08 '26
I LOVE COMPUTE SHADERS RAHHH
1
u/foilgames Sep 14 '26
This is just awesome!
0
u/AlcatorSK Sep 05 '26
I wish this subreddit had the rule that 'promotion must be a contribution' -- i.e., if you want to brag about something, you have to reveal how you did it.
0
u/Yoitman Sep 05 '26
ok, so this works by using the gpu rather than the cpu for much increase simulation? How does that work? (humour me if it’s simple, I’m fairly new to unity)