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 2 of 2

Thread: GL_COMBINE_EXT problems

  1. #1
    Intern Contributor
    Join Date
    May 2001
    Location
    Cheltenham,Gloucestershire,England
    Posts
    86

    GL_COMBINE_EXT problems

    hello there,

    im currently trying to get rivers and paths etc
    textured over my terrain using multitexturing with
    combiners, the paths,rivers etc are alpha blended over
    the non alpha channel terrain texture.

    Im using the following code (copied from Tom Nuydens example at delphi3d.net)
    however my primitives are always alpha blended according to tex2,
    Toms example works great ( so its not a driver issue ).

    { Setup the combiner to output (C1*A2) + (C2*(1-A2)), where C1 and C2 are
    the colors of Tex1 and Tex2, and A2 is the alpha of Tex2. }
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
    glTexEnvi(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_INTERPOLATE_EXT);
    // Operand0 is the color of the previous stage (Tex1).
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE0_RGB_EXT, GL_PREVIOUS_EXT);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND0_RGB_EXT, GL_SRC_COLOR);
    // Operand1 is the color of the current stage (Tex2).
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE1_RGB_EXT, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND1_RGB_EXT, GL_SRC_COLOR);
    // Operand2 is the alpha of the current stage (Tex2).
    glTexEnvi(GL_TEXTURE_ENV, GL_SOURCE2_RGB_EXT, GL_TEXTURE);
    glTexEnvi(GL_TEXTURE_ENV, GL_OPERAND2_RGB_EXT, GL_SRC_ALPHA);

    does anyone have any ideas as to why this is.


    Many thanks.

    Mark.

  2. #2
    Intern Contributor
    Join Date
    May 2001
    Location
    Cheltenham,Gloucestershire,England
    Posts
    86

    Re: GL_COMBINE_EXT problems

    Think ive found my problem

    use
    glTexEnvi(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, GL_REPLACE);

    after binding texture unit 1


Posting Permissions

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