Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: glreadpixels returns garbage

  1. #1
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    glreadpixels returns garbage

    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?

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    366

    Re: glreadpixels returns garbage

    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.

  3. #3
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    Re: glreadpixels returns garbage

    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?

  4. #4
    Member Regular Contributor
    Join Date
    Jun 2002
    Posts
    366

    Re: glreadpixels returns garbage

    No and no from what I know.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •