I would like to create particle effect in Unity which would simulate approximately fluid.
How to do this ?
I would like to create particle effect in Unity which would simulate approximately fluid.
How to do this ?
Thats a Jos Stam type fluid simulation. Several 2D and 3D simulations of this sort have existed for Unity for years. None of them for the VFX Graph era, and keep in mind that 3D simulations can get very expensive on the GPU. Its unlikely that you will run a 3D sim at sufficient resolution to generate the same kind of quality you see in that 2D example. For example even on a 2080ti, I cannot go above simulation resolutions of 192x192x192 without starting to drop below the required framerate. Still not bad considering that resolution results in over 7 million grid cells. Can still get some nice results using much lower res of 64x64x64 (less than 300000 cells) - this res isnt really sufficient for nice density texture results, but velocity fields of this resolution can still work real well with VFX graph etc…
These sorts of simulations certainly can be used to drive particles, for example by storing the velocity fields that the simulation generates in a render texture and then having VFX graph use that texture.
That wont look like your screenshot though, since thats not using particles, rather its rendering from a colour/density texture from the 2D simulation. An example of something that does similar 2D stuff from the asset store: Cocuy: The Fluid Simulator | Particles/Effects | Unity Asset Store
A 3D equivalent, which renders via raymarching of a 3D texture, was Fluidity on the asset store (thats probably what I used to make my avatar image on this forum). But this asset is long since deprecated. And neither of these assets are for the LWRP/HDRP/VFX Graph era of Unity.
I still dont know what I am doing with my solution, in terms of sharing it with others, which was originally based on these, which again are for a pre-HDRP etc era:
Possibly I will share something fairly basic and cut-down for free, to celebrate VFX Graph & HDRP coming out of preview. Just dont expect a fully polished solution, for example there wont be a sophisticated system of emitters that can be linked to Unity game object positions etc. And it wont happen before October at the earliest.
Also, there were signs a month or two ago of someone from Unity working on a fluid sim for pipelines, but there was no info about this project and I havent seen any further development of it on github recently. So its always possible they will surprise everyone with something at some point, or perhaps this idea has already been abandoned, its impossible for me to know.
The one simulation I’ve seen already for VFX graph uses, I believe, a different sort of simulation technique, not the stuff popularised by Jos Stam.
And I havent used it myself, so I’ve no idea what its like.
How to use additive particle shader in VFX graph?
Bloom effect in PP doesn’t behave equally with emission shader and VFX graph.