Search Unity

Question about statistics window and batching

Discussion in 'General Graphics' started by steve7987, Dec 11, 2019.

  1. steve7987

    steve7987

    Joined:
    Aug 28, 2019
    Posts:
    7
    I'm looking at the statistics window and a bit confused about batches and saved by batching. If I have 536 batches and -532 saved by batching, does that mean I had 1068 draw calls and 532 were saved by batching or 536 draws and 532 were saved by batching. For reference, I've posted my stats below. I'm mainly wondering as I have an arrow object that appears a lot, and I want to make sure its correctly being batched (only has 70 vertices). Thanks.

    Screen Shot 2019-12-11 at 5.14.54 PM.png
     
  2. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    100
  3. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    100
    Do note that this number will not be correct if the SRP batcher is being used.
     
  4. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    srp_batching_stat.jpg
    Does this mean there aren't necessarily 34 (the 300-266)? I'm using URP 10.0.0-preview.8.
     
  5. educa

    educa

    Joined:
    Mar 3, 2015
    Posts:
    14
    I actually wonder too. I have a scene with 5 objects which are all sharing the same URP material. The scene has 5 lights which are all nicely baked and then I disable the lights. I have static batching active in the player settings , but still I see 5 batches (which should realy only be 1 I guess) and 1 setpass call.

    Is this really how it should work ? I guessed that this should all render in 1 batch and 4 saved by batching?
    What do you mean by ... this number will not be correct if SRP is used ? I use URP which is scripted of course.

    I hope somebody can shed a light (get the joke?) on this.
     

    Attached Files:

  6. hjohnsen

    hjohnsen

    Joined:
    Feb 4, 2018
    Posts:
    67
    Batch:5 means you have 5 renderers in URP, the real number of batches can be seen in the Frame Debugger.
     
  7. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    The stats window is buggy in unity versions before 2020.3 when using URP.

    After switching it fixed the negative saved by batching but now it does not save batches. It stays on 0 and frame debugger is drawing the same amount of draw calls as the static objects that share the material.

    Reason :

    SRP: First call from ScriptableRenderLoopJob.


    Please someone HELP, please help :(


     
  8. Steven-1

    Steven-1

    Joined:
    Sep 11, 2010
    Posts:
    471
    I have both static and dynamic batching disabled as they never help even one bit but instead only reduce performance and increase memory, yet the statistics window still shows 5000+ batches. Why is that? Is that just the draw calls?
    "Saved by batching" varies between 0, 1 and 2.