All Projects → Scrawk → Pbd Fluid In Unity

Scrawk / Pbd Fluid In Unity

Licence: mit
A PBD fluid in unity running on the GPU

Projects that are alternatives of or similar to Pbd Fluid In Unity

Blender Flip Fluids
FLIP Fluids is a powerful liquid simulation plugin that gives you the ability to create high quality fluid effects all within Blender, the free and open source 3D creation suite.
Stars: ✭ 983 (+180.86%)
Mutual labels:  simulation, fluid
Unity Robotics Hub
Central repository for tools, tutorials, resources, and documentation for robotics simulation in Unity.
Stars: ✭ 439 (+25.43%)
Mutual labels:  unity, simulation
Webgl Fluid Simulation
Play with fluids in your browser (works even on mobile)
Stars: ✭ 11,621 (+3220.29%)
Mutual labels:  simulation, fluid
Su2
SU2: An Open-Source Suite for Multiphysics Simulation and Design
Stars: ✭ 731 (+108.86%)
Mutual labels:  simulation, fluid
Carsimulator
A Top Down 2D Car Simulator For Unity
Stars: ✭ 184 (-47.43%)
Mutual labels:  unity, simulation
Unitylockstep
Modern Lockstep with clientside prediction and rollback
Stars: ✭ 349 (-0.29%)
Mutual labels:  unity, simulation
Sdsandbox
This provides a sandbox simulator for training a self-driving car. This uses Unity for simulation and Python with Keras and Tensorflow for training. Recently updated to work on Python 3.4+ and Keras 2+
Stars: ✭ 369 (+5.43%)
Mutual labels:  unity, simulation
Ocean community next gen
Next gen iteration of the unity community ocean shader
Stars: ✭ 855 (+144.29%)
Mutual labels:  unity, simulation
Prosperity Wars
Game-like agent based economy simulator
Stars: ✭ 153 (-56.29%)
Mutual labels:  unity, simulation
Articulations Robot Demo
Stars: ✭ 145 (-58.57%)
Mutual labels:  unity, simulation
euler-fluid-cpp
Euler fluid simulated with CPP and SFML
Stars: ✭ 50 (-85.71%)
Mutual labels:  simulation, fluid
Vortex2D
Real-time fluid simulation engine running on GPU with Vulkan
Stars: ✭ 91 (-74%)
Mutual labels:  simulation, fluid
Liquidsimulator
Cellular Automaton 2D Liquid Simulator for Unity
Stars: ✭ 302 (-13.71%)
Mutual labels:  unity, simulation
Water2d Unity
A simple shader + example of a water surface with reflection in 2D
Stars: ✭ 335 (-4.29%)
Mutual labels:  unity
Unityfx.outline
Screen-space outlines for Unity3d.
Stars: ✭ 335 (-4.29%)
Mutual labels:  unity
Lively
Stars: ✭ 5,721 (+1534.57%)
Mutual labels:  unity
Klakspout
Spout plugin for Unity
Stars: ✭ 332 (-5.14%)
Mutual labels:  unity
Timelineparticlecontrol
An example of controlling particle system from timeline.
Stars: ✭ 348 (-0.57%)
Mutual labels:  unity
Iphonemocapios
Stars: ✭ 338 (-3.43%)
Mutual labels:  unity
Simupy
A framework for modeling and simulating dynamical systems
Stars: ✭ 329 (-6%)
Mutual labels:  simulation

This is a position based dynamics particle fluid simulation running in Unity on the GPU. It uses the same math from the previous PBD project but adapted some what to run on the GPU.

The biggest difference is how finding the neighbouring particles is handled. This is more complicated on the GPU and I went with a grid hash using a Bitonic sort. Other sorting method are around (like Radix sort) and maybe faster but the Bitonic sort was simpler and works quite well. Profiling shows its not the bottle neck so a faster sort may not see much performance gain.

Its certainly not the fastest particle fluid around but can simulate 70K fluid particles and 30K boundary particles at 30fps on a GTX980 which is not too bad.

Fluid particles

The boundary conditions are handled by special particles that the fluid wont flow through. These are then added around the border. This does make it more costly than other methods but it also allows objects in the scene to interact with the fluid more easily. All you need is a method to voxlize a mesh to particles and you can then add them to the boundary.

Fluid boundary

To render the fluid I made a compute shader that fills a 3D texture with the particles densities. That volume can then be ray traced in a shader to render the fluid. Its just a unlit shader however so has no lighting. A method needs to be added to create normals from the volume to add lighting.

You need to use linear light space for the fluid to look like these images.

Fluid raytraced

Fluid raytraced

Fluid raytraced

Fluid raytraced

Fluid raytraced

Fluid raytraced

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].