Looking for some help / pointers as to where I am going wrong please.
I noticed in my project that despite having everything setup so Static Batching should occur, during runtime, the “saved by batching” count remained at 0. I created a blank new project to test this and I am still struggling to get static batching to behave with URP so guessing I am not understanding something correctly.
Quick Summary of test project.
Setup → New URP Template project. Static Batching is enabled in settings and several cubes have been duplicated in a new scene to show batches & saved by batching. All cubes are set as static (so batching static is ticked for all) and have a basic URP Lit material.
When I run the scene, it shows several batches but “saved by batching” remains stubbornly at 0.
If I edit the settings in the URP Asset and disable SRP Batcher (most of what I have read says don’t do this unless you are looking to use GPU Instancing), during runtime “saved by batching” kicks in and does what I expect (all the static marked objects that can be batched appear to be).
I have created a similar project without URP and “saved by batching” works as I expect so I fear I am doing something wrong with the introduction of URP?
I have attached some screenshots to try and help explain my ramblings
Initial setup: SRP Batcher Enabled, Cubes are Static and have basic lit URP materials. When I run the scene I get 212 Batches with 0 Saved. See grabs from the Stats window and the Profiler.
If It turn off SRP Batcher (in the URP Asset settings) and rerun the scene, I now get 8 Batches with 369 Saved. See grabs from Stats and profiler.
I think I have answered my own question after further experimentation with a basic project. If I turned all of the cubes to non-static, the number of Batches goes up drastically (as you would expect). It appears that SRP and URP are playing nicely together but something is wrong with the way it reports the number of “Saved by Batching” in the stats window.
Thanks for the replies. Handy to know as I am currently using 2020.3 (LTS). Will create a separate project and see what it believes is occurring in 2021.2. Many thanks.