PDA

View Full Version : glCopyTexSubImage2D and pbuffer



azcoder
01-11-2005, 08:35 PM
Thanks in advance - I am driving myself nuts on this one....

I am trying to read the color buffer from a pbuffer into a texture using glCopyTexSubImage2D. I am unclear what the pixel format of the texture should be:

Currently I define the texture with:
glTexImage2D(GL_TEXTURE_2D,0,GL_RGBA,TEX_SIZE,TEX_ SIZE,0,GL_RGBA,GL_UNSIGNED_BYTE,0);

I copy the texture from a bound pbuffer with:

glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, TEX_SIZE,TEX_SIZE);

The texture is showing up as solid red, when it should be white (that is what the pbuffer is cleared to.)

The pbuffer is created with:
WGL_PBUFFER_LARGEST_ARB

and the requested pixel format with:
WGL_DRAW_TO_PBUFFER_ARB
WGL_SUPPORT_OPENGL_ARB

wglGetPixelFormatAttribivARB states the returned format is r8 g8 b8 a8 with depth=24.

Thanks again for any help....

Guido
01-11-2005, 10:26 PM
Probably it's my same problem, see "A really strange problem with NVdia's driver" in this same forum...

Which is your graphic board???