I'm glad this video (and my previous one) was so well recieved. I just wanted to quickly mention the code snippets I showed of my projects later on in the video are not meant to be an example of how you should code this. I basically hacked something together as proof of concept. It ended up being as fast as I needed but there are better ways of writing it.
Dude that research paper section was awesome. Wow. Edit: HAHA AND THE BEES START EATING THRU HIS HEAD love it. Honestly as far as a rts strategy game goes I think u could so follow your original inspiration. Like, I would so play a game ABOUT specifically building up my bee colony in someone's attic so that it can ultimately crash down on their heads. But if you aren't smart about it, you might alert them to your presence early and get messed up by the exterminators. It can be all-out warfare.
You’re awesome. Your ascii render system gave me a great idea for a game and once i get a couple CS classes under my belt, i’m gonna try and bring it to life
Excellent, I think it's great that you already have a project idea in mind while starting CS. That's the best way imo. Good luck with your studies and the game!
The Ascii sand was so cool! All I was thinking was "music video" I don't know crap about shaders, could you use audio to dynamically effect the rules? Like an equalizer, certain frequency bands could change various properties, like low kicks make the sand gravity reverse briefly so it adds thump to the visual? High frequency changing color, etc etc. If that was bundled with a frontend to make it easy for the user to tweak parameters, frequency bands, palettes, refresh rate, etc, I could see some money. Live Concert Visuals even let alone slick video edits. AND this is on an old laptop 🤯 Truly incredible stuff man, looking forward to more!
You have a gift for this stuff. IMO you should think about cinema. A collab with a documentary film maker for some suitably avant garde subject could be dynamite.
I'm glad to hear that! Yeah I went roughly in order of how I came to each idea so the video effect ended up being later in the video although it's one of the best for sure!
THIS IS AWESOME!!! I do wonder about how useful it would be in an actual game though. The main problem I see is reading the pixels type on the cpu side for other game logic, it would take quite some time to send the data down and the weird update order might be harder to work with then traditional cpu based sand engines. But if you could get it to work it would certainty be WAY FASTER than the cpu!
Yeah I haven't worked that out myself either to be honest haha.t I know some games like Space Simulation Took Kit say they use the GPU for simulation so someone out there knows how.
@@Yusef28 I must admit my ignorance, I have no idea what a badapple is 😂 but that video effect was amazing, really just, stunning. Like something from Ghost in the Shell, or Neuromancer. You are super talented man
Oh I commented this under the wrong comment apparently, so my bad there. I'm glad you liked the ASCII effect though it's one of my favourites. Thank-you also for your kind words here too!
I thought you were going to just make gpu accelerated noita, but the bees concept looks pretty novel and interesting. I liked the edge detection falling sand the best, especially during slower moving scenes. Take all the if-statements out of your shader, it will perform better. Not a lot of people completely understand branching is usually just if statements. I truly don’t believe you did all this on a 950m!!! The dedication is real! Awesome video 👍👍👍
Very good point about the if statements. I might have to pin a comment that my code is not the best example of how to do this. It's not optimized or that easy to work with long term, it just got the job done. About the 950m, and I've done way more intensive graphics stuff with this over the years and it's held up.
I always wanted to try this out it in compute shaders, but I never really thought about fragment shaders which operate per pixel. Which makes a lot more sense! I might give this a try in my Vulkan engine some time!
maybe i would have tried a pseudorandom generator taking the uv coordinates to decide probablistically whether its falling right or left which both pixels diagonally below compute but only one/or the other diagonal is selected.
Great video! Definitely solved a problem that I was running into! With this Margolus neighborhood approach, how do you handle individual interactions when adding a new material? such as adding "stone" or "wood", would you have to create all possible interactions sand has with these? I'm eager to look at your code when it's available!
Good question and the answer is so far I found ways to cheat. For any static (doesn't move once placed) material like stone I just have no interactions listed. That means in a margolus neighborhood with stone in it, nothing will happen. So sand that falls on it wont be processed in frames where it's margous neighborhood has stone. Another cheat like with honey eating through wood is I just only process intereactions where there is wood and honey in the same neighborhood block and I pick a random wood cell to turn into honey in that case. So the rule set consists of just two random checks. It is hard to explain further because the data structures I use do a lot of the heavy lifting (albeit badly). I've had to step away from the code for a while but once I'm able publish on shadertoy I'll make a community post about it.
Fair point. I didn't spend enough time on water for sure. One challenge is dispersion which on the CPU means sending the water cell multiple cells across in a given direction in one frame where possible. On the GPU that's more challenging.
I might have a good solution for fixing the chunkiness of falling particles, they need to check whether the particle underneath moved down the previous frame in the preferable direciron and if it did the particle above can move. That way you can have continuous streams. It won't always be visible which particle moves where but neither is real sand if they're homogenous color.
@@Yusef28 Damn, now I have to make something lol. The initial plan was to do it with webgpu and host it in the cloud, but I'm realizing that webgpu isn't actually ready for web... but it is ready for native desktop apps. So now it's become 2 projects... porting the webgpu game of life to JS... and doing a falling sand webgpu sim in rust.
Oh yes I should mention my code is not an example of how to do this. It's still very rough until now and another method like you suggest could improve both perfomance and make it less of a pain to work with. I might have to pin a comment about that.
I have a question. I've only just gotten into coding. (Using C) So, I know I'm a ways off on having the knowledge to do this but, say you wanted to have a desktop screen saver that is procedurally generated with basic AI behaviors with minimum load on CPU. Like zombies chasing humans. Is something like fragment shaders what you would be working with primarily? I've tried to look up information of the topic but haven't had much luck finding anyone doing something similar except the old pipes screen saver kinda. Great video by the way. Just found your channel and have been enjoying your videos. :)
Well I think it depends on how complex a scene you end up rendering. Simple art shouldn't be an issue, although I haven't build a shader screen saver. Glad to hear you're enjoying the videos!
Awesome effect, but I feel like there's a glaring issue with your animation code, which is literally visible everywhere. Specifically, it looks like the code for the falling sand is preventing particles from being on even/odd "lines" at any given time. You can see this clearly whenever you're spawning new "sand". All the stuff falls, and there are always horizontal lines between them with no particles. I'd imagine a slight re-factoring of your shader code would fix this.
As far as I know the issue you're describing is a limitation of the algorithm. If you had an 8x8 block of sand suspened in the air, you would expect all grains to fall at once. However we can only move sand when there is space below. So in the first frame only the bottom row of sand would be free to move. Frame two the next row up would have space, etc etc until all sand has a free row beneath. For frames beyond that each row with sand would be able to move down but you would have horizontal lines with no particles like you say.
I'm glad this video (and my previous one) was so well recieved. I just wanted to quickly mention the code snippets I showed of my projects later on in the video are not meant to be an example of how you should code this. I basically hacked something together as proof of concept. It ended up being as fast as I needed but there are better ways of writing it.
nice sand
but hey falling sand games never stopped being popular :)
also sandspiel partly works on the gpu!
Hi todepond!
Thanks, I learned quite a bit from your videos. Well fair enough! And good to know about sandspiel.
I had a feeling id find you here lol, keep up the cool work TodePond
waahhhh I love this recent resurgence of falling sand games... I used to play them so much as a child
i loved the powder game
powder game and powder toy my beloved
@@cerulity32k Yeah!!!!! both of these were so peak
Dude that is the coolest camera effect I’ve ever seen, crazy unique!
Thanks, I'm really glad to hear that!
that final video effect was SICK
Ok nice I'm glad people are liking that one!
Thought this was going to be a generic falling sand vid, but at 2:46 you actually solved a problem i had. Cheers mate
Thanks for this feedback, and I see a number of people liked your comment as well. I'm glad my content is helping.
Dude that research paper section was awesome. Wow.
Edit: HAHA AND THE BEES START EATING THRU HIS HEAD love it.
Honestly as far as a rts strategy game goes I think u could so follow your original inspiration. Like, I would so play a game ABOUT specifically building up my bee colony in someone's attic so that it can ultimately crash down on their heads. But if you aren't smart about it, you might alert them to your presence early and get messed up by the exterminators. It can be all-out warfare.
Thanks for all the great feedback. You're right and that idea reminds me of a game called Sim Ant from the 90s. I'll keep this idea in mind!
8:24: working in a huge Blender project with cycles enabled
This is very cool, i love falling sand code and shader code but i never thought about how cool it would be to combine it like that
You’re awesome. Your ascii render system gave me a great idea for a game and once i get a couple CS classes under my belt, i’m gonna try and bring it to life
Excellent, I think it's great that you already have a project idea in mind while starting CS. That's the best way imo. Good luck with your studies and the game!
thee aesthetic is so cooll, i love the magic hands ah scene, Really feels like that dark mysterious Inscription vibe 🤌
Thanks! That's the vibe I was going for.
Love it, that is an extremely cool effect! Thanks for sharing your journey with us on this project. Kudos!!!
My pleasure!
That falling ASCII video effect is amazing. I can totally see someone using it for a Hollywood hacker or AI character in a movie.
You've got the most creative graphics programming videos ive ever seen, this is so fucking trippy, I love it
Thanks a lot!
9:48 this looks like it could make an awesome boss arena, with the player on the platform and the sand video giant doing attacks
I think that's an awesome idea!
Usually I don't like most of the
this video did NOT go where I expected with that whole bee thing LMAO
That falling sand video idea is really, really cool.
That falling sand shader effect is crazy!! I'd be really interested in seeing this in a game
Agreed I'd like to see it in a game as well!
Combining this with ascii characters was a really cool idea. I love the effect that creates
Damn the final video effects look really awesome!
This is great to hear, thanks!
You've got something crazy good here man
The Ascii sand was so cool! All I was thinking was "music video"
I don't know crap about shaders, could you use audio to dynamically effect the rules?
Like an equalizer, certain frequency bands could change various properties, like low kicks make the sand gravity reverse briefly so it adds thump to the visual? High frequency changing color, etc etc.
If that was bundled with a frontend to make it easy for the user to tweak parameters, frequency bands, palettes, refresh rate, etc, I could see some money. Live Concert Visuals even let alone slick video edits.
AND this is on an old laptop 🤯 Truly incredible stuff man, looking forward to more!
This is an excellent idea! yes you can make the sand reverse directions and you can drive that by audio so what you are imagining is totally doable.
The effects look really cool, great work!
This is awesome. I used to love playing around with sand games on my first smartphone almost 10 years ago.
Looks like so much fun. Thanks for sharing!
I'm glad you enjoyed and oh yes these projects were a lot of fun
Woahhh i gotta rewatch this when im less busy and program all the same stuff. Super cool!
the ascii example was amazing! such a cool effect
yaaay falling sand :D i love making these types of games, that camera effect is awesome too T^T
They are super fun! I'm glad you liked it!
Love using an automata to describe falling sand, galaxy brain idea!
This is sick. Great vid. Video-based falling sand is an awesome concept.
Thanks this is great to hear!
I really like how the interaction between falling sand and water almost creates these pseudo air bubbles that rise up. Awesome emergent behavior
Oh yes I noticed this emergnet behaviour as well!
I've got to try this. Super cool video man!!
Appreciate it, and good luck with your project!
Great video and research! I really enjoyed some of the effects you came up with. Super inspiring! Thanks for sharing.
Thanks and it's great to hear the research paid off!
You have a gift for this stuff. IMO you should think about cinema. A collab with a documentary film maker for some suitably avant garde subject could be dynamite.
Oh thanks and yes I could totally see myself doing something avant garde so it's very interesting that you mention it.
your videos are simply fascinating, love ur content man keep up the good work :)
Thanks and will do!
YOOOOOO using the webcam is such a good idea, that matrix effect is awesome
I'm glad you think so!
Man, you are something else. Such a simple concept but so many interesting things you managed to come up with and implement.
Oh great feedback thanks, I'll have to keep the ideas coming then!
Hey Yusef! Really enjoy your videos! Keep up with the awesome work, Cheers!
Thanks, will do!
This is brilliant!
Oh hey, it’s you!
Eyyy.
Awesome. Doing things in fragment shaders is a great restriction to inspire creativity. The Margolus Neighbourhood approach was genius!
Oh yes, and so far I've only been using shadertoy which is even more restrictive. and agreed about the approach!
Awesome! Keep videos like this coming!
This is the coolest thing ever! I'm into graphics and visual effects myself, so I might try to mess around with it and see if I get any wacky ideas!
Awesome I hope you go for it!
The falling sand was cool. But that video effect was phenomenal. The artist inside of me went wild with ideas.
I'm glad to hear that! Yeah I went roughly in order of how I came to each idea so the video effect ended up being later in the video although it's one of the best for sure!
oh, graphics programming is so cool man, great video!
Thanks and agreed its awesome!
THIS IS AWESOME!!! I do wonder about how useful it would be in an actual game though. The main problem I see is reading the pixels type on the cpu side for other game logic, it would take quite some time to send the data down and the weird update order might be harder to work with then traditional cpu based sand engines. But if you could get it to work it would certainty be WAY FASTER than the cpu!
Yeah I haven't worked that out myself either to be honest haha.t I know some games like Space Simulation Took Kit say they use the GPU for simulation so someone out there knows how.
Dude your videos ideas are awesome, I discovered you with the ascii shader. I am really excited for the next ideas
watched this & the ascii shader video, your style reminds me a lot of the sebastian lague coding adventures series which i love to see
Well I must be doing something right then, thanks for this feedback!
Very cool effect! 🔥✨
This would be a killer effect in a music video or something
Agreed!
That was frikkin' sweet man! Looking forward to your next video!
Thanks!
Very interesting video all throughout. Great work man
this and the last video earned you a sub, keep up the experiments!
Great I'm glad you liked it!
so cool and so clever :)
I gave up on gpu falling sand, its so much harder than other cellular automata like smoothlife
Well if you ever come back to it you have a method now. Smoothlife is awesome too!
Really neat. Good job
graphics programmers do the coolest shit
This is so great!
this is really awesome
THE POWDER TOY MENTIONED
The ASCII effect on your face was *unreal*
that's funny because initiallly I was against uploading a badapple on youtube at all but then recently just decided oh why not
@@Yusef28 I must admit my ignorance, I have no idea what a badapple is 😂 but that video effect was amazing, really just, stunning. Like something from Ghost in the Shell, or Neuromancer. You are super talented man
Oh I commented this under the wrong comment apparently, so my bad there. I'm glad you liked the ASCII effect though it's one of my favourites. Thank-you also for your kind words here too!
Amazing work
It's awesome to see new falling sand projects and experiments being made. Great vid!
Glad you enjoyed it!
very relaxing and informative, keep it up!
This is so cool!
awesome video, good job
I thought you were going to just make gpu accelerated noita, but the bees concept looks pretty novel and interesting. I liked the edge detection falling sand the best, especially during slower moving scenes.
Take all the if-statements out of your shader, it will perform better. Not a lot of people completely understand branching is usually just if statements.
I truly don’t believe you did all this on a 950m!!! The dedication is real! Awesome video 👍👍👍
Very good point about the if statements. I might have to pin a comment that my code is not the best example of how to do this. It's not optimized or that easy to work with long term, it just got the job done. About the 950m, and I've done way more intensive graphics stuff with this over the years and it's held up.
Wonderful stuff
this is really cool!!
so much sand... you'll be finding it in your shoes for months.
bro wtf, this is so fucking cool
you have a great voice for this stuff, this was really relaxing to watch! could you avoid the branching by having a LUT?
Thanks that's good to here about my voice. I haven't looked into any optimizations but I imagine LUTs could be one.
I always wanted to try this out it in compute shaders, but I never really thought about fragment shaders which operate per pixel. Which makes a lot more sense! I might give this a try in my Vulkan engine some time!
Ok sweet I hope you go for it!
@@Yusef28 😭I spent 30 mins trying to get an additional 200 fps on a model renderer
4.6k fps on debug builds isn't enough!!!!
I'm only seeing this now, since I wasn't filtering comments properly but that's a lot of fps!
@@Yusef28 I have put it down for now to pursue work. I eventually may come back to it however.
this is epic!
Damn, people are so smart. That 2x2 grid idea would never come to me.
maybe i would have tried a pseudorandom generator taking the uv coordinates to decide probablistically whether its falling right or left which both pixels diagonally below compute but only one/or the other diagonal is selected.
@@theevilcottonball You could also precompute the random value once for the next frame but I don't know if it's actually better
This is so cool
8:20 - youtube compression: "AWW HELL NAWWW"
Cool stuff, using similar techniques you could probably do anthill optimization or physarum simulations.
Oh yeah I could definitely see that!
Great video! Definitely solved a problem that I was running into! With this Margolus neighborhood approach, how do you handle individual interactions when adding a new material? such as adding "stone" or "wood", would you have to create all possible interactions sand has with these? I'm eager to look at your code when it's available!
Good question and the answer is so far I found ways to cheat. For any static (doesn't move once placed) material like stone I just have no interactions listed. That means in a margolus neighborhood with stone in it, nothing will happen. So sand that falls on it wont be processed in frames where it's margous neighborhood has stone. Another cheat like with honey eating through wood is I just only process intereactions where there is wood and honey in the same neighborhood block and I pick a random wood cell to turn into honey in that case. So the rule set consists of just two random checks. It is hard to explain further because the data structures I use do a lot of the heavy lifting (albeit badly). I've had to step away from the code for a while but once I'm able publish on shadertoy I'll make a community post about it.
This is really cool. the only thing that bothered me was how chunky the water was. But other than that, it was interesting
Fair point. I didn't spend enough time on water for sure. One challenge is dispersion which on the CPU means sending the water cell multiple cells across in a given direction in one frame where possible. On the GPU that's more challenging.
I might have a good solution for fixing the chunkiness of falling particles, they need to check whether the particle underneath moved down the previous frame in the preferable direciron and if it did the particle above can move. That way you can have continuous streams. It won't always be visible which particle moves where but neither is real sand if they're homogenous color.
I literally had this idea in the car, just today for a project
Oh nice, I hope you make something awesome!
@@Yusef28 Damn, now I have to make something lol. The initial plan was to do it with webgpu and host it in the cloud, but I'm realizing that webgpu isn't actually ready for web... but it is ready for native desktop apps. So now it's become 2 projects... porting the webgpu game of life to JS... and doing a falling sand webgpu sim in rust.
Wow, ok lot's technoogies to be familiar with for this project, sounds great!
Really Cool :) 👍
Damn you I was just learning parallel computing and shaders to do something like this
Oh perfect timing then!
Yoo this shit is sick af!
This is soo cool
dang this video quality!
my suggestions is to use arithmetic instead of branching on the GPU, would boost the performance even more
Oh yes I should mention my code is not an example of how to do this. It's still very rough until now and another method like you suggest could improve both perfomance and make it less of a pain to work with. I might have to pin a comment about that.
sand 👍
Sand rules!!
we melted and lasered sand in order to simulate sand, the cycle is complete 😂
Haha this is an awesome observation!
Really cool, I was expecting to see the view count be around 5 digits not 3
8:07 We need falling sand bad apple
Ok I'll consider a bad apple version since I got this suggestion on my last video too.
that ascii falling sands thing is amazing
I think all videos should use the falling sand filter
Yes, I love it!
I have a question. I've only just gotten into coding. (Using C)
So, I know I'm a ways off on having the knowledge to do this but, say you wanted to have a desktop screen saver that is procedurally generated with basic AI behaviors with minimum load on CPU. Like zombies chasing humans.
Is something like fragment shaders what you would be working with primarily? I've tried to look up information of the topic but haven't had much luck finding anyone doing something similar except the old pipes screen saver kinda.
Great video by the way. Just found your channel and have been enjoying your videos. :)
Well I think it depends on how complex a scene you end up rendering. Simple art shouldn't be an issue, although I haven't build a shader screen saver. Glad to hear you're enjoying the videos!
Great exploration and coding. I would never call those games though…
The falling sand looks a bit weird because there is always one empty horizontal line every 2 pixels.
HOLY SHIT... AUTO MATA OUTA MADA>>>THE FUCK?>
Impressive
Awesome effect, but I feel like there's a glaring issue with your animation code, which is literally visible everywhere.
Specifically, it looks like the code for the falling sand is preventing particles from being on even/odd "lines" at any given time. You can see this clearly whenever you're spawning new "sand". All the stuff falls, and there are always horizontal lines between them with no particles. I'd imagine a slight re-factoring of your shader code would fix this.
As far as I know the issue you're describing is a limitation of the algorithm. If you had an 8x8 block of sand suspened in the air, you would expect all grains to fall at once. However we can only move sand when there is space below. So in the first frame only the bottom row of sand would be free to move. Frame two the next row up would have space, etc etc until all sand has a free row beneath. For frames beyond that each row with sand would be able to move down but you would have horizontal lines with no particles like you say.
Space simulation toolkit is a cool similar project I think.
Oh yes and from what I've read they actually use the GPU heavily for it as well