View Full Version : glCopyTexImage2D
06-02-2005, 12:32 PM
i am using glCopyTexImage2D with an internal format of GL_RGBA on windows and i cannot get the proper alpha info copied over from the color buffer it seems or am not getting any at all. i am rendering to a texture obviously and then attempting to blend or replace the texture alphas with the primitive color it is attached to ( via GL_DECAL ). i can get the blending to work properly with a texture i load myself. i can also get this to work on mac no problem with rendering to the texture ( same texture code or ogl code ). the problem is explicitly with copying the color buffer contents on windows it seems.
has anyone ever encountered this problem?? i would have put this in the windows forum as it is windows specific but my app is cross platform and it looks like i would get more people to look at it here. and i do not want to cross post.
06-02-2005, 11:51 PM
Sounds like your window doesn't have a destination alpha channel. I don't know how to request this on windows, look in the documentation of the pixel format functions. Also make sure you really get the pixel format you request, maybe your particular combination of bit depth/alpha depth is just not supported by your card.
As an alternative you could use the FBO extension to render directly to the texture, then you don't have this problem. It is fairly new and AFAIK not yet supported by ATI drivers, on NVIDIA it is supported in their latest Linux drivers and in the inofficial windows drivers (>= 75.90 I think).
06-03-2005, 05:57 AM
yeah that is it.
there is a cAlphaBits member in the PIXELFORMATDESCRIPTOR struct and i knew it was there, but the microsoft docs said that it was not supported, so i never tried it. i decided to try it anyways now and it works. must have old documentation or something.
06-03-2005, 06:00 AM
The most likely explanation is that you're in a 16bpp display mode, where you'll (most of the time anyway) get an R5G6B5 color format. And as long as there's no alpha in the framebuffer, CopyTexImage will just insert some default value into the texture.
Double-check that your display is at 32bpp when you set your pixel format, and it stays that way until you close the window.
06-03-2005, 06:18 AM
It is not supported with the MS software implementation of OpenGL, perhaps that's what the documentation means...
06-03-2005, 11:18 AM
i was definitely in 32 bit display mode. it was the pixelformatdescriptor.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.