Search Unity

How to set Point Light intensity higher than 8 in Unity 5?

Discussion in 'General Graphics' started by XilenceX, Mar 7, 2015.

  1. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    In Unity 5 the incoming light is not multiplied by 2 anymore in the (default) shaders.
    So in Unity 4 I had a brightness of 7 set on my point light.
    Naturally this was converted to 14 in Unity 5 which works temporarily.

    However as soon as I try to modify the Light Intensity it is clamped to 8 and I can't change it again.
    When I try to modify the Brightness via script it is also clamped to 8, even though I set 14.

    So how can I set a Light Intensity Value in Unity 5 that is equivalent to 7 in Unity 4?

    Bright lights are the main characters in my project, so this is a game breaking problem.
     
  2. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    657
    Have you considered stacking two lights on top of each other? I know it's hardly ideal, especially if you need shadows.
     
  3. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    Thanks for the suggestion. Yeah I thought about doing that, but my leading platform is iOS. I'm afraid the performance impact would be too high there, so I need another solution.
     
  4. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    27,547
    If you're using PBS then you should be able to get close to white. The issue here with PBS is that it will depend on the material the light is shining on as well.

    If you're not using PBS then just multiply it in your shader.
     
  5. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,738
    Cheap joke: I think it should be a Pro Feature to have lights go to 11. :p

    (edit) depending on your plattform and effects - have you considered using past-processing curves, contrast increases or LUTs for achieving the desired effect?
    Or maybe you could also increase the environment light by default if it's PBR?
    Or as a not so easy solution maybe you need custom shaders?
     
  6. XilenceX

    XilenceX

    Joined:
    Jun 16, 2013
    Posts:
    122
    I tried a few solutions and decided to go with multiplying the light intensity in the shader.

    Just in case someone else is struggling with this, I used the second example from:
    http://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html
    I downloaded the Unity5 sample shaders and then replaced the
    CGPROGRAM part with the code from the link.

    I hope this is the correct way of getting the double incoming light back.
    I'm even considering to triple it now, so I have the brightness range that I really want.
     
  7. Waz

    Waz

    Joined:
    May 1, 2010
    Posts:
    273
    Unfortunately it's not "Just" if you're mostly using Unity's legacy shaders. This change is a bit painful when porting completed Unity 4 projects to Unity 5.

    Currently, I'm over-multiplying the Color in script, as Unity doesn't force-clamp that.
     
  8. Peris

    Peris

    Joined:
    Aug 8, 2012
    Posts:
    5
    I'm having the same issue and it's driving me nuts. The get a sufficiently bright light I have to either make it really large, which makes it hit surfaces i don't want it to hit, or stack multiple lights on top of each other, which seems like an incredibly unnecessary workaround. Having lights be clamped at 8 seems so arbitrary. There's no limit to light intensity in the real world, why should unity have one?

    Lights brighter than 8 still seem to work fine, as evidenced by some of my older prefabs. As soon as i touch the intensity value it flips it to 8, making my lights super dim. In the attached picture i have a light at 11, and one at 9.14. Both are brighter than the currently maximum allowed brightness, yet still appear pretty normal.

    I'd love to hear a clear answer to why they are being clamped to 8

     
    Last edited: Oct 29, 2015
unityunity