Hello Everyone,
I have started using LWRP lately for a 3D side-scrolling shooter that uses a very very simplistic art style mainly primitive shapes (mostly cubes), particles, and, a single terrain per scene.
99.99% of the time, the scene has like 30 - 40 animated characters with the following setup each:
-
a mesh filter that has a mesh with (22 verts and 28 tris) and a mesh renderer for the head which casts shadows and has one material.
-
a mesh filter that has a mesh with (22 verts and 28 tris) and a mesh renderer for the body which casts shadows and has one material (the same one used above).
-
2 mesh filters that both have a mesh with (22 verts and 28 tris) and 2 mesh renderers for the arms which cast shadows and both have one material (the same one used above).
-
2 mesh filters that both have a mesh with (22 verts and 28 tris) and 2 mesh renderers for the eyes which cast shadows and have one material (not the same one used above).
-
2 mesh filters that both have a mesh with (22 verts and 28 tris) and 2 mesh renderers for the eyeballs which cast shadows and have one material (not the same one used above).
-
for each character that would exactly be 22 + 22 + (2 * 22) + (2 * 22) + (2 * 22) = 176 verts and 28 + 28 + (2 * 28) + (2 * 28) + (2 * 28) = 224 tris.
-
for each character in terms of materials that would be 1 material for the head, body, and, arms. 1 material for the eyes and 1 material for the eyeballs.
-
for each character, the total number of materials would be 8.
Now, when I have let’s say the maximum number which is 40 characters all on-screen at once (away from the camera by like 8 UU [Unity Units]) that would be:
- 176 * 40 = 7040 verts
- 224 * 40 = 8960 tris.
- 8 * 40 = 320 materials.
With the terrain active and with a heightmap resolution of 33.
- 2000 tris and 1200 verts.
— WITH THE SRP BATCHER ON —
The stats panel shows that I have 814 batches, -809 saved by batching, 11 set pass calls, 4100 tris, and 2300 verts.
— WITH THE SRP BATCHER OFF —
The stats panel shows that I have 303 batches, -524 saved by batching, 31 set pass calls, 32900 tris, and 28100 verts.
########################################
What drives me mad is that when the SRP Batcher is ON when I try to run the game on a Nokia 3.1 Plus it runs at a solid 60 fps and never EVER goes down a single frame but when the SRP Batcher is OFF it fluctuates between 20 - 40 fps.
So, is this’s some kind of issue with the stats panel or is it an issue with the SRP Batcher itself?
I’m using LWRP 6.9.2 with OpenGL 2.0 in Unity 2019.2.13f1
PC Specs:
- Windows 10 Professional (latest updates as of today)
- Nvidia GTX 1050 TI (latest drivers as of today)
- AMD Ryzen 3 2200g @ 3.5 GHz
- 8 GB DDR4 @2333 MHz
- Unity is running from an SSD.