Search Unity

[Unity 5.3] Static batching not batch draw calls

Discussion in 'General Graphics' started by MinhDao, Dec 8, 2015.

  1. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    I have been able to get the particle system to batch on unity 5.3.5 by adjusting the render layers and particle system order numbers. This is on PC set to IOS. But when deploying to IOS the particles are not batched.

    I say I have batching working because in the Editor looking at the Frame Debugger it shows 72 and I can see lots of particles being drawn all together as i step through. Where before it was showing many more.
    But I also see in the profiler the Draw Calls: being 207.

    From reading this thread I thought maybe those numbers were reversed since the Total Batches seems much closer to what the frame debugger is showing.

    But when I am on the phone I am seeing the 200 draw calls that the profiler is saying. So maybe it is correct after all.
    I also did a frame capture and i see each particle being drawn separately. (Iphone 6s+, metal)

    So which is not telling the truth? Is the frame debugger not really show draw calls? But some other metric?
    If its not, which is what it seems like now, then I would say the particle system batching is not working.
     

    Attached Files:

  2. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    @karl.jones
    I checked the frame debugger, each Static Batch contains 3k~14k vertices per batch (there are some small object in scene also), the largest mesh in the scene has 7k vertices, still, I can see some(not all) of the static batch can batch 2 of this largest mesh together(result a 14k vertices batch) in the frame debugger.
    static batch.jpg
    But still I expect each batch can contain more vertices(close to 60000) , did I do something wrong, should I upload a minimal repro?
    thankyou!
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Yeah make a bug report. Its hard to say without seeing the project.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Create a bug report and we will take a look.
     
  5. colin299

    colin299

    Joined:
    Sep 2, 2013
    Posts:
    181
    (Case 810600) Static batching is batching way less vertices than the mesh vertex limit per batch(around 3k~14k per batch, expect 50k

    The models are saved by script, not .fbx import.
     
    karl_jones likes this.
  6. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    412
    (Case 810611) Particle Batching and Profiling Numbers
     
    karl_jones likes this.
  7. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    This thread somehow became about dynamic batching on the way but :

    What is the deal with Static batching being so unreliable? Upgrading from 4 to 5, results in many more draw calls, because some objects just refuse to batch. It used to be pretty reliable in 4, not sure what changed.

    Are there any new requirements for static batching to work properly that I'm unaware of?
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792