Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. We are looking for feedback on the naming of a new user research platform that we are working on.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Question about light intensity in HDRP

Discussion in 'Graphics Experimental Previews' started by SunnySunshine, Nov 6, 2018.

  1. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    701
    In HDRP, the unit of light intensity for a directional light is "lux". According to Wikipedia, lux is defined as "one lumen per square metre". Examples measurements of lux in different circumstances:



    When creating a new scene in Unity in HDRP, the directional light intensity is set to PI (3.141593), which according to this table equals something like civil twilight.

    The sample scene in HDRP has a directional light with an intensity of 10, which is something between civil twilight and "public areas with dark surroundings".

    The FPS sample project has a directional light source of 1,000 lux, which equals an overcast day/TV studio lighting. The entire scene is actually completely white unless a strong auto exposure is used.

    None of these are even close to the true lux of sunlight. When trying to use a realistic value, the scene becomes so bright that even with maxed out auto exposure settings, it's essentially just white.

    My questions is this:
    Why these intensity values?

    All these values (3.14, 10, 1000) are not physically accurate and seem rather arbitrary. If just taken out of thin air, why 1000 and auto exposure settings for that value rather than 10 and auto exposure settings for it? Is there any guide or best practices regarding lighting in HDRP? It all seems so confusing and arbitrary from the examples I've seen.
     
  2. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    153
    Wait for the upcoming HD Postprocessing which will implement physical camera properties. You will be able to use proper lux values with proper exposure settings.
     
  3. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    701
    Awesome! Where can I read more about this?
     
  4. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    153
    hippocoder and SunnySunshine like this.
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    They had to use workarounds for FPS sample so you're not alone in wanting this :)
     
  6. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    2,671
    Wow I didnt realise that and had been scratching my head a bit on this, thanks!
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    It's in my breakdown on the FPS sample forum and Unity explained the rationale.
     
    MadeFromPolygons likes this.
  8. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    701
  9. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    Oops sorry forgot link (thank you).
     
  10. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    767
    Hi,

    Regarding learning about physical light unit I recommend this talk form lighting in mirror edge 2 (based on frostbite and first game to really use our physical light unit). It explain why using correct value for sun is hard.
    https://www.gdcvault.com/play/1023284/Lighting-the-City-of-Glass

    if you want more detail there is also this document: https://seblagarde.files.wordpress.com/2015/07/course_notes_moving_frostbite_to_pbr_v32.pdf (section 2 about lighting)

    The main issue we have currently in Unity is that we miss pre-exposure and a correct auto-exposure that can span the range of real dynamic range. This is what is coming with Postprocess stack V3 and the result is that currently we must use wrong value that make no sense so users don't open a scene that is fully white...

    So the default of PI is due to this. Ideally we would like to default to 100 000 lux but we can't, and in practice we rather use 20 000 (see mirror edge talk).

    Why PI ? Because we use explicit Lambert formula (albedo / PI) instead of implicit (albedo) of builtin unity.

    And PI is of course not a right value but as we are sit on top of Unity, and as Unity was defaulting to 1, we are a bit in a trap and need to follow that path. The template of HDRP is at 10 for the reasons explain above, currently we can't use correct value or we will be fully white.

    Hope it make sense.
     
  11. tetto_green

    tetto_green

    Joined:
    Dec 22, 2015
    Posts:
    28
    Hi @seb
    Hello!

    Ehm... Why don't you hide this Lux drop-down then? Or show a warning or something? This feels carelessly right now...
     
  12. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    736
    This isn't a problem. Everything is setup properly now since 2019.1 and HDRP 5.x.x
    Everything above was an issue late 2018
     
  13. tetto_green

    tetto_green

    Joined:
    Dec 22, 2015
    Posts:
    28
    I see. I faced this problem using Unity 2019.1.12 and HDRP 5.x.x.
     
  14. JamesArndt

    JamesArndt

    Joined:
    Dec 1, 2009
    Posts:
    2,863
    I've faced this issue by default in 2019.2.2f1 and HDRP 6.9.1. Completely blown out white scene by default. What is the proper way to make sure everything is balanced as it should be, setting the light intensity far lower than lux values?
     
  15. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    736
    Quick way - Not physically accurate but works
    - Set the Sky Exposure to 1
    - Set the "Scene" Exposure to 1 as well
    - Lights will have to be adjusted accordingly
    Everything should render as you are used to in the Builtin Render Pipeline or LWRP. Note using it this way you are in charge of calculating your own light intensities instead of using physical values.
    upload_2019-8-25_23-21-25.png

    Physically Correct or In that General Space
    - Open the Render Pipeline Wizzard and let it set up the defaults for you. Window -> Analysis -> Render Pipeline Wizzard in 2019.3 and HDRP 7.x.x This is in Window -> HD Render Pipeline Wizzard Select Fix All
    - Create a new scene and you should get a default scene with a lighting setup (The Lighting there isn't physically accurate but it gets you setup)
    - Change the values to whatever needed depending on the scene.


    Useful Links
    HDRP Docs on Physical Light Intensities
    https://docs.unity3d.com/Packages/c...finition@6.9/manual/Physical-Light-Units.html

    For the Sun/Directional light
    https://en.wikipedia.org/wiki/Daylight

    For the HDRI Sky or Physical Sky
    https://en.wikipedia.org/wiki/Exposure_value (Scroll down to the Chart Labeled Lighting Condition)

    For the Exposure/Scene Exposure
    - If you set it to Fixed then use the same value as the Sky EV/Exposure Value
    - If it's set to Automatic then set the Limit Max to the Sky EV and the Limit min to the brightest you want the darkest area in your scene to be. (If you aren't sure yet leave it at default)

    With all that done you have fairly physically accurate lighting.
     
    zhuchun, eizenhorn and konsic like this.
  16. Paris_iw

    Paris_iw

    Joined:
    Feb 10, 2020
    Posts:
    4
    Hi everyone,

    I am new to unity. I am an architect and I am using unity to conduct a research experiment. I need to evaluate the lighting level on a surface now that I have set up my scene. Does anyone have any idea how I can do that?
    I am not using HDRP but I realize it works with physical light values, should I switch to that?

    I need lux values or values that I can rely on to translate them into lux.
    I will be grateful if anyone could help me
     
  17. Grimreaper358

    Grimreaper358

    Joined:
    Apr 8, 2013
    Posts:
    736
    Yes, you would have to switch. HDRP is the only renderer for Unity that uses physical light values.
    - Lux (for Directional Light/Sun/Moon)
    - Lux, Lumens, Candela, Ev 100 (for Point/Spot Lights)
    - Lumens, Ev 100, Nits (for Area Lights)

    Have a look at these guides

    Docs
    Physical Light Units and Intensities
    - https://docs.unity3d.com/Packages/c...finition@7.1/manual/Physical-Light-Units.html

    Blog Post
    How to set up Unity’s High Definition Render Pipeline for high-end visualizations -
    https://blogs.unity3d.com/2020/01/0...-render-pipeline-for-high-end-visualizations/
     
    Paris_iw likes this.
  18. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    26,726
    I also recommend URP if you want to target general mobile devices such as working in the field with an ipad or something.

    Both pipelines are PBR and backed up with shadergraph. HDRP is very high end presentation with raytracing support (new nvidia cards only) and URP will run on anything..

    Both happily support PBR and baked lighting though.
     
    Paris_iw likes this.
  19. Paris_iw

    Paris_iw

    Joined:
    Feb 10, 2020
    Posts:
    4
    Oh! Thanks a lot for your help and reply.
    Does it allow measuring the lighting intensity of a combination of lights in an area as well?
     
  20. SebLagarde

    SebLagarde

    Unity Technologies

    Joined:
    Dec 30, 2015
    Posts:
    767
    Hi,

    Not exactly, there is 2 debug mode in the Render Pipeline debug that is: Lux meter and luminance meter.

    upload_2020-2-12_17-56-58.png

    You can enable one or the other, then with the color picker mode you will be able to read the value on the screen for both of this mode. So it is per pixels and not per area.

    upload_2020-2-12_17-57-38.png
     
    Paris_iw, TerraUnity and fuzzy3d like this.
unityunity