Game Development Asked by Majs on November 12, 2021
Im trying to understand the SRP batcher. I have a scene with 300 fairly low-poly models.
These are my rendering stats with SRP Batcher:
And this is without SRP Batcher:
Some observations (This is all with dynamic batching enabled, models share a GPU instanced material):
I cannot really make sense of this. I see no noticable effect on the FPS. I have no idea which is actually better for performance. The stats above make no real sense to me, seems strange that enabling SRP batcher removes all batched calls… Can someone help me understand which is better and when to use what?
Everything is tested on latest unity and URP versions.
What you need to understand regarding the SRP Batcher is, that it is not batching your draw calls like the static or dynamic batching system. Instead, it reduces the overhead of each draw call by making part or all of the material data persistent in the GPU memory. That way, the CPU doesn't need to set up and upload the buffer to the GPU each time, effectively reducing bandwidth and time to render a drawcall.
This blogpost explains it in greater detail:
Don't forget, that GPU instancing won't work if the SRP Batcher is enabled.
And as explained in another answer here, it's more important that your meshed share the same shader rather than the same material. Traditional batching only works with the same material.
Answered by Acimaz on November 12, 2021
Maybe this link could help: https://catlikecoding.com/unity/tutorials/basics/measuring-performance/
The idea on Unity is to use SRP Batcher for URP instead of GPU Instancing. The idea is: if you use URP shader compatible, it will batch directly, you only need to share the shader. You can use different meshes, different materials, etc. But if they share the same shader and keywords, they will batch.
Answered by Marc Alloza Ayxendri on November 12, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP