Search Unity

Vertex point lights going out when looking away and out of range

Discussion in 'Global Illumination' started by OhiraKyou, Aug 6, 2018.

  1. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Unity (2017.4.2f2) lumps vertex lighting into the "not important" render mode option, lacking a distinction between important and unimportant vertex lights. So, as I specifically wanted some dynamic vertex point lights, I set their render modes to not important.

    This mostly works, but there's one significant issue: the lights tend to go out when the camera is looking away and out of range. I've searched for a solution a few times and have yet to find one.

    Example:


    The offending light, with the camera just out of range (with the light affecting the wall only because it is the editor's scene view camera that is currently in use):


    I've confirmed that this occurs even when the only active lights are a single directional light and a single vertex (not important) point light. And, this still occurs when the surface receiving the light is using the default material. All lighting is realtime; baked GI is disabled.

    Any suggestions as to how I might be able to prevent vertex lights from going out?
     
  2. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Still looking for a solution for vertex point lights that don't go out.
     
  3. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hey OhiraKyou,

    This seems a bug to me, further more i can't repro from a quick test. Could you open a bug report please?
     
  4. OhiraKyou

    OhiraKyou

    Joined:
    Mar 27, 2012
    Posts:
    259
    Just submitted the report. For completion's sake, I've also attached the example project I included in the report to this post. Simply open the example scene and move the camera back and forth along the z axis to see the light suddenly appear and disappear.

    To make it super obvious, I set the point light's intensity to 720. In pixel mode ("Important"), the light doesn't leave its radius. This makes any appearance or disappearance invisible, as I assume was the intent. However, in vertex mode ("Not Important"), it covers the entire sphere below, making the pop-in obvious and jarring.

    I assume this is an optimization, but it just doesn't work properly with vertex lights. So, I'd at least like an option to disable this behavior.
     

    Attached Files:

    Last edited: Oct 2, 2018
  5. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey there! This is a known limitation of the built-in render pipeline. One of the ways to fix it would be to increase the number of pixel lights in the Quality settings.

    HDRP has already remedied this issue by allowing users to adjust the fade distance per-light basis, which offers much more flexibility than what is currently available. LWRP also aims to implement this feature, most likely sometime during Unity 2019 cycle.
     
  6. Hamu_Art

    Hamu_Art

    Joined:
    Apr 24, 2020
    Posts:
    15
    That bug is still with us. I report that 2021.3.1f1 also produces this phenomenon. Moreover, it does not consistently which makes it impossible to find out the logic of the bug. Some vertex light when it is out of the camera but the mesh it illuminates is still in the camera, it tends to turn off the light from the object. I can see now that the light doesn't need to be behind the camera, it's enough to just go out of the camera fustrum.
    Very very annoying bug.