Search Unity

Low performance using URP Light2D

Discussion in 'Universal Render Pipeline' started by Adam_Weesner, May 11, 2021.

  1. Adam_Weesner

    Adam_Weesner

    Joined:
    Aug 6, 2020
    Posts:
    18
    I'm working on a 2D project using the Universal Render Pipeline. However, I'm suffering from some low performance on various platforms. Looking at the profiler, it appears that rendering the lighting takes an excessive amount of time. We're using the "UnityEngine.Experimental.Rendering.Universal.Light2D" or URP Light2D, not actual Unity 3D lights. Furthermore, 6 or 7 lights are only active at once. On mid-range PC's and consoles, our frames are dropping down to 30 FPS or lower, depending on how many lights we allow in our URP asset (additional lights > per object limit = 4).

    I don't completely grasp how the experimental 2D lighting is working and affecting performance to such an extent.

    I've attached several images of our profile/frame results and how our lighting is setup. If you need any further information, let me know.

    Cheers.
     

    Attached Files:

  2. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Hi,

    Happy to help.. let's start with this: What version of unity and URP are you working with?
     
  3. Adam_Weesner

    Adam_Weesner

    Joined:
    Aug 6, 2020
    Posts:
    18
    I'm using Unity 2020.1.17f1 and URP version 8.3.1.
     
  4. ColossalPaul

    ColossalPaul

    Unity Technologies

    Joined:
    May 1, 2013
    Posts:
    174
    Hi,

    Are you planning to update to URP 11 on 2021.1 ? We have done a lot of work to improve performance.

    The main area we optimized was to minimize how many light textures we have to render every frame...
    We did this by detecting which sorting layers has the same set of lights (resulting in the same light texture) and we reuse the light texture instead of re-rendering it.

    This amongst other things has given a major speed boost...
    We don't have any plans to back port this to older versions of URP due to the complexity of it.

    If you do manage to give this a try, do let us know if it runs better...