Camera Depth Texture is missing

Hey everyone,

I am currently using the Camera Depth Texture to compute world position in a shader. It works well but on some hardwares the Depth Texture is simply missing as you can notice on this screenshot.

Because I also need the normals, as a workaround I can use the DepthNormals Texture but as it’s encoded, it lacks of precisions when you want to compute depth.

So, I wanted to know if anybody has any idea why the texture is empty.
Thanks a lot !

The depth texture isn’t guaranteed to be rendered unless you have it enabled on the camera via a script. Unity may render it even if it’s not enabled if you’re using screen space shadows or soft particles, either of which may be disabled by graphics / quality settings, or on some APIs. For DirectX, Desktop OpenGL, and consoles by default any scene with a shadow casting directional light will enable screen space shadows which will cause the depth texture to render. MacOS High Sierra likely defaults to using Metal which by default does not use screen space shadows and thus doesn’t render the camera depth texture.

Thanks @bgolus ! As always you have the right answer. :wink: