video thumbnail 47:52
Coding Adventure: Simulating Fluids

2023-10-08

[public] 312K views, 91.7K likes, dislikes audio only

channel thumbSebastian Lague
4K

Let's try to convince a bunch of particles to behave (at least somewhat) like water.

Written in C# and HLSL, and running inside the Unity engine.

Source code:

https://github.com/SebLague/Fluid-Sim/tree/Episode-01

Next episode:

/youtube/video/kOkfC5fLfgE

If you'd like to support me in creating more videos like this, you can do so here:

https://www.patreon.com/SebastianLague

https://ko-fi.com/sebastianlague

Resources:

https://matthias-research.github.io/pages/publications/sca03.pdf

http://www.ligum.umontreal.ca/Clavet-2005-PVFS/pvfs.pdf

https://sph-tutorial.physics-simulation.org/pdf/SPH_Tutorial.pdf

https://web.archive.org/web/20140725014123/https://docs.nvidia.com/cuda/samples/5_Simulations/particles/doc/particles.pdf

Music:

https://github.com/SebLague/Misc-Project-Info/blob/main/Coding-Adventures/Fluid-Sim.txt

Chapters:

0:00 Intro

0:27 Gravity and Collisions

2:31 Smoothed Particles

3:55 Calculating Density

7:53 The Interpolation Equation

11:58 Gradient Calculations

15:38 The Pressure Force

19:19 Trying to Make it Work...

22:05 Optimizing Particle Lookups

26:31 Spatial Grid Code

27:48 Position Predictions

30:32 Mouse Force

33:22 Artificial Viscosity

36:46 Pressure Problems

39:51 Bugs

41:06 Parallel Sorting

43:22 Some Tests and Experiments

44:47 The Third Dimension

47:23 Outro


Intro
/youtube/video/rSKMYc1CQHE?t=0
Gravity and Collisions
/youtube/video/rSKMYc1CQHE?t=27
Smoothed Particles
/youtube/video/rSKMYc1CQHE?t=151
Calculating Density
/youtube/video/rSKMYc1CQHE?t=235
The Interpolation Equation
/youtube/video/rSKMYc1CQHE?t=473
Gradient Calculations
/youtube/video/rSKMYc1CQHE?t=718
The Pressure Force
/youtube/video/rSKMYc1CQHE?t=938
Trying to Make it Work...
/youtube/video/rSKMYc1CQHE?t=1159
Optimizing Particle Lookups
/youtube/video/rSKMYc1CQHE?t=1325
Spatial Grid Code
/youtube/video/rSKMYc1CQHE?t=1591
Position Predictions
/youtube/video/rSKMYc1CQHE?t=1668
Mouse Force
/youtube/video/rSKMYc1CQHE?t=1832
Artificial Viscosity
/youtube/video/rSKMYc1CQHE?t=2002
Pressure Problems
/youtube/video/rSKMYc1CQHE?t=2206
Bugs
/youtube/video/rSKMYc1CQHE?t=2391
Parallel Sorting
/youtube/video/rSKMYc1CQHE?t=2466
Some Tests and Experiments
/youtube/video/rSKMYc1CQHE?t=2602
The Third Dimension
/youtube/video/rSKMYc1CQHE?t=2687
Outro
/youtube/video/rSKMYc1CQHE?t=2843
Sebastian Lague Hello, on this channel I explore how to create stuff out of code. I hope you find some of it interesting!
/youtube/channel/UCmtyQOKKmrMVaKuRXz02jbQ
Support on Patreon patreon.com
https://www.patreon.com/SebastianLague/
Coding Adventure: Ant and Slime Simulations 1,690,181 views
/youtube/video/X-iSQQgOd1A
Trying to Improve My Geography Game with More Real-World Data 3,536,502 views
/youtube/video/UXD97l7ZT0w