Search Unity

Light turning off at seemingly random angles

Discussion in 'Global Illumination' started by ThreeCoolWords, Feb 14, 2019.

  1. ThreeCoolWords

    ThreeCoolWords

    Joined:
    Feb 14, 2019
    Posts:
    4
    The light is set to Important for RenderMode and I'm not exceeding the number of important lights I'm allowing in my project settings. It's a child of the player but isn't obstructed based on anything I can see. I've looked at old forum posts and either they went unanswered or had a different problem (like needing to make the light Important). I've attached a couple screenshots and can get any other info you guys need.

    If it's of any help, the player model is the little visible light orb centered in the camera view (yellow in the scene view) and the problem light is a point light above the player model (white in the scene view).

    It's only a slight different in the actual lighting, but when you're playing and it randomly flickers on/off it's extremely distracting to players.
    Light.PNG Dark.PNG
     
  2. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    Hey! Do you by any chance have a flare component attached to your player object/light. If so, that could be one of the reasons why the other point light gets occluded at certain angles. Please disable the flare and retest. You can also setup Ignore Layers in the Light Flare component to prevent this issue from happening.
     
    Mikolaj_Mal and ThreeCoolWords like this.
  3. ThreeCoolWords

    ThreeCoolWords

    Joined:
    Feb 14, 2019
    Posts:
    4
    The player has the two lights attached, neither of which have a flare. And just to cover all the bases, if you meant Flare Layer or Lens Flare, the player has neither of those. The player has two Particle Systems, the Main Camera, and on the root object it has normal player things like a mesh filter and renderer, collider, rigidbody, and a few scripts for controls and particle-related things.

    You mention Ignore Layers and a Light Flare component - could you tell me more about those or perhaps point me to a tutorial?
     
  4. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    If you do not have a flare attached to your light, then Ignore Layers property is not applicable. Do you by any chance have a halo attached to your light? If you do, try disabling it, and see if the issue reproduces.

    Could you also attach couple of screenshots which shows your light setup, preferably your inspector windows for those two problematic lights? Thanks.
     
    ThreeCoolWords likes this.
  5. ThreeCoolWords

    ThreeCoolWords

    Joined:
    Feb 14, 2019
    Posts:
    4
    upload_2019-2-25_23-42-54.png This is the visible light source that the player is (yellow orb in view of camera)
    upload_2019-2-25_23-43-42.png And this is a point light attached to the player to brighten nearby surroundings.

    upload_2019-2-25_23-44-35.png And just in case it's relevant, this is the only other nearby light source. I did some further testing, and it appears as if this may actually be the light that's turning off. The thing I know for sure is that the problem is very sensitive to camera angle. Someone suggested that it may be getting culled by some behind-the-scenes optimization that I just wasn't aware of, so I'm not sure if that raises any flags for you. Thank you again for helping and I apologize for the delay in responding - school schedule is rough lol.
     
  6. fguinier

    fguinier

    Unity Technologies

    Joined:
    Sep 14, 2015
    Posts:
    146
    Hey ThreeCoolWords, Can you open a bug or share the project here so we can have a look?
     
  7. ThreeCoolWords

    ThreeCoolWords

    Joined:
    Feb 14, 2019
    Posts:
    4
    Sure, what would be the recommended way to share the project? (Sorry if that's a silly question, I am quite the novice) I don't believe yet that it's a bug, so that option sounds better
     
  8. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    You can use Unity's in-built bug reporter to do this. Before you report a bug, please try unchecking Draw Halo flag in your player light component (the yellow light), and see if that fixes the issue.
     
  9. Orami

    Orami

    Joined:
    Mar 12, 2015
    Posts:
    20
    I have this same issue did anyone find a solution?
     
  10. GRAS

    GRAS

    Joined:
    Nov 28, 2019
    Posts:
    1
    Hi,
    I had the same problem.
    Turning "Render Mode" (bottom of light insperctor) from "Auto" to "Important" solved the problem.
     
  11. aloften

    aloften

    Joined:
    Aug 25, 2017
    Posts:
    18
    Thanks Gras! This helped me. Im wondering if this is the right solution performance-wise or if there is a wiser solution. But it is working now for me atleast.

    if anyone else has trouble finding the render mode Gras mentions, he is speaking of the light component inside the objects inspector. I thought he meant the Lighting tab(which I always kinda considered an inspector for the general lighting situation).
     
  12. GameDev_4928394398

    GameDev_4928394398

    Joined:
    Apr 15, 2022
    Posts:
    3
    you're a lifesaver I spent 3 hours trying to figure it out and found this post thank you so much sir
     
    EarthHobbit likes this.
  13. GameDev_4928394398

    GameDev_4928394398

    Joined:
    Apr 15, 2022
    Posts:
    3
  14. Untitiled

    Untitiled

    Joined:
    May 16, 2022
    Posts:
    2
    I have the same issue but don't know how to solve it , as I am a newbie to unity can anyone tell me what to do exactly
    to solve this problem. In my project setting the render mode to important does not work at all.. What should I do ???
     
  15. wwWwwwW1

    wwWwwwW1

    Joined:
    Oct 31, 2021
    Posts:
    766
    Hi, what render pipeline are you using? The default 3D template or URP?

    How many real-time lights are there in the scene?
     
  16. kristijonas_unity

    kristijonas_unity

    Unity Technologies

    Joined:
    Feb 8, 2018
    Posts:
    1,080
    SuspecM likes this.