Why are the two sets of batches in the attached images not batched into a single SRP Batch? Right now I’m seeing about 80+ SRP Batches in Render Opaques → RenderLoopNewBatcher.Draw.
In fact I have a lot of SRP Batches that aren’t batching at all, or are batching just a few, when I expect dozens of batches in them - all things (that I can see) being equal.
To draw a frame, unity combine all objects in to buckets and send them to GPU. By default, in URP, unity combine objects not only by material, but by distance too(and few other criteria). I.e. if you have a bunch of barrels far away, and bunch of barrels in front of you it’s became 2 draw calls. If you use default URP nothing you can do with it. If you use URP fork or custom SPR - you can just exclude SortingCriteria.QuantizedFrontToBack from your sorting settings.
I have a feeling it’s due to distance, but it seems inconsistent. There are objects over 100 units apart that are being batched, and then objects from the same prefabs within those 100 units that end up in a different batch. I just don’t get it.
How would one go about forking URP to make a custom one, is the source available somewhere? A custom SRP would be pretty unfamiliar territory for me.
I tried this out. Unfortunately, it seems to have had the opposite affect. The number of RenderLoopNewBatcher.Draw instances went from 89 to 97. Additionally, the visuals became somewhat “broken”.