Unity-Technologies / arfoundation-samples

Example content for Unity projects based on AR Foundation
Other
3.02k stars 1.12k forks source link

[Bug] Ambient-light estimation: Wrong parameter assigned? #957

Closed seyfeb closed 10 months ago

seyfeb commented 2 years ago

Describe the bug In the ARFoundation HDR ambient-light estimation demo scene you assign here the intensity

            if (args.lightEstimation.mainLightIntensityLumens.HasValue)
            {
                mainLightIntensityLumens = args.lightEstimation.mainLightIntensityLumens;
                m_Light.intensity = args.lightEstimation.averageMainLightBrightness.Value;
            }

You are checking the args.lightEstimation.mainLightIntensityLumens value but are assigning the args.lightEstimation.averageMainLightBrightness value. Is this a typo or the correct way to do this (and if so, why?)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

seyfeb commented 2 years ago

Not stale

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

seyfeb commented 1 year ago

Haven't tested it recently, but since there was no activity here, I'd assume it's not stale

stale[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

andyb-unity commented 10 months ago

Hi @seyfeb -- as you have probably noticed, our team is not structured to respond to GitHub issues in a timely manner. I can tell you that assigning mainLightIntensityLumens to a Light's intensity value would be clearly incorrect. intensity is measured on a scale of 0 to 8, as noted here: https://docs.unity3d.com/ScriptReference/Light-intensity.html

Lumens for real-world directional lights are measured in the thousands. If you plugged a value measured in lumens into a field expecting intensity on a scale of 0-8, you would likely get very poor results.

Is averageMainLightBrightness.Value strictly correct? I think this ultimately depends on your use case, but it's an acceptable value for us to use in our sample project. Hope that helps.

I'm trying to close out these old issues. Feel free to re-open this one if you have further questions.