Real-time Eulerian fluid simulation on a Macbook Air, using GPU shaders
HTML-код
- Опубликовано: 25 дек 2023
- In order to implement fluid simulation we need to implement conservation of mass, incompressibility, and conservation of momentum. How to do this, using Eulerian cell representation, on GPU shaders?
- Наука
That was one of the best explanations for advection I've seen online! Especially the pushing bubbles out of a phone screen protector analogy.
Thank you very much! Very much appreciated :)
love the experimental feel to how you moved forward itteration by itteration,
Can't believe I watched entire video about coding and didn't get bored
Hugh, the standard first book on PDE is Walter Strauss's book. If you want to try questions on me I'm happy to help out.
first thing I thought about when I clicked on this video is about The Powder Toy which is a pixel based particle simulator game which actually has that exact same type of fluid simulation for simulating air in the game
Interesting! Thank you!
loved the video! feels like discovering sebastian lagues yt channel all over again :)
Wow, that's a very nice thing to say. I feel like I can die happy now. I mean, unfortunately this is my least bad video to date, and you will be disappointed if you watch any of my others, but it's still very nice to hear these words :)
very good video. i'm glad you showed or mentioned what approaches didn't work
Great work, I can't wait to see your next simulations!
This is so cool, and you did a great job with the video editing! I hope you make more videos like this!
Thank you! That's very kind to say. Very much appreciated :)
I wish the very best on RUclips, I am so glad I discovered your channel. Keep up the good work !
Really well produced, nice work
Great and inspiring video, thanks a lot!
I love this, thank you for makin my day on yt much better!
Thank you very much!
I loved this video! Really inspiring, and I'm sort of amazed that this was running on a macbook air too - great job :D Thanks so much for sharing.
Thank you very much!
Thanks for the beautiful video.
i bet this would run much better on a gpu with a cooling system and more than 10 cores (or whatever your model of macbook has)
Subbing cause I wanna see you simulate the inside of Earth. Great content
educational and entertaining! loved it, thank you
Thank you!
Beautiful!
Got recommended.....now in love
Great video
Thank you for this video
Thank you!
regarding the parallel part: would it be feasible to work the opposite way? Instead of writing to 4 cells, each cell would instead read from 4 neighbors and update itself.
Awesome 👍
Thank you!
You could have used MultiGrid for the solver since it land it self to parallelism better
Yes. Potentially a topic for a next video :)
this thumbnail is better
me: 50 frames per second that’s pretty bad performance
RL: *”on my MacBook Air”*
thats CRAZY
50 fps is bad?
Cool
Imagine the kind of simulation you could do with a 4090 over the mac book.
Nice
Thank you!
this is so cool, is it possible to upload the source code to a public repo?
11:11 that looks like the lines of a magnet.
This is really cool. Do you have a github repo available for this?
I probably should do that yeah...
No way Euler got named for a fluid dynamics problem. We're supposed to name the problem after the *second* person to solve it!
So persistent zero velocity is like a solid object? I wish it were easier to see it against an unmoving background .
Yes, that's right. As far as the coloring scheme, definitely open to suggestions. Won't affect this video, since cannot modify published videos. But could be useful for future videos.
do you think this could be used for electromagetics?
Interesting question!
Depending on what you want. I guess you want to iteratively compute the EM fields?
Some of the simulations definitely looked like simple 2d magnetic fields
no links to the code?
How do you run these shader ? Can it use under sdl2?
These are running in Unity, using HLSL.
wait you need a macbook pro to do pro stuff?? (looks sexy)
I'm using a MacBook air m2
Which method is cheaper to run?
You mean for Lagrangian vs Eulerian? Eulerian is faster/cheaper.
@@rlhugh Sorry for the vagueness, I meant for particle - vs vector based
Love this but if that’s how you say Euler I’ve been saying it wrong all this time 💀💀
I did research the pronunciation. There are a couple of ways. Before I researched the pronunciation, I was saying "you lurr Ian". But "oiler Ian" appeared to be more common, as far as I could see? How are you thinking if should be pronounced?
@@rlhugh I’ve been saying youll-lah 😅
@@tomd6410 actuuaaalllyyy seems that it might depend on us vs UK pronunciation, eg see youglish.com/pronounce/eulerian/english/uk
@@tomd6410i feel like "name"-ian in English are pronounced very differently from how you pronounce the name so while Euler is pronounced weirdly, eulerian is pronounced how you would expect, like Laplace and Laplacian
Oy-lear-ean, surely...?
rather than updating a bunch of nonadjacent cells why don't you store two buffers, and instead of changing a cell's neighbors, instead calculate how a cell is affected by its neighbors, and write that into the second buffer.
Do you mean, in the projection step? Because we aren't updating the cells: we are updating the walls of each cell. And each wall is attached to two cells. There isn't a way of updating one cell without updating its neigbor, because we aren't really updating the cells: we are updating the walls. When we choose 'a cell', what we are doing is updating all 4 walls of that cell. Then, you might say, can we select arbitrary walls? Well, no, because the update of 4 walls around a cell is based on ensuring incompressiblity of the fluid entering and leaving that one cell, but the updates themselves are applied to the walls, not to the cell. There is no way then to update two adjacent cells, because we'd be updating the same wall twice, i.e. the wall in between the two cells. Having a buffer doesn't really change that. Let's imagine we update the walls around cell A, into buffer 2. Now, when we calculate the walls around adjacent cell B, we'll need to read the values from buffer 2, in order to have the up to date value for the shared cell wall. So, it's sequential, not parallel. Not sure to what extent that answers your question?
"shaders are fun" consider me an opp
Haha :)