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: Problems with glReadPixels???

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    16

    Problems with glReadPixels???

    I have a textured scene and I read the frame buffer using:

    glReadPixels (0, 0, winWidth, winHeight, GL_RGB, GL_UNSIGNED_BYTE, frameBuffer);

    Than I write them in TGA format and mostly everything is OK. Mainly I get the correct images.

    Anyway if I change only the texture files - sometimes only rotate a texture image in an external program-
    I get distorted images (starting from below some parts are good and than some are shifted in
    horizontal direction).
    1. something strange is happening inside glReadPixels?
    2. it is hardware-dependent - I get differently distorted images on different computers

    Does anybody know what is happening and how to avoid these problems????

  2. #2
    Intern Contributor
    Join Date
    Feb 2000
    Location
    Italy
    Posts
    77

    Re: Problems with glReadPixels???

    I would call glFlush before reading pixels.
    Have you tried?
    --
    Paolo M.

  3. #3
    Advanced Member Frequent Contributor cass's Avatar
    Join Date
    Feb 2000
    Location
    Austin, TX, USA
    Posts
    913

    Re: Problems with glReadPixels???

    Also, make sure all your glPixelTransfer*() parameters are as you would expect. This is a common gotcha.
    Cass Everitt -- cass@xyzw.us

  4. #4
    Junior Member Newbie
    Join Date
    Feb 2000
    Location
    The Netherlands
    Posts
    16

    Re: Problems with glReadPixels???

    Thank you for your wish to help me but it doesn't work!
    1. glFlush has nothing to do with it but I tried it anyway!
    2. the same for glPixelTransfer!

    Two more conclusion from the tests I made:
    1. The problem occures ONLY for textured images (and not always as I have already described)!
    2. The glCopyPixels is working properly so the problem is in transfering the data into the processor memory!
    I have set GL_PACK_ALIGNMENT to 1 (glPixel Store) but that doesn't help also!

    I don't see any solution ?
    Please HELP!!!

Posting Permissions

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