Search Unity

How does one get physically accurate lighting?

Discussion in 'Global Illumination' started by Vallar, Aug 12, 2019.

  1. Vallar

    Vallar

    Joined:
    Oct 18, 2012
    Posts:
    155
    Hi everyone,

    So I am working on a project that requires a high level of accuracy in terms of lighting. This is not a post about how to make stuff look realistic or how I can get high quality lighting.

    What I am asking about is, for example let's say my project requires a light source with 325 Lux in a defined area. Is there a way to recreate this without eyeballing it?

    I thought of using HDRP as I know it has physical based lighting however Unity officials said in some posts that it is not accurate or representative of real world light parameters as they couldn't figure out how to do that just yet. Standard Render Pipeline lighting isn't physical based so the "Intensity" modifier doesn't represent any realistic value (as far as I know).

    I looked into the store and haven't found anything related to what I want to do.

    Anyone knows anything about this?

    Thanks.
     
  2. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    133
    Yes, in HDRP you can set the light intensity in LUX.

    I haven't seen such a statement, are you sure about that? Could you maybe find a link to it?
     
  3. Vallar

    Vallar

    Joined:
    Oct 18, 2012
    Posts:
    155
    Sure but the values don't correspond to real lighting.

    Not the thread I read this and mentioned it plainly but this should suffice to prove my point till I find the exact thread that mentioned how the lighting isn't accurate.
     
    iSinner likes this.
  4. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    133
    Thanks for the link. From it i got that not that the LUX values aren't accurate, but the sun settings in the scene in a sample project(1000 lux) do not match the real sun lux values(~120 000) intentionally, due to some issues with specular aliasing(which might be fixed by now, i don't know if it is, maybe it is a good idea to ask @Vestergaard) and limitations with auto exposure post effect and light probes.

    Considering this and your requirements of 325 lux, i think you won't bump in the issues mentioned by @Vestergaard.

    In any case, HDRP is the only solution in unity(afaik) that allows you to specify light values in real world units like lux. It's been almost a years since that post, maybe things got better and the mentioned problems are no more, but i don't know for sure.

    Also, in Unreal Engine you can author light with lux values, so if that is an option, you can try it.
     
    Last edited: Aug 12, 2019
  5. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,638
    The LUX values - you can use real world values fine (I do) but you'll need to tweak exposure of course.
     
    iSinner likes this.
  6. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    133
    At the time you wrote that post, there were no physical camera settings(as i understood it), now there is, does the presence of these physical settings solve some of the issues that were before, and if yes, could you elaborate how?

    I'm not familiar with real world workflows and how they translate into unity, and how all these settings tie together(HDR lighting, exposure and the rest i'm not aware of), this is why i ask for elaboration. And i think this could help others that share the same sentiment, since this workflow is something new for me, in fact HDRP is still in preview so its like a beta phase.
     
  7. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    25,638
    upload_2019-8-12_14-22-43.png

    In your global volume... I use Fixed which means the exposure is fixed in the volume, but you might prefer not to use fixed, in which case it will take the value from the camera shutter / ISO settings etc...

    You also cannot use the built-in procedural sky well with it (can with latest AFAIK) as that's still WIP.
     
    iSinner likes this.
  8. Vallar

    Vallar

    Joined:
    Oct 18, 2012
    Posts:
    155
    @iSinner I found the thread finally. It is here. As you can see the values set as per the post don't work.

    I am aware of UE4 as an option -- they use physical lighting and if I am not mistaken they do have physical cameras too but I am not familiar with it and would love to continue using Unity for this project.

    @hippocoder Does this mean (tweaking exposure) the usual "play with the settings till it looks good/right"? Or are you referring to certain calculations that can be done for it to replicate a 100% accurate to real world results?

    My primary concern is that I don't want to eyeball anything -- if I am to set exposure so the scene "looks right" then it is no longer 100% accurate and I am eyeballing it. The project I am working on requires a 100% accurate replication of real world light in the scene, unfortunately.
     
    iSinner likes this.
  9. iSinner

    iSinner

    Joined:
    Dec 5, 2013
    Posts:
    133
    Thanks for the link, again :)

    I have created a HDRP template project in 2019.1 and the default values for the sun is 500 lux and the exposure is set to auto.

    Setting the sun lux value to 20k and playing with exposure doesn't produce a satisfying image, i guess the reason for that are the missing pieces mentioned by @SebLagarde from the thread you linked.