-
the alpha value from the screen
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?
-
Senior Member
OpenGL Guru
Re: the alpha value from the screen
Did you set your framebuffer to store RGBA values? If you're using a 16-bit framebuffer, you don't get the alpha component.
-
Re: the alpha value from the screen
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.
-
Senior Member
OpenGL Guru
Re: the alpha value from the screen
The framebuffer is where OpenGL draws everything. In other words, the window, or the viewport. Does the windows pixelformat contain an alpha channel?
-
Re: the alpha value from the screen
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?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules