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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

SOLVED: Mesh Output particles not cleared after particle is dead.

Discussion in 'Visual Effect Graph' started by coskuturhan, Mar 18, 2020.

  1. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    We have a situation where we are spawning bunch of meshes as particle outputs. When we render doc the partciles after they are dead, we see a lot triangles still in the scene but not visible to camera. This is impacting performance and overhead. We actually duplicated a very similar setup in Shuriken where we spawn simple primitives as output and saw significant gains with performance. Can someone please advice why VFX graph would clear the triangles proparly?
     
  2. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    307
    Hi,

    We have two modes for particle rendering:
    • dead particles get culled in vertex shader. This is the behavior you're seeing. This is optimal when particles have few vertices and when the alive count is close to the capacity. This is the default mode.
    • Indirect mode, dead particles are culled in compute shader. This is less sensitive to alive/capacity ratio but adds some overhead. Use this when your alive particles count / capacity ratio is low (and particularly if you use mesh particles with many vertices). This mode is forced when GPU sorting is used.
    You can switch mode in the output inspector.
     
  3. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    Thank you! Switching on Indirect mode reduced both the triangle count and the ms. significantly.
     
  4. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    307
    Cool. Also this may be a sign that your capacity is set too high. You want to always set it to the minimum possible value (ie the maximum possible number of alive particles at the same time) because it has some overhead both in terms of memory and performance. A debug tool to help set the capacity will be available in 2020.1.
     
  5. coskuturhan

    coskuturhan

    Joined:
    Dec 9, 2016
    Posts:
    13
    We cannot really determine the max amount that will be spawned because the particles are being spawned procedurally with user interaction, therefore it's hard to determine the max that will be on screen. But that debug tool sounds really juicy.
     
  6. JulienF_Unity

    JulienF_Unity

    Unity Technologies

    Joined:
    Dec 17, 2015
    Posts:
    307
    Sure. In that case, indirect draw is better!