Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

dynamically setting capacity?

Discussion in 'Visual Effect Graph' started by Aaron-Meyers, Apr 23, 2020.

  1. Aaron-Meyers

    Aaron-Meyers

    Joined:
    Dec 8, 2009
    Posts:
    305
    I was wondering if its on the roadmap to be able to dynamically set the capacity for a VFX graph. Today I discovered that I was getting really poor performance on Oculus Quest due to having too large a capacity. Once I sized it down, everything was totally smooth. So seems like on mobile platforms, keeping your capacity constrained might be really important! When I've been using it on desktop, I just set the capacity to the biggest I imagine I'll ever need and don't worry about it, but it seems like being able to dynamically set it would be really helpful on less powerful platforms.
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    306
    Hi we have plans to allow dynamic capacity or at least overridable per particle system.
    It is true that capacity is a very sensitive value regarding your effect performance (both in terms of timings and memory).
    If you have an effect where you know the occupancy will be low (number of alive particles is a fraction of capacity), you can use the indirect mode on your outputs (toggleable per output in the inspector) to improve performance. This is especially true if you're using meshes with relative high vertex counts to render your particles.
     
    Zyblade and MagiJedi like this.
  3. TokyoWarfareProject

    TokyoWarfareProject

    Joined:
    Jun 20, 2018
    Posts:
    801
    Can you please update hte status on this? it is almost 2023
     
    DigitalChaotics and mgear like this.
  4. DigitalChaotics

    DigitalChaotics

    Joined:
    Dec 18, 2013
    Posts:
    25
    @JulienF_Unity
    What if we promise that we won't change the capacity while the object is active (visible) in the scene visual hierarchy? Or maybe "no changes while playing"?

    I don't need to set the capacity at ANY time. I am perfectly happy to set it up before I let the GameObject loose in the world.

    I just don't like preallocating the max. 99% of the time it's wasted space.
     
    Acer85 and TokyoWarfareProject like this.
  5. Slaktarkuno

    Slaktarkuno

    Joined:
    Dec 3, 2021
    Posts:
    10
    Is there any way to change the capacity automagically for different target platforms? Or do we need to use different VFX Graph asset with varying particle capacities for different target platforms if GPU memory is of concern?
     
  6. DigitalChaotics

    DigitalChaotics

    Joined:
    Dec 18, 2013
    Posts:
    25
    I did it. It was horrible.

    I built a graph with a 'Capacity' exposed property, and then used that to select/activate a capacity-specific version of the "core" graph - one each for 4K, 16K, 64K, 256K, 1M, and 2M particles. Reflected the core graph's properties to the world, wired up the insides, and...

    It worked, and then it didn't. The first few frames went well, but things slowed down quickly... ...and then the **** really hit the fan. GPU timeout. I tried various things, but always the same result: timeout.

    Deleted all but two subgraphs (256K, 1M), and it's stable again. More than that, and disaster awaits.

    I'm fairly sure I know what's happening: it's preallocating ALL of the subgraphs' capacities, even though only ONE of them is ever active. Bad things ensue.

    SO, THAT didn't work.... ....and we're still waiting for your fix @JulienF_Unity !
     
    Acer85, TokyoWarfareProject and mgear like this.
  7. A_Gamgie

    A_Gamgie

    Joined:
    Mar 30, 2013
    Posts:
    9
    Hello all,
    I'm facing the same issue on my project. Dynamic allocation would be great feature. When instancing the object for example.

    Thanks !