Search Unity

Question Is there a maximum number of light you can create in a Project?

Discussion in 'Global Illumination' started by PenProd, Feb 26, 2023.

  1. PenProd

    PenProd

    Joined:
    Dec 17, 2022
    Posts:
    171
    So far my project has 3 scenes. Each scene has lights:

    Scene 1: 5 lights total - 3 Baked, 2 Mixed
    Scene 2: 55 lights total - 25 Baked, 10 Mixed, 20 Realtime
    Scene 3: 10 light total - 10 Baked

    I'm currently working on scene 3 (scene 1 and 2 are unloaded). Problem is, when I try to add another (Baked) light, an existing one disappears (it doesn't actually disappear, it simply stops emitting light).

    So have I reached some kind of limit? It's not a scene limit since scene 2 has waaay more lights than this scene...
     
  2. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    So - im no light expert, but i have encountered some similiar issues - and what i discovered through questions and answers , forums etc, is that there actually is indeed a max amount of lights that can affect areas at a time. There is a bunch of lighting debug utilities, and tools that can help you visualize this, unfortunately, as i said, im no lighting expert, and i dont even remember the tools names etc atm.

    But in short, yes, there is limits, not so much to how many lights you can have, but more so , to how many affect any one given area at a time. (You can see these grids / nodes easily with the debug tools on). Perhaps look into that as a start. GL
     
  3. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    769
    Hi, will this still happen if opening one scene only? (not load & unload)

    Yes, there're real-time lights limitations. (mixed lights are considered as real-time & baked lights)

    Built-in RP:
    • Forward: default is 4 additional lights per object, but can increase in project settings -> quality
    • Deferred: seems to have no limitation
    URP:
    • Forward: 0 - 8 additional lights per object.
    • Forward+: no limitation per object, but 256 (Desktop), 32 (Mobile), 16 (GL ES 3.0) per camera
    • Deferred: seems to have no limitation
    HDRP:
    • You can set the maximum lights allowed per screen in HDRP settings
    • Decrease the light ranges to have more lights in one tile
     
    Pema-Malling likes this.