Real-time SPH Fluid Simulation on GPU - Web Page
Install the Vulkan SDK and build the project with your preferred Visual Studio version. Example:
/Application/Solution - Visual Studio 2022/Project.snl
Root
│ README.md
│
└─── Application
│ | Source
| └─── FluidSim.cpp: Main cpp application.
| |
| └─── Shaders: Contains all the vertex, fragment, and compute shaders.
| └─── ShaderList.fsl: list of all shaders. Used by The Forge.
| └─── resources.h.fsl: header file that defines all the shader resources (cbuffers, SRVs, UAVs, etc.).
| └─── helper.h.fsl: header file with various helper functions.
| └─── basic.vert.fsl: basic vertex shader for drawing one plane.
| └─── instanced.vert.fsl: vertex shader for instance drawing of multiple planes.
| └─── sphereInstanced.vert.fsl: vertex shader for instance drawing of all particles.
| └─── basic.frag.fsl: basic pixel shader for all objects in the scene.
| └─── partition.comp.fsl: compute shader to partition all particles.
| └─── sort.comp.fsl: compute shader for AMD sort.
| └─── sortStep.comp.fsl: compute shader for AMD step sort.
| └─── sortInner.comp.fsl: compute shader for AMD inner sort.
| └─── resetOffset.comp.fsl: compute shader to reset offset buffer.
| └─── partitionOffset.comp.fsl: compute shader to assign offset buffer.
| └─── density.comp.fsl: compute shader to calculate density.
| └─── force.comp.fsl: compute shader to calculate force.
| └─── simluate.comp.fsl: compute shader to handle collisions and integrate force, velocity, pos, etc.
| |
| | Solution - Visual Studio 2017: Solution to build the app.
| | Solution - Visual Studio 2019: Solution to build the app.
| | Solution - Visual Studio 2022: Solution to build the app.
│ | Resources: The Forge minimum resources for running the app.
│
└─── The Forge: Middleware for rendering.
|
└─── Tools: The Forge tools.
- https://en.wikipedia.org/wiki/Smoothed-particle_hydrodynamics
- http://rlguy.com/sphfluidsim/
- https://github.com/ConfettiFX/The-Forge
- https://github.com/GPUOpen-LibrariesAndSDKs/GPUParticles11/blob/master/gpuparticles11/src/SortLib.cpp
- https://en.wikipedia.org/wiki/Bitonic_sorter
- https://wickedengine.net/2018/05/21/scalabe-gpu-fluid-simulation/
The project's license is MIT. The Forge middleware uses Apache 2.0, but the third parties used by it have their own respective licenses. Also, AMD's SortLib license is MIT.