Search Unity

GameObject GPU Instantiating and Particle GPU Instantiating

Discussion in 'General Graphics' started by DuvE, Feb 11, 2019.

  1. DuvE

    DuvE

    Joined:
    May 22, 2016
    Posts:
    169
    Hi,

    I have a question about GPU instantiating. I've tested 10k Sphere Mesh GameObjects with Standart material with GPU instantiating enabled and 10k Sphere Mesh Particles With Particles/Standart Surface material and GPU instantiating (you need to turn it on in a Particle System instead of a material) enabled. And the difference in FPS was dramatic. GPU Particles was a lot faster than GPU GameObjects. I've checked frame Debugger and Profiler, but I still don't understand why the difference is so big.

    I've turned off shadows and Light Probes for GameObjects but this didn't affect the FPS much. So my questions are - what exactly the reason for this big FPS difference? Is it possible to get close to GPU Particle performance using GameObjects?

    PS: I want to create custom Grass and paint it on Meshes, I could use custom shaders with modification for Particle GPU Instantiating (https://docs.unity3d.com/Manual/PartSysInstancing.html), but you can't really paint with particles in the editor and use it for level design. So I need to somehow makes GPU GameObjects be cheaper on performance.
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
  3. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Shame you can’t find a solution with particles. Ought to be faster than DrawMeshInstanced.

    Worth profiling a test case first tho to prove/disprove my speculation :)
     
    Last edited: Feb 11, 2019
  4. tylo

    tylo

    Joined:
    Dec 7, 2009
    Posts:
    154
    I'm a bit confused by your reply. Are you saying if he could figure out a way to paint grass in his level design workflow, using the particle system would be faster than using DrawMeshInstanced?
     
  5. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Technically, I don't see a reason why it should be slower. Maybe less robust and flexible as a solution.
     
  6. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    Yes exactly. I think particles would be faster than DrawMeshInstanced. But I haven't tested this myself, so please profile an example of both, to be sure :) I'd be interested to hear your results!
     
  7. tylo

    tylo

    Joined:
    Dec 7, 2009
    Posts:
    154
    It seems unusual to use the particle system to "emit grass" which stays in a set of specific locations (and in the case of grass, they would be "snapped to the terrain geometry") without disappearing/appearing as I am used to particle systems being used for.

    But, I don't personally have a lot of experience using the particle systems past or present.