Search Unity

"SRP Batcher" in 2018.2

Discussion in 'Graphics Experimental Previews' started by PhilSA, Apr 18, 2018.

  1. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    38
    SRP Batcher enabled in edit mode is in 2019.1. Sorry 2018.3 didn't have that feature, and you have to click PLAY as you described.
     
    esc_marcin likes this.
  2. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    1,694
    I'm just getting around to realizing that the SRP batcher exists, and so far simply enabling it has seem framerates jump from around 60fps to around 75fps in my project in the editor. However, in a build, there doesn't seem to be any improvement when enabling this. Is there anything I can do to dig into this further?

    Also, when using SRP batching, should/must I disable the Static and Dynamic batching options in Player settings? What if all three are enabled?
     
  3. Tartiflette

    Tartiflette

    Joined:
    Apr 10, 2015
    Posts:
    41
    If it doesn't change anything in the build it probably means you are only CPU-limited in the editor (which is fine). I think dynamic batching is generally considered to be a bit 'meh' or oven counter productive, but static batching is fine and can be used with SRP batching.
     
    dgoyette likes this.
  4. arnaud-carre

    arnaud-carre

    Unity Technologies

    Joined:
    Jun 23, 2016
    Posts:
    38
    You are probably using graphics jobs in your standalone player, so rendering part is not the CPU bottleneck. Graphics jobs are not running in editor, that's why you probably see a speedup in editor. The speedup is really there in standalone, but does not impact global framerate because rendering is not CPU bottleneck in your scene. ( you may find details in that blog post https://blogs.unity3d.com/2019/02/28/srp-batcher-speed-up-your-rendering/ )

    Dynamic batching is automatically disabled for all object going to SRP Batcher code path. Static batching is still effective. ( you should always keep static batching option, can't make things run slower so keep it)
     
    dgoyette likes this.
  5. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    679
    Hi arnaud-carre

    1) On SRP Batching does Unity send the same textures in 2 different materials twice in the same frame?
    2) And does unity generally transfer all textures meshes and materials in one frame to the gpu?

    + And also interesting is the project from the first video. SRP Batcher Benchmark. Would it possible to share this small one please? I'm interesting how many objects and what texture size is used in this case. I think other uses found this small project useful as well.
     
    Last edited: Apr 25, 2019
  6. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    115
    Does SRP batcher work with meshes referenced from .asset files (This is how Houdini stores it's baked meshes)? It seems to work fine for me in editor but in builds those objects don't render. If I disable SRP batcher then those objects render in builds correctly.
     
  7. Peter77

    Peter77

    Joined:
    Jun 12, 2013
    Posts:
    3,592
    This sounds like a bug.

    Please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  8. Fran0212

    Fran0212

    Joined:
    Oct 22, 2014
    Posts:
    1
    Hi arnaud-carre
    SRP Batcher is very awesome, but I have some question about sprite renderer

    1. What is the reason for SpriteRenderer not supporting by SRPBatcher? (is it because SpriteRenderer uses MaterialPropertyBlock?)
    2. Will SRP batcher support SpriteRenderer in the future?
     
    Terean and msorokinmycom like this.
  9. teutonicus

    teutonicus

    Joined:
    Jul 4, 2012
    Posts:
    34
    I've got issues with missing meshes in builds too. Haven't had a chance to figure out what the issue is or file a bug report but IIRC a lot of them are just regular old .fbx instances/variants existing in the scene and not necessarily referenced in another .asset file. Have to disable SRP batcher for now.
     
  10. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,008
    Are those meshes bigger than 65k vertices? I discovered today that 2019.2.0a14 at least doesn't render my high poly mesh on standalone again, at least not on development build. There used to be a bug for this that was fixed and it does work now on editor but wondering if it has somehow creeped back in to standalone player as it does only affect the highpoly mesh on my build (yet again).
     
  11. eizenhorn

    eizenhorn

    Joined:
    Oct 17, 2016
    Posts:
    1,278
    Did you set Index Format to 32bit? (4 billion verticies limit instead of 65535 for 16bit)
     
  12. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,008
    Actually I double checked and it's was on 16bit mode when it failed. This is a large mesh, it gets split into 3 chunks with 16 bit setting. There used to be an issue with 32bit indexing with multiple materials in past for bigger meshes but that was fixed.

    I remembered I had returned the mesh to 32 bit index format so I assumed it was the same old bug returning, but it's indeed now using 16 bit indices and it still doesn't show the mesh in standalone (it still has multiple materials so maybe that's still related to the issue). I will investigate this more next week if it's still relevant then.
     
  13. bitinn

    bitinn

    Joined:
    Aug 20, 2016
    Posts:
    520
    The old method for toggling SRP batcher for 2018.3, aka "GraphicsSettings.useScriptableRenderPipelineBatching", no longer works in 2019.1, only LWRP asset seems to be able to control it.

    Not sure if it's a bug or not.
     
  14. rizu

    rizu

    Joined:
    Oct 8, 2013
    Posts:
    1,008
    I finally did some simple repro for my recent SRP Batcher issue. It happens on some meshes, for example all test meshes I've exported from Modo fail but batcher still keeps working on default Unity cube.

    So to make this more clear: SRP Batcher works in editor but fails on standalone but only for some meshes (haven't found a pattern yet).

    I tried both 2019.2 with HDRP 6.5+ and 2019.1 with HDRP 5.13 combos. 2019.1 + HDRP 5.13 is fine, it works as it should in standalone, only 2019.2 + HDRP 6.5+ fails there. I forgot to try 2019.2 + HDRP 5.13 combo though.

    Case ID 1153573.
     
    Peter77 likes this.
  15. chanon81

    chanon81

    Joined:
    Oct 6, 2015
    Posts:
    76
    Hello, I just learned about SRP Batcher. I see that 2019.2b Beta release notes says that

    My question is ... so does 2019.1 have any support for SRP Batcher for mobile? Or is it only 2019.2b that can support it?

    Also is the LWRP and SRP Batcher beneficial for 2D games?
     
  16. RegdayNull

    RegdayNull

    Joined:
    Sep 28, 2015
    Posts:
    11
    SRP Batcher does not support SpriteRenderer? Shader has marker "SRP batcher compatible", but in sprites in Frame Debugger has "SRP: Node is not compatible with SRP batcher". I've seen the previous question, but there is no answer. Standard batching is disabled in RP and in shader, and enabling it does not change anything btw.