Search Unity

Particle System Dynamic Batching and LineRenderer NativeCollections support

Discussion in 'General Graphics' started by Lynxed, Jul 9, 2020.

  1. Lynxed

    Lynxed

    Joined:
    Dec 9, 2012
    Posts:
    121
    I have 2 questions.

    1. About Particle System dynamic batching. Would it be faster to use multiple copies of the same PS (game characters smoke for example) and let unity dynamic batch them, or should i make a global emission system and emit all of them with one particle system? The question is, does it cull out of frustum particle systems? Will i save perf just letting it do it's thing, or should i play genius and try batch them manually?

    2. Any plans to move LineRenderer stuff to jobs\burst version too?
    I would love to be able to Get\SetPositions with NativeArray<float3> or NativeArray<float4> not to copy that to\from managed arrays.

    Thank you!
     
  2. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    1. I don't know, tbh. The second option involves more script code. And Unity can only cull all-or-nothing, as it's just one system. So you get more overhead building and rendering offscreen particles. There is no per-particle frustum culling. Just per-system. But on the plus side, its only one GameObject, so it puts less pressure on the parts of Unity that look at all GameObjects (eg culling and render loops). Can only really know by profiling.

    2. No plans - it already runs in native C++, which should have similar performance to the equivalent Burst-compiled script code. However, getting/setting positions via a NativeArray would be a nice addition. I'll raise it internally :)
     
    Lynxed and karl_jones like this.