- Home /
Get depth texture from RT without the extra pass?
I need to read the scene depth from the shader in an fx pass that happens towards the end of the frame (after any modifications to the depth buffer will occur).
I know I can get a depth texture by using depthTextureMode on the Camera, however this causes an entire extra pass over the whole scene.
Is there a way to just get the depth from the current render target at a given safe point? E.g. I could copy the depth from the RT right before I need it.
I can't find a way to copy just the depth from the RenderTexture (since it's a RenderBuffer, not a Texture).
I've noticed this too. It's strange that even in DX11, there's an entire depth-pre pass to generate this, ins$$anonymous$$d of using w/e is there after Render()
. I've posted a related question here. I'm pretty much clueless at this point :'(
This is indeed a strange behaviour and I really don't understand why can't you get that depth texture - it doesn't make any sense to me :(
Does anybody know what is the reason behind that?