PDA

View Full Version : Why no glGetTexSubImage() ??



ibell
02-07-2007, 04:40 PM
I want to read the colour of a single texel in a large GL texture (for diagnostic purposes).

Do I /really/ have to either use glGetTexImage() to copy the /entire/ texture into CPU RAM ;
or render a portion into the frame buffer and use glReadPixels() hoping the render preserved the colour?

Both approaches suck bigtime when all I want to do is peek particular single texel cells. glGetTexSubImage() would do what I want if it existed but it doesn't seem to be implimented.

Can anybody help? TIA.

arekkusu
02-07-2007, 05:04 PM
Attach the texture to an FBO. When the FBO is bound you can ReadPixels from it.

ibell
02-08-2007, 01:35 PM
OK thanks. Can you direct me to suitable online DOCs for FBO s?

Zengar
02-08-2007, 01:40 PM
The specification provides some examples and is well-suited as a tutorial
http://www.opengl.org/registry/specs/EXT/framebuffer_object.txt