Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

LWRP is driving me mad!

Discussion in 'Universal Render Pipeline' started by WinterboltGames, Nov 25, 2019.

  1. WinterboltGames

    WinterboltGames

    Joined:
    Jul 27, 2016
    Posts:
    259
    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.
     
  2. phil_lira

    phil_lira

    Unity Technologies

    Joined:
    Dec 17, 2014
    Posts:
    584
    It's expected that when having the SRP batcher ON there will be better performance if you CPU bound, even if you have more drawcalls. You can think as the SRP batcher as reducing the cost of drawcalls.
    Could you submit a bug report for the status window not working with SRP batcher.
    Workaround for you is to use the Frame Debugger.
     
    Dragnipurake97 and ROBYER1 like this.