Introduction

This is a Unity shader plugin, not a fluid physics simulation plugin. It is used to render particle data into a smooth liquid surface. It is suitable for rendering simulation systems that use particles as simulation units.

Note

The principle of this plugin is based on the paper Screen Space Rendering With Curvature Flow.

Fluid simulation is generally based on grids or particles. In consideration of real-time performance, the SPH-based method (a particle-based method) is still used.

Unity does not have a very suitable fluid rendering plugin, which is the main reason for this plugin. I also noticed that there is indeed an implementation based on the same principle on the Asset Store.

In the process of using, I feel that I can do better, no matter from the efficiency or visual effects or ease of use and scalability, thus this plugin was born.

Note

This plugin is developed on Unity 2019.3.0f5 (64-bit) version and supports Unity Builtin Shader System and Unity URP System. It runs more efficiently on the Unity Builtin Shader System and is not optimized for URP.

Warning

OnRenderObject needs to be supported. It cannot run on LWRP.

I prepared several demo scenarios:

../_images/Demo_File.PNG

[DEMO] Load particles from file

../_images/Demo_Blood.PNG

[DEMO] Blood

../_images/Demo_Single_ParticleSystem.PNG

[DEMO] Single ParticleSystem

../_images/Demo_Multiple_ParticleSystem.PNG

[DEMO] Multiple ParticleSystems

Note

By default, the Gameobject named Renderer is off on each demo, enable it to see the effects. If still not work, reactive the ParticleSource GameObject and Renderer Gameobject.