I've a render target on which I have both a color and a depth attachment. In a second pass I need to run a filter whose width depends on the derivative and values of the depth.
Now, if I try, in the second pass where I'm accessing the texture on which I rendered on previously, to display the depth information all I have is a grey blotch:
http://imgur.com/UFm5oI6 (Don't pay attention to background, I'm showing just non-background values)
Before displaying it I modify it by:
float depthValue = texture(depthTexture, uv); depthValue =(depthValue - 0.1)/0.9;
as my near clip is 0.1 and far one is 1.0
Instead, if I run the program with gDEBugger and look at the content of the depth texture what I see is a much cleaner result:
Why what I see is totally different? How gDEBugger show the values? Are the value I fetch from the depth texture wrong? Should I render depth values differently?
Moreover, the width of the kernel doesn't really change as it is computed based on depth value and depth derivatives and those two are practically identical, at least judging from what I see. Is there a way to make these differences more marked?
Sorry if it's a dumb question. Thank you.