Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Flickering/ On/Off Lights when movin URP

Discussion in 'Universal Render Pipeline' started by demegeamontes, Jun 10, 2023.

  1. demegeamontes

    demegeamontes

    Joined:
    Jan 10, 2019
    Posts:
    4
    Hello, I have a Unity project created in URP. I have around 150 spotlights and 2 directional lights simulating the sun and the moon.

    I know it's a lot of lights, but I have a day and night cycle where the lights turn off at a certain time and then turn on again at another time, so using baked lights was complicated.

    I'm using the Forward+ renderer, which theoretically has a limit of 256 lights. I have also tried the Deferred renderer, but I'm experiencing the same issue with both renderers, and I don't know why. I'm using Unity 2022. Here's a video showing it.

    I thought it had something to do with occlusion culling, which would render the lights when they were in front of me, but that wasn't the case. The lights' importance is also set to "Important," but none of this changes the behavior.
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    Is this on windows?
    Did you try dx12 instead of dx11?

    If you are under the limit and it gives issues, make a bug report so it can be fixed.

    After you've done that, some personal tips:

    Use 1 directional light for sun and moon. Just switch it at midnight to start casting moon shadows or something.

    You can still use baked light for the spotlights when using mixed lights. Definitely a lot better than a crazy amount of lights.
     
  3. deftroy

    deftroy

    Joined:
    Mar 25, 2016
    Posts:
    3
    Perhaps you are exceeding the per-object limit of additional lights in the quality settings?
    try turning it up or spearing youre lights apart so that the maximum amount of lights casting on each object in your scene does not exceed the max value in the quality settings
    upload_2023-6-12_16-12-4.png
     
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,362
    This is/should be ignored by forward+ since it doesn't have this limit
     
  5. peterbay

    peterbay

    Unity Technologies

    Joined:
    Nov 2, 2017
    Posts:
    100
    The video you mention is not showing up for me, can you post a link to it? Which platform are you seeing this on?