Search Unity

Light intensity in built-in vs URP

Discussion in 'General Graphics' started by SunnySunshine, Jun 10, 2021.

  1. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Anyone know why the light intensity values work so vastly different in URP as compared to built-in?

    Here's a very simple scene in URP with directional light intensity 3:


    The very same scene (but with Standard materials) in built-in will look like this:


    As you can see, the image appears brighter and the colors more desaturated.

    By tweaking the light intensity setting, the scenes can be made to look exactly the same (more or less), i.e. either by increasing the URP light, or decreasing the built-in light.

    Here's the same scene in built-in, but with 1.8 light intensity instead:


    Making it look identical to URP scene.

    The question is, why? Why are the light intensity values reacting so differently to the same values?

    I don't mean that as criticism, I'm more genuinely intrigued as to what causes this difference, and what decisions led up to introducing this discrepancy.
     
    Last edited: Jun 10, 2021
  2. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    I think the difference comes from URP using linear light intensities and built in using sRGB intensities. Check a comparison between them, the falloff is also different between them.
     
  3. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    No difference when switching to the URP:
    bin.jpg
    urp.jpg
     
  4. BOXOPHOBIC

    BOXOPHOBIC

    Joined:
    Jul 17, 2015
    Posts:
    509
    Last edited: Jun 10, 2021
  5. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Unfortunately, you need to manually change both baked and realtime lighting back to legacy falloff. Its a major PITA right now for URP.

    The legacy falloff is great for stylised games - which is basically what URP is made for- so it doesn't make sense that URP and HDRP have the same falloff settings.

    At least, it should be easier to change the falloff setting default in the editor, instead of needing to add scripts to each scene and modify shader files.
     
    Last edited: Jun 11, 2021
  6. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Great stuff guys. Thanks for pointing out the falloff difference.



    That's odd. What intensities were you using? Maybe they're the same at intensity 1?
     
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    3
     
  8. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Might be a gamma vs linear project setting.
     
  9. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,874
    tested on the same project
     
  10. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    Still might be a difference in how each renderer reacts to gamma.

    Also, did you rebake the scene after switching? Otherwise the lightmaps won't reflect the light intensity change.
     
  11. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    URP changes GraphicsSettings.lightsUseLinearIntensity = true with liner workflow, and may forget to back false when you change back to built-in. So, built-in(new project) is sRGB intensity, URP and built-in(back from URP) are linear intensity.
    You can check the project settings file of the project that uses built-in renderer. The value of m_LightsUseLinearIntensity in the GraphicsSettings.asset file.
     
    Last edited: Jun 16, 2021
    JavaBob and SunnySunshine like this.
  12. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    One of the other weird aspects of these default settings is that the apparent actual illumination created by eg. a Directional Light vs Spotlight are totally different.

    A directional light with an intensity value of 5 is approximated by a spotlight with an intensity value of 600! These values are just too far apart and the UX of this is really poor.

    In particular if you are doing anything topdown 3D, these default URP intensity/falloff settings really, really suck :-/
     
  13. ekakiya

    ekakiya

    Joined:
    Jul 25, 2011
    Posts:
    79
    PointLight and SpotLight are attenuated by distance, but DirectionalLight doesn't.
    So DirectionalLight's value must be set by illuminance, not by luminous flux.

    DirectionalLight(value 1) = PointLight(value 4*PI*distance*distance) from that distance.
     
  14. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Lights are multiplied by 2 in built in if I recall.
     
  15. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    I'm just going to avoid using spotlights or pointlights at all. There are performance benefits from that anyway.

    Unity, if you are reading this, please revert back to the legacy falloff values for URP - or at least provide an easy interface to change the defaults falloff setting (for baked and realtime lights).
     
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    I believe this hasn’t been true in many years.