Search Unity

Lightweight pipeline performance expectations

Discussion in '2018.1 Beta' started by Claytonious, Feb 2, 2018.

  1. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    591
    If we are already using only a single directional light and mobile shaders under forward rendering, should we expect any performance benefit from switching to the lightweight pipeline, generally speaking? I know every project is its own beast; I'm just asking about broad generalities here.

    Thanks!
     
  2. Tim-C

    Tim-C

    Unity Technologies

    Joined:
    Feb 6, 2010
    Posts:
    2,093
    Shadows or no shadows?

    In this case I would guess there would be some performance increase on the CPU side (the srp path is cleaner), on the GPU side my guess would be 'about the same' as in both cases it would be one pass with one directional light.
     
  3. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,926
  4. Fuzzy

    Fuzzy

    Joined:
    Feb 11, 2011
    Posts:
    266
    Tried shifting an early Android mobile game proto to lightweight SRP today.
    Tested on a Nexus 5. This had further implications: No Open GL ES 3 and so no Linear Color space.
    No shadows, 1 Mixed Directional Light, 1 Realtime Point Light (limited to one culling-layer).
    Postprocessing: Bloom & Color Grading
    2018.1 b5

    First: Vanilla Unity Screenshot from device


    I'm using:
    Screen.SetResolution(Screen.width / 2, Screen.height / 2, true);
    to lower the rendering resolution.
    Also VSync usually set to every 2nd V Blank (but for sake of noticing performance difference in this image it has been set to Every V Blank)

    Now for Lightweight SRP @ 0.1.28 (Note: I didn't adjust lighting):


    Things I noticed:
    -Lighting looks a quite off, but it was mentioned that after switching the rendering pipeline it would need to be re-adjusted.
    -Tree leaves aren't transparent (Even though they're using LightWeightPipeline Standard(Physically Based) - Metallic / Cutout) and work just fine in the editor.
    -Particles in the editor with Lightweight Particle Shaders seem to color wrong, black. But when run on the device they render correctly.
    -Green PointLight at the green marker under enemies doesn't render on Lightweight Terrain Shader.
    -Terrain Shader renders Pink after Terrains "Base Map Dist." (But LW Terrain Shader is noted as WIP)
    -Generally somewhat Lower FPS, though LW and Vanilla jump a little, but on average it's a little lower.
    -Using the mentioned: Screen.SetResolution to halve the screen resoltion brings in WAY more performance than using the Lightweight Assets' "Render Scale" @ 0.5. That gave me around ~22FPS, compared to the ~50FPS with Screen.SetResolution.
    -Text Mesh Pro did not render, might be incompatibility with their shaders.


    So I'm not sure If it's really worth it quite yet if you're using vanilla carefully.
    That is at least my experience with it for today, after finally getting it to work at all. :p
     
    Last edited: Feb 2, 2018
  5. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    591
    Enormously helpful of you to share those findings - thanks! It's clearly early days for SRP but this is great to have some visibility into where things stand at this moment.
     
  6. interpol_kun

    interpol_kun

    Joined:
    Jul 28, 2016
    Posts:
    86
    That's quite a bad news. Hope the FPS and graphics problems are on your side.
     
  7. Claytonious

    Claytonious

    Joined:
    Feb 16, 2009
    Posts:
    591
    Not necessarily, We all have a lot to learn about how to properly tune the new pipeline. @Fuzzy was very clear that this is just a straight-up run of what he already had in place without any attempt to retune for the new pipeline yet. We'll see how it goes. It is, however, still very interesting.
     
  8. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    577
    @Fuzzy You most likely got that low FPS with LW pipe because Vsync is on. For some reason, Vsync drops the performance a lot and doesn't seem to lock it as it should.
     
  9. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    74
    Cool. We're interested. When you say vanilla do you meant forward rendering?

    Also are you using your own custom shaders or legacy?

    Perhaps it would be useful to test without post-processing as well.

    Thanks this is good work. +1 for testing on an Android device.
     
  10. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    74
    BTW

    Still wondering why there is no real official unity mobile shaders for forward but I haven't been keeping up with this latest stuff.

    Please don't ask me to use standard shader. Yes we can/do code our own. However a standard supported set as a baseline is needed. ie one for diffuse, one for reflection Much like legacy did. Mobile usually can't handle all effects in one shader.

    Is the right answer throwing another toolkit at mobile devs and asking them to sort it out. Perhaps the Unity staff could publish their test results??

    This work by Amir shows test stats. So it does happen.
    https://blogs.unity3d.com/2018/01/1...ting-with-automatic-performance-improvements/
     
  11. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    699
    The standard shader is not really one shader. The issue with it is not its ubershaderness, rather the lighting model and implementation not being suitable for low-end mobile at the moment. They could provide the sort of performance as the original legacy shaders and still have it as a Standard-LowEnd or something.
     
    Anjin_nz likes this.
  12. Anjin_nz

    Anjin_nz

    Joined:
    Jun 24, 2014
    Posts:
    74
    Thanks Alkis for your reply. Thats helpful.

    By this do you mean the gamma vs linear color space or more the linear calculations for the lights themselves? I have read SebLegards blog but its quite intense :)

    I would still prefer split out capability shaders like legacy (its easier to examine the source and understand the effect) but yes a Standard low end (linear?) which works nicely might be okay as well. I still remember the disappointment of seeing so much rim shading and knowing it would never be useable (due to gamma space is my theory).

    I do like PBR materials. They look great and I understand why its such a thing. I have seen some people do PBR-like effects with Blender in Material nodes.

    I would suggest that we still need something which is gamma based and another set for linear. My understanding is that linear is fundamental for PBR? I also heard that Unity can support linear on mobile in GLES 3?
     
  13. Prodigga

    Prodigga

    Joined:
    Apr 13, 2011
    Posts:
    793
    I am very disappointed to read about the lack of frame rate improvement using RenderScale. It seemed like the perfect solution - Sharp UI for that premium look and at the same time lower resolution 3d for performance.

    Sucks that it didn't provide much of an improvement. I wonder why.

    My gains for disappointingly similar when I rendered the game camera to a lower resolution render texture and blitted that to the screen at full resolution so I could maintain crisp UI. I wonder if this is all that's happening under the hood?
     
  14. Dhialub

    Dhialub

    Joined:
    Nov 11, 2013
    Posts:
    41
    Lowering the resolution if you are not fillrate bound brings no improvements. It definitely helps on my side, even if decreasing the resolution by 10%