Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
OrangeFlower's avatar
OrangeFlower
Explorer
8 months ago
Solved

The Different Depth Textures Get from Quest

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!

 

 

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

2 Replies

Replies have been turned off for this discussion
  • Have you figured it out? I'm trying to achieve the same thing...

    • OrangeFlower's avatar
      OrangeFlower
      Explorer

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