Search Unity

Point Light problems, Point Light flickering sporadically need help!

Discussion in 'Editor & General Support' started by helioraanswer, Mar 25, 2013.

  1. helioraanswer

    helioraanswer

    Joined:
    Apr 7, 2009
    Posts:
    412
    Hi,

    I have a few Point Lights in a very simple map with simple objects.
    No normal maps or bump or spec. Just diffuse. And there are no
    error's in the faces of the objects. Just normal modeled.

    And the lights are flickering, sometimes they go completely out.

    I haven't unchecked any boxes anywhere, just added the Game Object
    from the menu, nothing more.

    Any idea why the lights act like this?

    Check it out HERE
     
  2. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,891
    Did you add them after lightmapping? If so, then lightmap again.
     
  3. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    How many points lights do you have?
    There is a limit to how many vertex lights can be enabled at once in Unity. Increase the limit in Quality settings.
     
    au-relius and Gidcheen like this.
  4. helioraanswer

    helioraanswer

    Joined:
    Apr 7, 2009
    Posts:
    412
    Thanks for the replies,

    I didn't do any lightmapping at all. I never did in the previous Unity versions.
    There are around 10 Point Lights in the scene, is that the limit?
     
  5. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    The default limit is way lower than that. Go to Edit -> Project Settings -> Quality (if on PC, on mac is quite similar)
    There is a line called "Pixel Light Count".

    However, using 10 points lights really isn't recommended unless you are using deferred rendering with small light sizes. I advice you to redesign.

    Edit:
    Just something for you to think about:
    For every point light you add, your objects will render once more that frame. That means that if you have 200 000 polygons, you will effectively render 2 000 000 polygons with 10 point lights active.
     
    Gidcheen likes this.
  6. helioraanswer

    helioraanswer

    Joined:
    Apr 7, 2009
    Posts:
    412
    Okay, I know a bit more about light mapping.

    Didn't know Unity needed that, but it was needed in the Unreal Tournament Editor.

    I only bake the map and the objects in the map, all else are game characters at the moment.
     
  7. helioraanswer

    helioraanswer

    Joined:
    Apr 7, 2009
    Posts:
    412
    Okay Horp1, I understand.

    But I have lanterns in the map and the rest is totally black.

    How should I do that in Unity? It's suppose to be a bit survival, go into the dark and you can't see.
     
  8. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    4,891
    I recommend lightmapping your level, it will help a lot with lighting issues.
     
  9. aiab_animech

    aiab_animech

    Joined:
    Jul 4, 2012
    Posts:
    177
    Lightmapping really is the right way to make lighting look nice.
    If you want several dynamic lights, there are 2 options really:
    1. Only have some of the dynamic lights active at once.
    2. Use Deferred rendering. This has other drawbacks, such as no real AA. Without Unity Pro with Image Effects you will be left without even FXAA, which will make your game look pretty bad.

    When using deferred rendering, performance cost per light increases per total lit screenspace pixel. If this sounds strange, try googling deferred rendering for more info.
     
  10. helioraanswer

    helioraanswer

    Joined:
    Apr 7, 2009
    Posts:
    412
    Okay, thanks for the tip guys.

    I really didn't know about this stuff till now.
     
  11. Mouike

    Mouike

    Joined:
    May 16, 2016
    Posts:
    1
    Hey I know this is an ancient question, but i found a cheap "workaround" for this problem ( I had the same issue with point-lights and whenever I searched for it this thread popped up) so I figured i might post it.

    TLDR
    Set the point light's Render Mode to Important from Auto.

    I have no idea how will this affect the performance of the game but since it's for a Uni project i'm rolling with it and it works ;p

    Good luck.
     
    Nadan likes this.
  12. dee2061

    dee2061

    Joined:
    Jan 4, 2016
    Posts:
    1
    Thanks man, it worked like a charm. :)
     
  13. BamPow

    BamPow

    Joined:
    Feb 6, 2019
    Posts:
    1
    that doiesn't work for me, I still get flickering :(
     
  14. poetoaster3006

    poetoaster3006

    Joined:
    May 5, 2015
    Posts:
    23
    Same issue in 2018.3.6f1 :(
     
  15. hsjaaa

    hsjaaa

    Joined:
    Apr 30, 2016
    Posts:
    29
    using 2018.3 too, change point light render mode to important works for me
     
  16. poetoaster3006

    poetoaster3006

    Joined:
    May 5, 2015
    Posts:
    23
    It was a shader issue for me. Changed single directional light to multi lights in the shader pass settings
     
  17. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    6,936
    If you're using forward rendering (default) of the built in renderer, there is a pixel light count setting under Qualtiy Settings. I think it defaults to around 4 on the highest quality setting level. If you try to render more than this number, any additional pixel lights will render as vertex lights instead. This can be undesirable or otherwise look like the light is dimming. If you up a light's priority, it will probably render as a pixel light, but other lights will still render as vertex lights if you're over the limit regardless. If you just set all your lights to Important, then setting that priority does nothing, because Unity still has to pick up to your pixel light count limit number of lights to render as pixel lights.

    Upping the pixel light count setting in Quality Settings will negatively impact performance. The better solution is to just switch to deferred rendering, which isn't bound by the pixel light count setting, and isn't significantly impacted in the same way performance wise by additional pixel lights.

    I haven't tried out the new SRP's yet, so don't know what the rules are for those.

    https://docs.unity3d.com/Manual/class-QualitySettings.html
    https://docs.unity3d.com/Manual/LightPerformance.html