20 - How to write a Height-Field Water Simulator with 100 lines of code.

  Рет қаралды 15,149

Ten Minute Physics

Ten Minute Physics

Күн бұрын

Пікірлер
@HansPeter-gx9ew
@HansPeter-gx9ew Жыл бұрын
thank you Mr. Mueller, I cannot stress enough how valuable you explanations are, on the internet there are almost no sources available explaining this stuff at all. No book or paper I read explains the math really well. I would pay hundred of Euros to have a complete course that explains all the math, tricks and modern solutions used in CFD Papers to the point that I can implement it on my own. p.s. the more content =>the happier I get so thank you one more time :D
@Higgsinophysics
@Higgsinophysics Жыл бұрын
Man you are talented. Well done.
@j.j.maverick9252
@j.j.maverick9252 Жыл бұрын
Very impressed with how neatly you dealt with the submerged case!
@quentinwach
@quentinwach Жыл бұрын
Oh boy, here we go again. Big fan here and I am really excited ^^ Thank you for all your work!
@therealpeter2267
@therealpeter2267 Жыл бұрын
Damn I coded almost the same thing for my procedural game like 7 years ago, the terrain was already using columns for caves and different materials, so adding water was mostly straight-forward. I was so surprised when adding velocity to it instead of just a heightmap resulted in waves 😄 it was so fun to play around with it aswell! :)
@griffinschreiber6867
@griffinschreiber6867 Жыл бұрын
I love your videos! Since you seem to be focusing on fluids right now, maybe you would consider doing a video about smoothed particle hydrodynamics?
@MirazhStyle
@MirazhStyle 4 күн бұрын
Looks great! Any plans on video about Shallow Water Simulation?
@PeteJonesF6
@PeteJonesF6 9 ай бұрын
Love all of your videos, they are simply awesome, thank you so much for taking the time :) I was just wondering if there is a very minor 'bug' in your code or not (its probably totally unnoticible in the result). Should you not be using an unmodified height when reading the neighbours to compute the velocities? There may be some slight errors introduced due to reading the positional damped height in directions which cell heights have been updated this frame (line 247-252).
@williamchurch8401
@williamchurch8401 Жыл бұрын
Thank you for these tutorials! They have considerably helped me in implementing the techniques in your papers. xpbd is something I very much want to implement in my game. I would love to see tutorials expanding your soft body example with collisions with other soft bodies, rigid body shapes and particles. I have always thought there should be a physics system biased on simple particles and searching for such has lead me here. Your tutorials are a rare and prized thing! Thank you!
@Madlion
@Madlion Жыл бұрын
Ur channel is gold!
@cobaltxii
@cobaltxii Жыл бұрын
Very nice your videos are always great
@BrunoVigário
@BrunoVigário 6 күн бұрын
Very interesting channel you have here. Congrats! Can you give me a quick tip on how to add and remove water from the system? Thank you.
@euphrates5625
@euphrates5625 Жыл бұрын
Hello, do you also plan on a video on Rigid Body dynamics and shape matching? Your videos and your website simplifying intimidating concepts gave me courage to pursue more on computer graphics and simulations. You are doing sublime work!
@johann2518
@johann2518 Жыл бұрын
Can this be used for slopes too, when tweeked right?
@funorpain
@funorpain Жыл бұрын
Great demo! Can the next video simulate the movement of water in a swinging drinking glass?
@JensChristianRestemeier
@JensChristianRestemeier Жыл бұрын
Weird coincidence, as I'm looking at your other water papers at the moment. I've got the water from the old 2008 GDC paper working, and I'm looking at the shallow water paper from 2010 Siggraph. Did you ever write a newer version of that, or do you have an errata?
@94HellGate
@94HellGate Жыл бұрын
really nice. but something i have struggled with in the past is wave propagation speed. its heavily dependent on the grid resolution and there is no good way to adjust it to a realistic value
@atomictraveller
@atomictraveller Жыл бұрын
i dunno how far it will get you here, in audio/1d angular frequency is 2 * pi * hertz/samplerate insofar as angular frequency or w is the square root of k/ your spring constant for tuning mass-springs :)
@rlhugh
@rlhugh Жыл бұрын
One trade-off with the way the influence of the balls on the water works is that moving the yellow ball along the bottom of the pool slightly causes huge waves directly above it. But on the other hand one doesn't have to render for several hours per second of output, so ... tradeoffs :)
@TenMinutePhysics
@TenMinutePhysics Жыл бұрын
Yes, that's true. Maybe making the effect dependent on the depth would help. I haven't tried that yet.
@plasid2
@plasid2 Жыл бұрын
Could you pls make tutorials series how make simulation from this article "Real-time Simulation of Large Bodies of Water with Small Scale Details" in Unreal Engine? I read this hundred time but still I dont know even how to start ;(
@shihyuehjan3835
@shihyuehjan3835 Жыл бұрын
wow IT IS INSANE!
@VectorNodes
@VectorNodes Жыл бұрын
Another banger. Granted, it’s the worse fluid simulation lol but you even managed to make that good by rendering the surface. There’s an example of this sim on three js that I used while learning compute shaders and they just left that up to three
@TenMinutePhysics
@TenMinutePhysics Жыл бұрын
Yeah, the sim doesn't look very good :-) That is mostly due to fine tuning of the parameters and grid resolution. I haven't spent too much time on that. If you like, make it look better and send me an updated version.
@VectorNodes
@VectorNodes Жыл бұрын
@@TenMinutePhysics lol nooooo I hope you didn’t take it that YOUR sim didn’t look good. I mean the height field sim never looks good. I meant that yours is probably the only one I’ve liked
@TenMinutePhysics
@TenMinutePhysics Жыл бұрын
No worries. One can indeed make height field fluids look a lot better. This one is quite low res an overdamped
@erayavci3081
@erayavci3081 Жыл бұрын
How to make it interact with terrain?
@steffen7662
@steffen7662 6 ай бұрын
I currently work on this, it's actually surprisingly easy
@Madlion
@Madlion Жыл бұрын
Is this also called Shallow Water simulation or is it something else?😊
@TenMinutePhysics
@TenMinutePhysics Жыл бұрын
The shallow water equations are a bit more sophisticated. I will make a tutorial about those too. They are more closely related to the Eulerian equations.
@Madlion
@Madlion Жыл бұрын
@@TenMinutePhysics oh ok, can I ask how physically accurate is this compared to shallow water? Like is this technique rooted in some physical model of water sim?
@rlhugh
@rlhugh Жыл бұрын
Wow, that's so cool. I was like "How can you simulate 3d fluid in javascript???", and then you explain how. So clever :)
@MarcelNKemet
@MarcelNKemet Жыл бұрын
Very innovative way of doing fluid simulation. However it's mostly limited to visual effects with no real engineering applications (which breaks away from your previous tutorials). I wonder how you'd go about doing a Navier-stokes Fluid-structure simulation.
@user-og6hl6lv7p
@user-og6hl6lv7p Жыл бұрын
Source code shows 695 lines, but granted a lot of that is unavoidable rendering stuff. Where specifically is the "100 lines" section though?
@444haluk
@444haluk Жыл бұрын
I don't understand why you prefer browser. I would think as an Nvidia researcher you would use Warp.
@rlhugh
@rlhugh Жыл бұрын
I'm going to guess it's using an NVidia GPU either way :)
@ivanalyoshafyodor
@ivanalyoshafyodor Жыл бұрын
I suspect the browser is accessible to a broader audience! It could also be seen as a testament to the code's performance.
@rlhugh
@rlhugh Жыл бұрын
Yeah, I can even run it on my phone, right.... and it runs at a reasonable speed. Super cool.
@SinanAkkoyun
@SinanAkkoyun Жыл бұрын
Would you as an assembly enthusiast write a production game in assembly? Writing all this in JS and with WebGL makes it super easy to get their hands on
@nolram
@nolram Жыл бұрын
So you can test out the demos directly! He does use WARP in his GPU simulation video.
@michaelkohlhaas4427
@michaelkohlhaas4427 Жыл бұрын
Could XPBD be used for modal analysis somehow?
Coding Adventure: Rendering Text
1:10:54
Sebastian Lague
Рет қаралды 777 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 61 МЛН
REAL or FAKE? #beatbox #tiktok
01:03
BeatboxJCOP
Рет қаралды 17 МЛН
22  - How to write a rigid body simulator
16:35
Ten Minute Physics
Рет қаралды 6 М.
Coding Adventure: Simulating Fluids
47:52
Sebastian Lague
Рет қаралды 2 МЛН
17 - How to write an Eulerian fluid simulator with 200 lines of code.
12:05
Ten Minute Physics
Рет қаралды 311 М.
Reinforcement Learning - My Algorithm vs State of the Art
19:32
Pezzza's Work
Рет қаралды 142 М.
18 - How to write a FLIP water / fluid simulation running in your browser
12:20
Differential equations and calculus from scratch
1:10:44
Ten Minute Physics
Рет қаралды 9 М.
11 - Finding collisions among thousands of objects blazing fast
11:04
Ten Minute Physics
Рет қаралды 26 М.
Create Life From a Simple Rule
14:37
Brainxyz
Рет қаралды 790 М.
Procedural Generation: Programming The Universe
41:57
javidx9
Рет қаралды 207 М.
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН