Question about light intensity in HDRP

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.

7 Likes

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.

2 Likes

Awesome! Where can I read more about this?

Nowhere yet, but you can download this experimental postfx branch https://github.com/Unity-Technologies/ScriptableRenderPipeline/tree/hdrp-postfx

2 Likes

They had to use workarounds for FPS sample so you’re not alone in wanting this :slight_smile:

3 Likes

Wow I didnt realise that and had been scratching my head a bit on this, thanks!

It’s in my breakdown on the FPS sample forum and Unity explained the rationale.

1 Like
2 Likes

Oops sorry forgot link (thank you).

2 Likes

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.

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.

6 Likes

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…

2 Likes

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

I see. I faced this problem using Unity 2019.1.12 and HDRP 5.x.x.

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?

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.

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/com.unity.render-pipelines.high-definition@6.9/manual/Physical-Light-Units.html

For the Sun/Directional light

For the HDRI Sky or Physical Sky
Exposure value - Wikipedia (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.

3 Likes

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

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/com.unity.render-pipelines.high-definition@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/09/how-to-set-up-unitys-unitys-high-definition-render-pipeline-for-high-end-visualizations/

1 Like

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.

1 Like

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?

Hi,

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

5472615--559785--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.

5472615--559788--upload_2020-2-12_17-57-38.png

3 Likes