Search Unity

Spot Light Weirdness

Discussion in 'Global Illumination' started by EternalAmbiguity, Dec 15, 2020.

  1. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    I'm generating 85 spot lights in a scene at runtime. Certain groups of them can be switched on or off. When I move around, something weird happens with the direct and ambient lighting. The first image shows how things look normally:
    Unity_2020-12-15_14-30-01.png
    If I move up a bit, the whole scene starts looking like it's illuminated elsewhere, and in addition the previous light seems to disappear:
    Unity_2020-12-15_14-30-07.png
    As I move things are getting brighter:
    Unity_2020-12-15_14-30-14.png
    Eventually I reach a place where all of the light seems ambient:
    Unity_2020-12-15_14-30-25.png

    I've tried messing with the general "lighting settings" (the separate tab) but every variation shows this same behavior. Lowering the lights' spot angle or range seems to resolve it, but it winds up at unreasonably small levels:
    Unity_2020-12-15_15-22-15.png

    Any tips on how to avoid this?
     
  2. uy3d

    uy3d

    Unity Technologies

    Joined:
    Aug 16, 2016
    Posts:
    187
    You can use the render mode to force per pixel lighting. Important lights are sampled per pixel, whereas auto tries to find a good balance between per pixel lights, vertex lights and lights baked into SH. There's also the setting in the quality tab about per pixel lights. This page https://docs.unity3d.com/2020.2/Documentation/Manual/RenderTech-ForwardRendering.html provides a bit more information about how unity handles many lights.
     
    EternalAmbiguity likes this.
  3. EternalAmbiguity

    EternalAmbiguity

    Joined:
    Dec 27, 2014
    Posts:
    3,144
    That resolved the issue. Many thanks.
     
    Pema-Malling likes this.