- Home /
Access ZBuffer of a RenderTexture
Is there any way that I can access the ZBuffer of a Render Texture? Any way at all? I've looked around quite a bit and cannot find a good way to get to it at all.
What I want to do is create a 1px border around a character, but ONLY where it is covered by something else -- an xray vision of sorts. I have it now so that a shader creates the 1px border as a post effect and I can blit it onto the rendered image. However, given that I'm using blit (and is therefore only really rendering a quad, I believe), using depth test does nothing for me and I'd have to do it manually by passing the depth as a texture to the shader.
I wanted tried to copy the zbuffer of a render texture to the color buffer of another, or looking for a function to swap the zbuffer and color buffer of a single texture, as well as other things, but to no avail. Is the depth buffer really so protected that I can't access it at all?
Your answer
Follow this Question
Related Questions
Silhouette Toon Shader 0 Answers
An Outline like the Editor does in game, with transparency 1 Answer
3DText Outline Shader 2 Answers
Model Outline/Silhouette Shader 1 Answer
Normal length? Outline shader 0 Answers