The last time I made a video about how to code a fluid simulation using SPH, it was pretty slow so I made this follow-up video that will hopefully help you understand how to optimize it using a dynamic hashed grid, the core technology used is Smoothed Particle Hydrodynamics, and everything is written from scratch in Unity using C# and Compute Shaders.
If this video gains some interest I'll release a third part on how to realistically render this fluid in a performant way.
The editing on this one is a bit rough, was in a rush so please forgive me for that :)
I'll see you all next time ✌
---
Project Links
---
GitHub: github.com/AJTech2002/SPH-Uni...
Base Project: github.com/AJTech2002/SPH-Uni...
FluidRayMarching.cs : github.com/AJTech2002/SPH-Uni...
---
Information Links
---
SPH Paper: matthias-research.github.io/p...
Sebastian Lague Raymarching: • Coding Adventure: Ray ...
Thread Groups Medium Article: / compute-shader-indices
Nvidia Dynamic Hashed Grids: on-demand.gputechconf.com/gtc...
Bitonic Merge Sort: • Bitonic Sort - Sorting...
Spatial Hashed Grids: • Spatial Hash Grids & T...
---
Timestamps
---
Intro: (0:00)
SPH Explanation: (0:34)
Dynamic Hashed Grid Explanation: (3:19)
Setting up for Optimization: (4:00)
Hashing Setup: (6:51)
Bitonic Merge Sort: (7:46)
Compute Cell Offsets: (8:55)
Density & Pressure Calculation: (14:13)
Apply Optimization: (10:38)
Testing & Bonus: (11:26)
25 июл 2024