Read texture pixels

Is it possible to read individual texture pixels from OpenGL?

I uploaded the textures to GL with glTexImage2D() and for memory reasons I would like to read back one pixel without reading the whole texture back.

/Jonas

If you know the Window coordinates of that pixel you can use glReadPixel…

If it’s possible, could you read the pixel while you have it in some more convenient format (say, just read in the BMP, or whatever), and store it away?

The only way I can think of is to somehow get it on the screen at a known spot and call glReadPixel (as mentioned above)… but I’m sure some of the smarter people on this board will know of a better/more direct way (or can definitively say it’s not possible)

Originally posted by DaViper:
If you know the Window coordinates of that pixel you can use glReadPixel…

It might not even be visible so that’s a dead end, I’m afraid.

glGetTexImage(…) but it does get the whole of the image.
or do what the others have said (glredapixels), and make sure the texture is visable , u could use a pbuffer