Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

ARFoundation - Enabling Light Estimation

Discussion in 'Handheld AR' started by Dalbino, Jan 31, 2019.

  1. Dalbino

    Dalbino

    Joined:
    Dec 20, 2013
    Posts:
    5
    According to the ARFoundation manual (https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@1.0/manual/index.html) you are supposed to enable Light Estimation in the AR Session component if you want access to that information. However, this option is not visible to me.

    When I try the Light Estimation sample scene (provided here: https://github.com/Unity-Technologies/arfoundation-samples) the app does not work.

    I am running Unity 2018.3.3f1 and AR Foundation 1.0.0-preview.22.

    I have added some visuals:
    ar-light-estimation-problem.png
     
    unityplutomen and Conviley like this.
  2. newguy123

    newguy123

    Joined:
    Aug 22, 2018
    Posts:
    166
    They've changed things recently. You now have to manually add the "AR Camera Options" script to the AR Camera
    In there you'll find some settings
     
    bowserscastle likes this.
  3. Dalbino

    Dalbino

    Joined:
    Dec 20, 2013
    Posts:
    5
    The sample project image above uses the scene 'LightEstimation', in which the AR Camera already uses the script "AR Camera Options" with the Light Estimation option enabled. So that doesn't seem to be the problem.
     
  4. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    543
    The docs are indeed out of date; we've updated them for the next release.

    So you're saying even with this option checked, light estimation doesn't work?
     
  5. Dalbino

    Dalbino

    Joined:
    Dec 20, 2013
    Posts:
    5
    It appears so. In the light estimation scene from the sample projects it is checked, but when I run it I get the image shown in the original post, i.e. no values, only the text "new text". (Also no virtual object appears either, in case that is supposed to happen?)
     
  6. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    543
    That's a mistake in the sample; light estimation was working, but the text fields were not updated. Should be fixed now.
     
    Dalbino likes this.
  7. Dalbino

    Dalbino

    Joined:
    Dec 20, 2013
    Posts:
    5
    Thank you very much for the fix! Then it seems light estimation works as intended (my bad for not testing it more thoroughly myself).
    Brightness and Color Correct are now updating and showing values. Color Temp is oddly enough only showing Unavailable though.
     
  8. tdmowrer

    tdmowrer

    Unity Technologies

    Joined:
    Apr 21, 2017
    Posts:
    543
    Color temp is only available on ARKit. ARCore only surfaces color correction.
     
    Dalbino likes this.
  9. Dalbino

    Dalbino

    Joined:
    Dec 20, 2013
    Posts:
    5
    That explains it! Thanks td!
     
  10. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    303
    Just checked that color correction, the result is horrible. In a good room light conditions brightness value range is 0.40-0.50 what is a reason of AR objects become too dark. I had to multiply that result 5x times to makes something more realistic..
    Can somebody explain me, why that happens?
     
  11. jterragni

    jterragni

    Joined:
    May 22, 2018
    Posts:
    6
    I don't think I understand light estimation too much. I'm not sure what values to put into color correction to make it visibly change. My object stays the same darkness no matter what value I put in color correction or what kind of light is in the room. There is a definite difference in color between using the light estimation and not using it though, so I know something is working. Can any help?
     
  12. Sk8ape

    Sk8ape

    Joined:
    Mar 23, 2014
    Posts:
    3
    Same here, after doing the implementation of the light estimation script, my 3D object is way too dark. I've been following this Unity video


    Does anyone have any idea why this is?
     
  13. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    303
    Did you bake the lightning on a scene?
     
  14. Sk8ape

    Sk8ape

    Joined:
    Mar 23, 2014
    Posts:
    3
    I have not, at least not knowingly.
     
  15. novaVision

    novaVision

    Joined:
    Nov 9, 2014
    Posts:
    303
    Check it, that was the issue in my case months ago
     
  16. Sk8ape

    Sk8ape

    Joined:
    Mar 23, 2014
    Posts:
    3
    I rebuilt the scene starting with the Unity base Light estimation scene, and now I can see my object just fine, but the light estimation itself doesn't seem to work properly as far as figuring light intensity and direction. the script is applied to the light but it doesn't seem to be rotating or changing intensity.
     
  17. BardurM

    BardurM

    Joined:
    Mar 24, 2015
    Posts:
    1
    I have the same problem. Light estimation has very little effect (on Android at least) and the directional light doesn't change intensity or direction. I've added the light estimation script from ARfoundation samples.
    I can't really figure out what the issue could be or if this is just a bug.

    It worked flawlessly with ARCore. But ARfoundation just shows the object exactly how it looks in unity. static light and no change in color/temp/brightness.
     
  18. proprodark102

    proprodark102

    Joined:
    Feb 8, 2019
    Posts:
    1
    Hey, I just wonder if this is fixed. I tried light estimation but it has no effect at all. Even I put my hand over my camera to make the light intensity become zero, the object is unchanged and the color is still the same.