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

Bug URP additional lights limit not working in build, fine in editor.

Discussion in 'Universal Render Pipeline' started by WildStyle69, Nov 18, 2022.

  1. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    My Unity setup:
    • Unity 2021.3.11f1
    • Universal RP 12.1.7
    • Rendering path Deferred
    I have lots of additional lights with no shadows that get enabled at night. This works fine in the editor but not in the build. In the build the lights are culled and flicker on / off like the pixel light limit is being ignored.

    Also tried setting all the lights to important as a test and the same thing happens. Is this a bug or expected behavior?

    See attached image for settings.

    Any assistance much appreciated, thanks!

    upload_2022-11-18_14-22-28.png

    upload_2022-11-18_14-22-40.png
     
  2. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    631
    Hey, I'm not sure what causes this problem.

    But if the build is using OpenGL (including es) graphics api, URP will force the rendering path to forward (in URP 12).

    Is the build using OpenGL? (consider switching to Vulkan)
     
  3. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Thanks for reply - the build is use DirectX11, so unfortunately it cannot be the issue you mentioned.
     
    wwWwwwW1 likes this.
  4. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Did find something interesting today - it's only spot lights that it's happening to, additional point lights are working just fine in the build.
     
  5. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    This is not true actually - it is affecting all real-time lights. Depending which way you turn your head / camera lights turn on / off. No mater the settings same thing happens.
     
  6. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    So I though with URP - Deferred rendering there was no light limit, am I missing something here?

    Is it a bug, can anyone at Unity please comment?

    // Wildstyle
     
  7. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Built and tested the same game / source code on a different computer system (similar spec.) over the weekend... it works just fine, no light flickering, well it's 95% gone... so now I'm really confused!

    If I ever get to the bottom of it, will update this thread with more details.

    // Wildstyle
     
  8. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    317
    Funny thing is that it works great sometimes and other times all the lights are flickering. I mean, how is that even possible? You would think it works or doesn't... not some weird combination of both.

    I had one build where it was 95% perfect, then built again yesterday and it's a $hit-show! Nothing changed between those two builds that would have affected it.

    Basically given up on it for now, but not happy (lost so much productivity time to this issue). Only hope is waiting for Forward+ to drop in XR and hope that the lighting works correctly at that time.

    // Wildstyle
     
    wwWwwwW1 likes this.
  9. BurovAleksei

    BurovAleksei

    Joined:
    Aug 23, 2014
    Posts:
    4
    Hey man!
    Did you resolve your issue?
    I have the same case.
     
  10. BurovAleksei

    BurovAleksei

    Joined:
    Aug 23, 2014
    Posts:
    4
    Thanks friend! You saved my project! :)
    Default setting is Auto - that means DirectX11 - deferred lights don't work on build for Win,
    And they work perfectly on Vulkan!
     
  11. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    631
    That sounds like a bug, maybe you can try upgrading URP (with backup) or send a bug report to Unity?
     
    WildStyle69 likes this.