Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

  1. #1
    Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    466

    strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    Hi

    while playing around with the texture environment setting GL_COMBINE I discovered something nice.

    As you know there are separate calculations done for RGB and ALPHA. You set RGB function with GL_COMBINE_RGB and ALPHA function with GL_COMBINE_ALPHA.

    For GL_COMBINE_RGB the valid GL_OPERANDn_RGB are GL_SRC_COLOR,GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA

    For GL_COMBINE_ALPHA the valid GL_OPERANDn_ALPHA are GL_SRC_ALPHA and GL_ONE_MINUS_SRC_ALPHA

    But when I use GL_SRC_COLOR or GL_ONE_MINUS_SRC_COLOR for GL_COMBINE_ALPHA I don't get a error!. Instead the alpha value is the greyscale version of the rgb value!!!.

    Sounds interesting. Can anyone verify this on other cards? Perhaps matt?

    I use a GeForce4 TI 4600 with 41.03 drivers.

    Bye
    ScottManDeath

  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2001
    Location
    Wake Forest, NC, USA
    Posts
    176

    Re: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    I wasn't aware of the ability to route color to RGB using ARB_texture_env_combine. It is possible in an odd NV_register_combiners mode (I think you can route blue to alpha).

    Looking at our driver source, it certainly appears that trying to set GL_OPERANDn_ALPHA to GL_SRC_COLOR or GL_ONE_MINUS_SRC_COLOR should result in an error. You can check by calling glGetError(). Such calls should not change whatever state you have set. Perhaps something else makes it look like you're getting color?

    Pat

  3. #3
    Member Regular Contributor
    Join Date
    Mar 2001
    Posts
    466

    Re: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    Hi

    indeed, the alpha value gets assigned from the blue channel. I recognized this behaviour in 2 different programs. I tested again and when I use the primary color as source the blue channel is copied into alpha. After setting all modes I check for GL errors but no one does occur.

    Bye
    ScottManDeath

  4. #4

    Re: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    I've got a GL_LUMINANCE texture and copy the LUMINANCE to alpha. glgeterror returns 0 after the last line. Is this only a bug or the expectable behavior of this extension.

    glTexEnvi(GL_TEXTURE_ENV,GL_COMBINE_ALPHA_EXT,GL_R EPLACE);
    glTexEnvi(GL_TEXTURE_ENV,GL_SOURCE0_ALPHA_EXT,GL_T EXTURE);
    glgeterror;
    glTexEnvi(GL_TEXTURE_ENV,GL_OPERAND0_ALPHA_EXT,GL_ SRC_COLOR);
    showmessage(inttostr(glgeterror)); // shows 0

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    May 2001
    Location
    France
    Posts
    768

    Re: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    Should generate an INVALID_ENUM error for both ARB_texture_env_combine and EXT_terxture_env_combine. Check the specs (errors at the end) at : http://oss.sgi.com/projects/ogl-samp...nv_combine.txt http://oss.sgi.com/projects/ogl-samp...nv_combine.txt

    Haven't looked at OpenGL1.3 specifications, but I guess this would generate an error too.

  6. #6
    Senior Member OpenGL Pro
    Join Date
    Sep 2000
    Location
    Santa Clara, CA
    Posts
    1,463

    Re: strange but nice behaviour of GL_COMBINE_ALPHA mode on a GeForce 4 Ti

    I fixed this bug on 10/28 (SRC_COLOR/ONE_MINUS_SRC_COLOR erroneously allowed for alpha operands). Drivers built after that date will include the fix.

    - Matt

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •