Hyper-realistic sand with WebGL2

408 points77 commentsa day ago
evnp

Super loud sound warning, us parents and folks wearing headphones would really appreciate default sound off. Or at least a some indication to turn volume down before tapping "pour"

show comments
rybosome

I notice that different types of sand sound different - the timbre of the sand falling onto the table and shuffling around is noticeably different between the various types. I was curious if the differences in the sand were being physically modeled to synthesize sound.

It’s a physics-based generation but the simulation model is somewhat limited; essentially a few parameters that vary between the sand types, some randomization, and responsiveness to flow rate. Still, it’s highly effective; something like the fine, silty desert sand is noticeably brighter and sounds more like a hiss as it pours and flows than the rocky volcanic sand.

Very cool effect, this is joyful to play with.

smusamashah

Found source repo here https://github.com/av/safe-sand

show comments
alex_duf

On a mobile phone it makes a lot more sense. Try shaking it!

show comments
Faint

Smooth on OnePlus 13. Some flickering on the side the sand falls hard to. Still very nice.

nkmnz

Something seems wrong with the stones. They seem to move way to fast. They need more friction.

asaddhamani

I just spent 15 mins playing with this on my phone, it was a lot of fun!

smusamashah

oh wow, the stones even have some water around them. This looks and feels real.

And if you manage to collect a lot in one place, the sand from the pile does fall like real sand. This is amazing.

The sound is not good though.

show comments
bahmboo

Love it. Want it on my actual pixel home screen

momojo

This brings me a lot of joy. I love little toys that exist for no other reason than "I really want this to be a thing"

weitzj

Does it make Patterns if you put a sine wave on your phone's speaker? What are they called? Moirée patterns?

bob1029

I like how when my phone's forward vector is aligned with world up all the sand falls out.

techpression

I wouldn’t call it realistic, sand gets stuck in the air, stones don’t rotate, and there’s quite an uncanny valley effect based on angles. Still a cool demo of what is possible, even though I get 10fps or something on a iPhone 15 Pro

show comments
lavendermon

Tried this on desktop and mobile, totally different experiences. I love the residue effect on the screen after I tilt the sand around on mobile. Next step: hourglass or maybe a snow globe?

mashally

It was a lot of fun. I wrote I love you phrase to my gf and she liked it.

kccqzy

It didn’t look realistic to me until I added `?sand=beach` to the URL. Maybe I only associate sand from the beach as sand. Others I call silt perhaps incorrectly.

matt3210

Finally, the kind of sandbox we deserve

andai

Probably a bug, but the audio was just distorted noise without end.

hamidmohaqeq

This is really cool and give a realistic sense

patrick_rtk

very nice !

yipinwong

I felt like a kid playing with real sand in decades playing with this.

hirako2000

Handles double simultaneous taps n drags. Nice touch!

tgtweak

This one does much better at retaining volume than the smudge demo last week :)

cat-whisperer

a full circle moment

itomato

You can play a nice little round of Bocce with the stones

amunozo

I am feeling the sand physically at watching at this, good job!

cheapcheerful

Wow man, very cool.

Teladin

Seeing all the Macbook Pro PROLED XDR Touch Screen geeks finding a use for their new device :D

arm32

This is very fun to play with.

turadg

anyone who likes that should touch grass

https://grass.turadg.com/

customguy

Zooming on the desktop makes it more dense looking, which is probably not intended but can look very cool IMO.

show comments
wigster

i feel like i'm watching a stop-motion movie as it moves. very nice

show comments
monster_truck

This does not seem very realistic at all. Cool slop I guess,

You are managing to use my GPU so inefficiently that the transient spikes are bumping my speakers out of standby

iberator

10 fps on merely 3 years old Android phone.

show comments
int32max

woah this is really well done

hvvivek

this is super fun! well done

samiv

Cue the whines about not using WebGPU.

emilfihlman

I think it's lacking momentum, the sand stops way too abruptly, and the audio also has too harsh cutoff. It also falls too fast.

Otherwise really amazing!

christkv
nout

This is annoying to clean up exactly like real sand.

show comments
lloydatkinson

Runs like crap on iPhone 14. I know it’s not the current generation of phone but is there really that meaningful of a difference between that and a current one?

show comments
Razengan

Naturally the first instinct of man is to draw a penis.

show comments