Zeno
04-05-2001, 03:56 PM
Hi all. This seems like a dumb question, but I can't figure out what I'm doing wrong.
Does glCopyTexSubImage2D() copy alpha values as well? It doesn't seem like it based on what I'm getting, but I think it should.
I've narrowed it down to a test like this:
// Fill texturemap with completely transparent color (black)
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, x, y);
// Clear screen to white
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
// Rest of code draws textured poly over the entire screen
I have blending enabled with (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and am using texture blend mode GL_MODULATE.
Now, you would expect this to give a white screen since the textured poly has alpha=0. Unfortunately, the screen shows up black!?
Am I doing something wrong here? Could this be a driver bug? (I'm using 11.0) Any ideas would be greatly appreciated.
Thanks,
-- Zeno
Does glCopyTexSubImage2D() copy alpha values as well? It doesn't seem like it based on what I'm getting, but I think it should.
I've narrowed it down to a test like this:
// Fill texturemap with completely transparent color (black)
glClearColor(0.0, 0.0, 0.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, x, y);
// Clear screen to white
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
// Rest of code draws textured poly over the entire screen
I have blending enabled with (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) and am using texture blend mode GL_MODULATE.
Now, you would expect this to give a white screen since the textured poly has alpha=0. Unfortunately, the screen shows up black!?
Am I doing something wrong here? Could this be a driver bug? (I'm using 11.0) Any ideas would be greatly appreciated.
Thanks,
-- Zeno