Search Unity

  1. We are migrating the Unity Forums to Unity Discussions by the end of July. Read our announcement for more information and let us know if you have any questions.
    Dismiss Notice
  2. Dismiss Notice

Feedback VFX graph/ particle simulation

Discussion in 'Graphics Experimental Previews' started by konsic, Aug 27, 2019.

  1. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
  2. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    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: https://assetstore.unity.com/packages/tools/particles-effects/cocuy-the-fluid-simulator-33564

    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:

    GPU-GEMS-2D-Fluid-Simulation

    GPU-GEMS-3D-Fluid-Simulation

    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.
     
  3. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    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.
     
  4. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    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.

    https://github.com/thinksquirrel/fluviofx
     
    konsic likes this.
  5. JackDDeane

    JackDDeane

    Joined:
    Aug 6, 2018
    Posts:
    26
    Might also want to check out this tutorial for a basic start
    it's in Russian but has English subs.
     
    elbows likes this.
  6. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    How to use additive particle shader in VFX graph?

    Bloom effect in PP doesn't behave equally with emission shader and VFX graph.