Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Resolved Meta Quest 3 - ARCameraManager and getting light estimation (frameReceived not called)

Discussion in 'AR' started by tststs, Dec 7, 2023.

  1. tststs

    tststs

    Joined:
    Jul 16, 2016
    Posts:
    11
    Hey,

    I'm trying to figure out how to get the light estimation at runtime.

    Using this code but `FrameChanged` never gets called. Is this the correct way of doing it or am i missing something?

    Passthrough and everything is working as expected in a build.

    Thanks in advange!

    Code (CSharp):
    1.  
    2.         void OnEnable()
    3.         {
    4.             if (cameraManager != null) {
    5.                 Debug.Log("ApplyLightingConditions: OnEnable() Add Action FrameChanged");
    6.                 cameraManager.frameReceived += FrameChanged;
    7.             }
    8.         }
    9.  
    10.         void OnDisable()
    11.         {
    12.             if (cameraManager != null) {
    13.                 Debug.Log("ApplyLightingConditions: OnEnable() Remove Action FrameChanged");
    14.                 cameraManager.frameReceived -= FrameChanged;
    15.             }
    16.         }
    17.  
    18.         void FrameChanged(ARCameraFrameEventArgs args)
    19.         {
    20.             Debug.Log("ApplyLightingConditions: FrameChanged()");
    21.  
    22.             ARLightEstimationData lED = args.lightEstimation;
    23.          }
    24.  
     
  2. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,876
    Check the documentation for quest in ar foundation. It's not supported yet
     
  3. tststs

    tststs

    Joined:
    Jul 16, 2016
    Posts:
    11
  4. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    4,876
    Owh, did not see that.
    If it doesn't work while docs say it should, file a bug report so it can be fixed
     
  5. tststs

    tststs

    Joined:
    Jul 16, 2016
    Posts:
    11
    Maybe someone from Unity can confirm if this is a bug or just not implemented for the meta quest 3
     
  6. tststs

    tststs

    Joined:
    Jul 16, 2016
    Posts:
    11
  7. jstan-unity

    jstan-unity

    Unity Technologies

    Joined:
    Sep 15, 2023
    Posts:
    8
    Light estimation for Meta devices in AR Foundation is not currently supported. I can see why there's confusion here; the description that you linked to ("Camera: Render images from device cameras and perform light estimation.") is a standard description for the Camera feature and does not necessarily indicate that the provider you're using (in this case Meta) supports all of its functionality.

    To determine whether a specific functionality such as light estimation is supported on a specific provider, you can have your code check the value of the associated property in the XRCameraSubsystemDescriptor.

    As for the issue with FrameReceived not being called, I would recommend taking a look at the script for the Basic Light Estimation scene in our samples project and comparing your code against that.
     
    andyb-unity likes this.
  8. tststs

    tststs

    Joined:
    Jul 16, 2016
    Posts:
    11
    Thanks for the clarification.

    I checked the FrameReceived issue and it is also not called with this scene: https://github.com/Unity-Technologi...ree/main/Assets/Scenes/Camera/LightEstimation. So it seems there is an issue here.

    And for the last question: is there any ETA if and when these features will be available for meta quest 3 devices?

    Thanks
     
  9. jstan-unity

    jstan-unity

    Unity Technologies

    Joined:
    Sep 15, 2023
    Posts:
    8
    Ah, it looks like you’re correct that frameReceived is not invoked on Meta. It seems that we chose not to invoke the frameReceived event on Meta because Meta does not give us access to the camera pixels (so there wouldn't be any useful data to work with). We don’t mention in our documentation anywhere that frameReceived is not invoked on some platforms, so I’ll look into this further to see if we can either clarify this in the documentation or find another solution that makes sense.

    Meta does not (currently) support light estimation, so it’s a platform limitation for us. We can’t implement it in AR Foundation until Meta implements it on their platform first. So I do not have an ETA for you.
     
    andyb-unity, tststs and DevDunk like this.