- Home /
Depth buffer access via GLSL shaders
Hello,
I'm trying to implement a few techniques in Unity via the use of GLSL shaders - screen space ambient occlusion and a toon shader that takes depth into account. The information that I have so far on the subject consists of having to use the depth texture of the camera (found in this answer: http://answers.unity3d.com/questions/59956/retrieving-depth-buffer-of-a-frame.html).
I have implemented the script that uses the Camera.DepthTextureMode for my Main Camera. However, I cannot seem to find the answer on how to use the depth texture in my GLSL shader. There were mentions of helper macros in the file UnityCG.cginc (found here - http://docs.unity3d.com/Documentation/Components/SL-DepthTextures.html) but I couldn't find similar macros in the UnityCG.glslinc file.
So my question is - how can I access the depth texture (or the depth buffer) information in a GLSL program in Unity? Thanks in advance!
Your answer

Follow this Question
Related Questions
Shader problems! GLSL Questions! 0 Answers
Cg Language incompatibility Desktop VS GLSL Android 0 Answers
vertex displacement shader and ssao 0 Answers
SSAO: How do I get rid of these artifacts? 0 Answers
How to prevent shader optimizations? 1 Answer