Results 1 to 2 of 2

Thread: Texture data doesn't match Frame Buffer Contents

  1. #1
    Member Contributor
    Join Date
    Feb 2006
    Posts
    60

    Texture data doesn't match Frame Buffer Contents

    I generate a texture (GL_RGBA) via a fragment shader. I map this to a full screen quad and render. I read the contents of the frame buffer back and the data does not match.... When generating the texture, I set all texels to (191, 191, 4). When reading back (via glReadPixels), all texels are (189, 190, 0). It's close, but not the same... What's more, the Blue component stair steps... In the table below, A is the value I set Blue to in the texture and B is the Blue value read back from the frame buffer using glReadPixels....

    Any ideas what's going on here?

    CD

    Code :
    A       B
    ----------
    0	0
    1	0
    2	0
    3	0
    4	0
    5	0
    6	0
    7	0
    8	8
    9	8
    10	8
    11	8
    12	8
    13	8
    14	8
    15	8
    16	16
    17	16
    18	16
    19	16
    20	16
    21	16
    22	16
    23	16
    24	25
    25	25
    26	25
    27	25
    28	25
    29	25
    30	25
    31	25
    32	33
    33	33
    34	33
    35	33
    36	33
    37	33
    38	33
    39	33
    40	41
    41	41
    42	41
    43	41
    44	41
    45	41
    46	41
    47	41
    48	49
    49	49
    50	49
    51	49
    52	49
    53	49
    54	49
    55	49
    56	58
    57	58
    58	58
    59	58
    60	58
    61	58
    62	58
    63	58
    64	66

  2. #2
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: Texture data doesn't match Frame Buffer Contents

    Check your framebuffer format if you're in true color (R8G8B and not in 16-bit highcolor (R5G6B5).
    Your texture internalFormat should be GL_RGBA8, not GL_RGBA (== 4 components from OpenGL 1.1 times).

Similar Threads

  1. can't bind a texture depth buffer to a frame buffer
    By sczybt in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-23-2014, 06:37 AM
  2. Copying back buffer contents into a texture
    By JaakK in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-23-2012, 07:19 AM
  3. Copy frame data to texture
    By Klarkshroder in forum OpenGL: Basic Coding
    Replies: 14
    Last Post: 03-15-2011, 03:43 AM
  4. How to convert the contents in frame buffer into a 2D array?
    By powervr in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 09-16-2004, 05:04 AM
  5. Data in frame buffer
    By Rajiv Mishra in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-27-2001, 09:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean