View Single Post
Old 10-05-06, 06:12 PM   #4
tachyon_john
Registered User
 
Join Date: Jan 2006
Posts: 32
Default Re: 1.0-9625 GLSL rendering bug

Hi,
I have just traced down the problem with the 9625 driver...
It appears that the problem is related to the execution of code that sets the OpenGL fragment depth:
// Output the ray-sphere intersection point as the fragment depth
// rather than the depth of the bounding box polygons.
// The eye coordinate Z value must be transformed to normalized device
// coordinates before being assigned as the final fragment depth.
if (vmdprojectionmode == 1) {
// perspective projection = 0.5 + (hfpn + (f * n / pnt.z)) / diff
gl_FragDepth = 0.5 + (vmdprojparms[2] + (vmdprojparms[1] * vmdprojparms[0] /
pnt.z)) / vmdprojparms[3];
} else {
// orthographic projection = 0.5 + (-hfpn - pnt.z) / diff
gl_FragDepth = 0.5 + (-vmdprojparms[2] - pnt.z) / vmdprojparms[3];
}

When I #ifdef out the fragment depth code, the spheres render on the screen as one would expect. This tells me that the fragment depth portion of the shader is not being executed correctly for some reason. The fragment depth equations are standard OpenGL and are documented in various books.

Cheers,
John
tachyon_john is offline   Reply With Quote