Search Unity

[SOLVED] Particle Systems with the same material not being batched

Discussion in 'General Graphics' started by C-Gabriel, Dec 24, 2018.

  1. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    I've noticed that Particle Systems that share the same material are not batched on the device, but they seem to be batched in the editor. I have dynamic batching on. Is this intended, or is it a bug? Or maybe I'm doing something wrong...

    Unity 2018.3.0f2
    tested on iPhone 7 using XCode + GPU frame debugger
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281
    They should be batched. One of the most common reasons is

    https://docs.unity3d.com/Manual/DrawCallBatching.html
     
    C-Gabriel likes this.
  3. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    if it's a rendering issue, why do they get batched in the editor, but not on the device?

    I've tried various things but still failed to make it work
    this is my case:

    I have 1 prefab with 2 different particle systems (different materials as well) [layer X]
    - glow fx is closer to the camera
    - shadow cookie fx is in the back (lower render queue in the shader as well)

    6 instances of that prefab are created at the beginning and then rendered into a small render texture (with no depth) by a camera that only renders layer X

    expected result: 2 draw calls
    the actual result: 12 draw calls
    Screen Shot 2018-12-26 at 18.51.34.png
     
  4. richardkettlewell

    richardkettlewell

    Unity Technologies

    Joined:
    Sep 9, 2015
    Posts:
    2,285
    C-Gabriel likes this.
  5. C-Gabriel

    C-Gabriel

    Joined:
    Jan 27, 2016
    Posts:
    119
    hey Richard, Karl gave me the same link previously, but I somehow managed to miss this line
    Now it makes more sense.
    I was not expecting you guys to be so responsive, especially these days so thank you!
     
    karl_jones and richardkettlewell like this.