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

Question Disabling 2D Lights does not affect performance

Discussion in '2D' started by Adam_Weesner, Jun 12, 2021.

  1. Adam_Weesner

    Adam_Weesner

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

    Because of performance issues with 2D lights, I wrote a script to cull 2d lights if they are a certain distance away from the camera. However, even with all lights disabled, I'm still getting the exact same framerate. If I delete all light gameobjects, only then will the framerate improve substantially.

    I've tried disabling the "Light 2D" component and the game object, but it has no effect. I've experimented by reducing the radius of lights to 0 when they are a certain distance away. Doing that actually does improve performance. However, I'm using different light types (sprites/parametric/point...) so there's no one parameter shared between all types that I've found that effectively disables the lights. Is there an easier way of going about this?

    Cheers.
     
  2. Deleted User

    Deleted User

    Guest

    Maybe you need to upgrade to URP 11 or 12. I didn't notice performance issues with 2D lights in my project; I use URP 12 in 2021.2. Whether I have 1 or 6 2D lights on my scene, the fps remain relatively unchanged.

    With 2 2D spots:

    Capture d’écran_2021-06-12_12-49-17.jpg

    With 6 2D spots:

    Capture d’écran_2021-06-12_12-51-11.jpg
     
  3. Adam_Weesner

    Adam_Weesner

    Joined:
    Aug 6, 2020
    Posts:
    18
    Unfortunately, I cannot upgrade to Unity version 2021.2 at the moment.