So I have an FBO with a texture attached as its depth attachment. I then bind this texture to a shader so I can add some post-processing effects related to depth, like an outline effect.
However, this depth texture is not normalized. The minimum and maximum values can be anything from -1.0 to 1.0. Is there a way to normalize it so that the minimum depth on the texture is set to -1.0, the maximum depth is set to 1.0, and everything else is just a linear interpolation between the two?
EDIT: Sorry if I wasn't clear. Right now, my depth texture has values ranging from uncontrollable numbers, say from -0.5432 to 0.123. I'd like to change this so -0.5432 becomes -1.0, 0.123 becomes 1.0, and everything else is interpolated between the two.