[RELEASED] Fluid Dynamics : 2D GPU Particle System Fluid Simulation.


Fluid Dynamics is a 2D GPU Particle System Fluid Simulation for Unity. Fire, smoke or any other fluid in your game in realtime using GPU.

Fluid Dynamics uses Compute Shaders and PC, Linux, Android compatible, but please make additional check here

itch.io - Fluid Dynamics by seedo
Asset Store - https://assetstore.unity.com/packages/slug/137435

Features:

PC and mobile friendly
Full source code included
Vorticity control
Viscosity control
Multiple simulation spaces support
Full control of physical based simulation
Fluid flow followers support included
Multiple Emitteres
PC and mobile controls support (included)

Four example scenes and online documentation included.

2 Likes

Finally released in Asset Store - https://assetstore.unity.com/packages/slug/137435

1 Like

There is no demo on itch.io page.

Sorry about that. Demo projects now added.

Just bought and imported the asset today. You might want to include some project setup instructions other than the prefab/component usage. I can imagine this will be the first issue faced by most users: SystemInfo.supportsComputeShaders always false on Android - Questions & Answers - Unity Discussions

I’m also getting a bunch of other errors here from the example scene (From the asset store btw):

Kernel 'AddVelocity' not found
UnityEngine.ComputeShader:FindKernel()
FluidDynamics.Main_Fluid_Simulation:Start() (at Assets/FluidDynamics/Scripts/Main_Fluid_Simulation.cs:147)
Kernel index (0) out of range
UnityEngine.ComputeShader:SetBuffer(Int32, String, ComputeBuffer)
FluidDynamics.Main_Fluid_Simulation:Update() (at Assets/FluidDynamics/Scripts/Main_Fluid_Simulation.cs:176)
Kernel index (0) out of range
UnityEngine.ComputeShader:smile:ispatch()
FluidDynamics.Main_Fluid_Simulation:Update() (at Assets/FluidDynamics/Scripts/Main_Fluid_Simulation.cs:177)

The last two goes on for a bit. Is there a setup process I’m missing?

One more thing. This one is maybe a nitpick, but your readme file mentioned to add a “Main_Fluid_Simulation” component. I usually search for my components after clicking Add Component on a GameObject. It confused me to see that it wasn’t there. I looked at your code and realised that you named it differently in the dropdown menu. Would’ve been more intuitive to have the same name?

Thank you for your observation.
New online documentation

Seems like there is no unity support for Metal2 on Mac.
Also in online docs added instruction for Android target platform in Windows Unity Editor.

Pixel Art fire example

Looks great! Is it possible to implement colliders?

1 Like

Yep, Fluid Dynamics already supports polygon colliders.

1 Like

good and ncie

does this work on Unity WebGL?

It is possible to project those fluids on a 3D surface?

What’s the mobile performance, how does it compare to this:

?

Will this asset work in webGL?

Do you have mobile demo?

Is it possible to change the fluid color without affecting the existing fluid on the plane. For example: I inject Red fluid, then inject Green fluid afterward. Is it possible to retain the Red fluid but still interact with the new Green fluid? I have tried changing the color of FluidSimulation (Update Gradient Checked), but the existing Red fluid got changed to Green as well.

By the way, does this work on mobile? I tried to build the ExampleScene to iOS. I doesn’t work. There’s an error in Xcode:

Execution of the command buffer was aborted due to an error during execution. Caused GPU Hang Error (IOAF code 3)

anyone got it going on webgl? i dont think it works.

can anyone tell me why you cannot change viscosity, particle life or dissapation via code, its weird! I set them but they do not change.