In order to avoid the depth precision problem during perspective projection. I try to dump the depth in viewing space to a float texture with CgFx & FBO. However, I find the depth value is always clamped to [0,1]. I've try to set the state DepthClampEnable to false, but it doesn't work. Is there any way to disable the depth clamp in CgFx?
Besides, so far, I use the depth texture with DEPTH_COMPONENT24 which attaches to the FBO(is it the problem?) Since I only need one float channel, which kind of texture format is recommended with CgFx? (ALPHA_16F_ARB?)
Thanks in advance, any ideas are welcome!! Thank you!