Posted: Thu Dec 15, 2005 3:57 pm
I'm lost...
You mean we cannot render with GL_EQUAL while using a shader?
Or that somehow the z-buffer would be overwritten on second pass?
Or you mean that the shader needs to read z-info? If the latter, we could write the z value to RGB on the first pass (plus height field to A if we're planning to use texture offset), or even do this onto another render target that we use read-only on second pass, maybe. (I mean *in addition to* the z-buffer). Generally speaking, though, distance to the eye is too easy to calculate to be worried about accessing the z-buffer, unless I'm missing something...
You mean we cannot render with GL_EQUAL while using a shader?
Or that somehow the z-buffer would be overwritten on second pass?
Or you mean that the shader needs to read z-info? If the latter, we could write the z value to RGB on the first pass (plus height field to A if we're planning to use texture offset), or even do this onto another render target that we use read-only on second pass, maybe. (I mean *in addition to* the z-buffer). Generally speaking, though, distance to the eye is too easy to calculate to be worried about accessing the z-buffer, unless I'm missing something...