I’m working on a project where I try to enable HDR light estimation. On a test device I got (some high-end android phone) I run arfoundation-samples app and I realized that mainLightColor and mainLightIntensity properties are reporting strange values (or at least values I did not expect and/or lacking proper documentation). So…
mainLightColor - in bright rooms RGB values often get values outside of 0-1 values (i.e. it is not that uncommon to get values above 2.0-3.0 float for each channel). Alpha channel is always set to 1.0.
mainLightIntensity - it is always undefined.
ambientProbe - can’t really tell whether values are correct or not…
So my questions are:
How should I handle mainLightColor properly? I mean how should I set that on my directional light’s color property given it’s values are outside of expected range (that is outside 0-1 range)? If I pass color value “as-is” objects on the scene render way too bright so that all bright textures turn completely white and black turns grey.
Why there is no mainLightIntensity?
What am I missing here (and what is missing in the official arfoundation-sample) that would help me to get things working correctly?
Oh and I am running build-in render pipeline if that makes any difference.
Slept just a couple of hours 'cause I couldn’t stop thinking about this annoying issue
So… this is what I found in ARCore’s SDK repo:
And here is another one
Could someone from Unity team could confirm whether something needs to be done for ARCore devices when HDR light estimation is used along with Build-in render pipeline & standard shaders?
Also, do I need to use tonemapping from the post-processing stack v2 in order to get the colors right or simple color normalization (link #2) is good enough?
And finally I think I found a more complete explanation of how HDR lightning is supposed to be used in ARCore (not sure if it’s the same on ARKit though):
ALso not completely sure though how to implement that in Unity but my guess it that scale light by “Mathf.Pi” and then normalize would be the way to go. Could someone confirm whether my thinking is correct or not?