Search Unity

SRP Batching error?

Discussion in 'High Definition Render Pipeline' started by strongbox3d, Apr 21, 2020.

  1. strongbox3d

    strongbox3d

    Joined:
    May 8, 2012
    Posts:
    860
    Hello guys,

    I am trying to use SRP batching in my project so I have around 300 prefabs of the same mesh with the same material (the material has the Instancing checked in the advance tab) HDRP/Lit type. This prefab is a minnow simple mesh which I have in a school moving around.

    When I run the frame debugger it gives me this explanation:

    Why this draw call can't be batched with the previous one
    SRP: First call from ScriptableRenderLoopJob

    And in the statistics window it says:

    Batches: 3530 Saved by batching: - 2867

    I thought that the idea is to have less Batches and a positive number in the saved by batching.

    Could someone help me to understand what this means and how to fix it?

    Regards,
    Carlos
     
  2. Callumnibus

    Callumnibus

    Joined:
    Jul 23, 2015
    Posts:
    4
    Bump, also need answer to this
     
  3. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
    Statistic window works pretty bad with SRP right now. I would recommend you to look ar Frame analyzer or use RenderDoc to see real results.
     
  4. Camarent

    Camarent

    Joined:
    Feb 19, 2014
    Posts:
    168
  5. Brother_77

    Brother_77

    Joined:
    Feb 8, 2019
    Posts:
    233
    @Camarent Would the suggested script solve the "SRP: First call from ScriptableRenderLoopJob." as the person who asked the Q stated ? I have hit a similar wall it seems

    I am on Unity 2020.3 because all versions before it has the URP Stats window broken regarding batching (It is not updating and also showing negative values in saved by batching)

    But still I am struggling to understand what is wrong because it seems the batching does not work. A simple test scene with cubes marked as static and some moving cubes. Both groups sharing their own material and saved by batching is still 0.

    And when I check the Frame Debugger the draw calls are same as the quantity of these simple cube primitives.

    "SRP: First call from ScriptableRenderLoopJob." The reason for not batching, but after googling I can not find anything.

    This rabbit hole is driving me crazy
     
  6. alejandrorak2

    alejandrorak2

    Joined:
    Jun 29, 2019
    Posts:
    4
    Bumping this, version 2021.2.10, getting the same error as Brother_77