Skip to main content
Inspiring
May 15, 2025
Solved

The Different Depth Textures Get from Quest

  • May 15, 2025
  • 2 replies
  • 496 views

In Depth-API sample, I notice that in ShowDepthMap.shader, it suggest that switching different code in shader.

            fixed4 frag (Interpolators i) : SV_Target
            {
                UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
                float3 uv = float3(i.uv, 0);//just show one texture so we don't get eye strain
                fixed4 col = _PreprocessedEnvironmentDepthTexture.Sample(sampler_PreprocessedEnvironmentDepthTexture, uv);
                //Uncomment the line below and comment the line above to change between the preprocessed depth texture and the raw depth texture
                // fixed4 col = _EnvironmentDepthTexture.Sample(sampler_EnvironmentDepthTexture, uv);
                col.rgb = float3(col.r, col.r, col.r);
                col.a = 1;
                return col;
            }

I want to now what's the differece between _PreprocessedEnvironmentDepthTexture and _EnvironmentDepthTexture.

And what are the data in them rgb channel?

BTW, I want to know is there any metric in depth map for reference? Because I want to restruct the distance data from the depth map, I want to know what is the real distance match to the grayscale value in the texture.

Any help will be appreciate! Thanks!

 

 

    This topic has been closed for replies.
    Best answer by OrangeFlower

    Yes, you may find the usage in:
    https://github.com/oculus-samples/Unity-DepthAPI/issues/80

    2 replies

    Inspiring
    August 6, 2025

    Have you figured it out? I'm trying to achieve the same thing...

    OrangeFlowerAuthorAnswer
    Inspiring
    August 14, 2025

    Yes, you may find the usage in:
    https://github.com/oculus-samples/Unity-DepthAPI/issues/80