Search Unity

Nvidia Flex isn't working with LWRP

Discussion in 'Editor & General Support' started by IamTirion, Apr 27, 2019.

  1. IamTirion

    IamTirion

    Joined:
    Mar 3, 2019
    Posts:
    20
    I know Nvidia Flex is an Nvidia asset and thus managed by Nvidia. I have posted this on their forums and haven't got a response. But seeing that Unity has official collaberation with Nvidia, I think Unity could request Nvidia to make Flex compatible with new Unity render pipelines? It is the only fluid system in Unity as far as I know. The other fluid assets on the Asset Store are mainly asthetic only. I know another one called Obi fluids but it uses CPU rather than GPU for calculation and I am not sure if it works with LWRP either. I have not had much success with simulating fluids with Unity's Particle System because the particles don't stick together.

    Right now, my problem is that the Flex fluids don't appear at all. Is anyone else getting this problem? Are there workarounds? Do you know other ways to simulate fluids?
     
  2. avandenberg

    avandenberg

    Joined:
    Nov 22, 2018
    Posts:
    23
    Got the same problem, if you found a workaround I'd love to know!


    Edit: Been searching around a LOT today but haven't been able to find anything useful. The problem is that the shaders are not compatible with URP/HDRP. Because of this the shaders have to be converted but I have nowhere near the knowledge to pull that off. I've tried to implement some of the built in shaders for particle systems for URP but these don't show up either... If anyone has the skill and time/interest to do this, PLEASE <3

    I hope NVIDIA will update the plugin soon. I'm considering to downgrade back to the built-in RP but that would mean undoing a lot of work for me :/ Hope I can find a fix for this!


    Edit2: When you mess around long enough to at least get the plugin to try to render the particles/fluid, eventually you will receive error messages about not being able to create a rendertexture, after which your entire GPU will crash, along with Unity. Yeah, this stuff is way out of my league but I really need this to work :/
     
    Last edited: Mar 11, 2020
  3. GamesEngineer

    GamesEngineer

    Joined:
    Aug 22, 2014
    Posts:
    9
    After running into issues with Nvidia Flex last spring, I gave up on it and wrote my own GPU compute shader for FLIP fluid simulations and a metaball shader to render the results. It's working in realtime within a LWRP project (I'm still on Unity 2018.4), but it's not yet generic enough to be published on the Asset store. Currently, the code is "tuned" specifically for my game's requirements. But at least it proves that LWRP/URP is fully capable of handling this type of complex simulation and rendering. Here's a youtube video that shows my fluid simulator in action.
     
  4. avandenberg

    avandenberg

    Joined:
    Nov 22, 2018
    Posts:
    23
    Damn good work there! I don't suppose you're willing to share the package :p In the end I visualized the particles by attaching a unity particle system but its far from ideal :/ Im jealous if your skill/knowledge!
     
  5. GamesEngineer

    GamesEngineer

    Joined:
    Aug 22, 2014
    Posts:
    9
    At some point in the future (probably after releasing our game) I will publish my fluid simulator on the Asset store. But I'm not going to be giving it away for free. It took me at least 1500 hours to develop what I have now, and it's still not done.
     
  6. avandenberg

    avandenberg

    Joined:
    Nov 22, 2018
    Posts:
    23
    Totally understand :) cant blame me for trying :p hope you manage to get it to where you want to! Best of luck