Hyper-realistic sand with WebGL2 (av.github.io)

422 pointsby everliera day ago77 comments

evnp 19 hours ago

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"

codingjinxx 2 hours ago

ya i opened this in class and i forgot to mute

rybosome 16 hours ago

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 21 hours ago

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

hjun1052 4 hours ago

Wish it had a license. Would’ve loved to add some ants to this.

alex_duf a day ago

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

leobuskin a day ago

It doesn’t in my case, I see some weird animation, everything disappears, “pour” button again. Shaking or any other movement doesn’t help. Latest chrome on iOS

dylanowen a day ago

The sand is pouring onto the phone screen so if your phone is tilted or upside down it looks illogical

nomel 19 hours ago

Thank you! I was looking at it while lying sideways and thought it was completely broken. But, it's just hyper-realistic. ;)

AndrewSwift a day ago

Works for me in Safari — iPhone 17 Pro, all up to date

Angostura 2 hours ago

And on this iPhone 13 mini

ChrisMarshallNY a day ago

It helps, if you lock orientation on the phone.

Whenever the phone detects an orientation change, it resets the layout.

mywittyname 20 hours ago

Do you have shake as undo still enabled? It's one of the most annoying features in iOS.

intrasight 18 hours ago

Because if you turn it upside down, the sand pours out. Think of it as if you have sand in a rectangular tray with no lid.

It also responds to touch, which I didn't know until the third time I played with it.

winkelmann 17 hours ago

It took me a while to realize this isn't a falling sand (Powder Toy) type game. The phone has to lay flat, i.e. with the screen facing up.

alex_duf 5 hours ago

It can lay flat, but it's a lot more fun to tip it! the sand "falls" off the screen

theowaway213456 a day ago

I think it responds to tilting, not shaking?

alex_duf 5 hours ago

on my it does some sort of fluid simulation when I shake it

mattlondon 21 hours ago

Nothing happens on my android phone

jarek83 21 hours ago

I had that too on brave then realized that brave locks all permissions. It worked as expected in chrome

andai 14 hours ago

Ok in Firefox on Android I got the tilting to work. Super cool! No sound though.

dyauspitr 21 hours ago

Maybe it’s too much for my iPhone 13 or something, I can see it but it’s all choppy and slow

flykespice 19 hours ago

The demo runs like a slideshow on my humble budget android phone from 2021

salad-tycoon 19 hours ago

Don’t worry, it runs like a flip picture motion book on an iPad a16 (current gen. Base model iPad).

flykespice 18 hours ago

Probably vibecoded from looking at the menu UI.

kinduff 19 hours ago

I tried shaking the browser window lol

nkmnz 20 hours ago

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

Faint 2 hours ago

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

asaddhamani 20 hours ago

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

lavendermon 20 hours ago

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?

smusamashah 21 hours ago

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.

catapart 21 hours ago

They have different characteristics, too. The red, desert sand is clumpier than the beach sand, for instance.

jarjoura 21 hours ago

yup, I would just remove the sound effect completely.

momojo 20 hours ago

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 20 hours ago

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

bahmboo 6 hours ago

Love it. Want it on my actual pixel home screen

bob1029 19 hours ago

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

techpression a day ago

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

zamalek a day ago

What do you mean "stuck in the air?" It's top down.

techpression a day ago

They don’t move, not even when pressing with your finger, “stuck on the ground” then, it’s the same outcome.

vfosnar a day ago

didnt encounter the stucking issue but agree with the overerall point, the sand gets a sort of 'build-up pressure and bounce back' effect which breaks the immersiveness for me, otherwise cool

mashally 20 hours ago

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

kccqzy 21 hours ago

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 18 hours ago

Finally, the kind of sandbox we deserve

hamidmohaqeq a day ago

This is really cool and give a realistic sense

andai 14 hours ago

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

yipinwong 19 hours ago

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

hirako2000 16 hours ago

Handles double simultaneous taps n drags. Nice touch!

cat-whisperer 18 hours ago

a full circle moment

tgtweak 21 hours ago

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

itomato 20 hours ago

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

amunozo a day ago

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