PDA

View Full Version : the alpha value from the screen



Mar
10-24-2001, 08:38 AM
Hi!
I've problems with the alpha value when I read from a textured image from the screen.
First of all, I use glReadPixels(0,0,width,hight,GL_RGBA,GL_UNSIGNED_B YTE, *frame);
After chanching the Blue with the Red values, I get a tga file. But when I see it with the Photoshop, the alpha chanel is completely white!!
Can I read RGBA from the screen or I can get only RGB values?

Korval
10-24-2001, 10:54 AM
Did you set your framebuffer to store RGBA values? If you're using a 16-bit framebuffer, you don't get the alpha component.

Mar
10-25-2001, 01:48 AM
No, actually I've defined the framebuffer as GLbyte framebuffer[width][height][4].
Then I put every R, G, B or A values in a GLubyte.

Bob
10-26-2001, 02:27 AM
The framebuffer is where OpenGL draws everything. In other words, the window, or the viewport. Does the windows pixelformat contain an alpha channel?

Mar
10-26-2001, 08:19 AM
What do you mean? I have declared my windows
glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);

Is it enough or I've to use another function about the pixel format?