oculus-samples / Unity-DepthAPI

Examples of using Depth API for real-time, dynamic occlusions
Other
192 stars 24 forks source link

Check if depth sensor is available #18

Closed MollerAndre closed 9 months ago

MollerAndre commented 9 months ago

Is there a way to check if Depth Sensor is available on the Quest model an user is using? If I enable environment depth occlusion on a Quest 3 device everything is fine, but if I do it on a Quest 2 device which does not have depth sensor materials using depth-occlusion shaders are not show at all. I need a reliable way to check (even for future Quest models) if I can enable or not depth occlusion on my scene.

TudorJude commented 9 months ago

Hey MollerAndre,

Yes, there is a way to check that. If you go to the EnvironmentDepthTextureProvider.cs script, you'll see that in the Start function, we use such functionality.

            if (!Utils.GetEnvironmentDepthSupported())
            {
                _isDepthTextureAvailable = false;
                enabled = false;
                return;
            }

This fix just landed very recently, so you will have to update the depth API package.

Cheers

TudorJude commented 9 months ago

Closing issue.