I'm working with an older OpenGL app, using the fixed pipeline. The app uses a cubemap and I'm querying vertex information with:

Code :
glReadPixels( x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &z );

and then using the newfound z in a call to gluUnproject.

A few days ago, I realized that sometimes the unprojected values are wrong with the textured cube, whereas in a test app without textures it always returns correct values.

I'm wondering if having the textures active when reading the pixel information is affecting the output.

Is a good idea to call
Code :
before calling glReadPixels and gluUnproject?

Thanks in advance!