Results 1 to 5 of 5

Thread: the alpha value from the screen

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    6

    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?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Mar 2001
    Posts
    3,574

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    6

    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.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    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?

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    Castellon, Spain
    Posts
    6

    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?

Similar Threads

  1. Replies: 1
    Last Post: 08-03-2012, 12:13 AM
  2. Replies: 3
    Last Post: 06-16-2011, 12:51 PM
  3. Alpha Buffer / Alpha Bits
    By Ankillito in forum OpenGL: Basic Coding
    Replies: 9
    Last Post: 04-28-2010, 06:37 AM
  4. alpha blending without modifying destination alpha
    By GordAllott in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 09-21-2009, 04:15 AM
  5. Source Alpha Blending without an Alpha Buffer
    By niallm in forum OpenGL ES
    Replies: 1
    Last Post: 06-18-2009, 02:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean