PDA

View Full Version : glreadpixels returns garbage



remdul
04-01-2004, 11:35 AM
Hi, I'm having a problem with onscreen and offscreen (double buffered) rendered images under Windows XP.

Whenever a window partially, or entirely overlaps the image glReadPixels returns black pixels, or often just garbage of those areas obscured.

Why does this happen? I thought glReadPixels returns pixels straight from the hardware (thought thats why it was known to be slow). If thats true, could it be a nasty trick from my cards manufacturer to speed up glReadPixels (i.e. not rasterize pixels that are underneath other windows)?

Any alternatives to glReadPixels? Or maybe I have to play some tricks on my window device context?

roffe
04-02-2004, 01:55 AM
Hi, I'm having a problem with onscreen and offscreen (double buffered) rendered images under Windows XP.

Just because you use double buffering does not mean it's off-screen rendering. You have to use pbuffers to make use of off-screen rendering.



Whenever a window partially, or entirely overlaps the image glReadPixels returns black pixels, or often just garbage of those areas obscured.

Reading back pixels that fail the pixelownership test results in undefined behaviour. This is defined by the spec.



Any alternatives to glReadPixels?
No, not really.

remdul
04-02-2004, 08:07 AM
I see, makes sense.

Is there a way to reclaim these pixels?

Can I trick Windows not to own the clipped areas, or make it believe the pixels are owned by the OpenGL plane?

roffe
04-02-2004, 11:51 AM
No and no from what I know.