I am doing some glReadPixels on a GeForce2 card drawing RGBA and reading them back. With the lastest driver 6.31 the read back always returns 255 in the alpha channe;, while with driver 6.18 the alpha channel gets read back right.

Note that you are requesting a GLUT_RGBA visual. This is a misleading enumerant in GLUT. In fact, GLUT_RGBA is defined as the same thing as GLUT_RGB. Right now, you’re probably getting a visual that has no alpha channel. You can confirm this by doing a glGetIntegerv(GL_ALPHA_BITS, &alphaBits). alphaBits should be either 0 or 8.

If a visual has no alpha channel, when you read back alpha, OpenGL specifies that we pretend the buffer’s alpha is effectively 1 (or 255, in unsigned byte terms).

We didn’t have this check in, and so we were always reading back the alpha channel, even when it wasn’t “supposed to exist”.

I fixed this bug on Aug. 24, and the first version to include the fix should be 6.22.

The fix for your app is to specify GLUT_ALPHA as one of the features you’re requesting.