Results 1 to 2 of 2

Thread: how to use texture combiners?

  1. #1
    Member Contributor
    Join Date
    May 2010

    how to use texture combiners?


    I am having a hard time finding good information about texture combiners. Can they be used to draw a texture half-transparently? The texture already has its own alpha mask which defines its shape. But I want to draw the whole thing at a specifiable level of transparency.

    I know that ordinarily you would use glColor and blend mode to do this. But it isn't working, and I am wondering if I have my combiner set up incorrectly.

    It's really unclear to me what the relationship is between the blending mode setting and the combiner settings. Is there a good reference for learning about that?


  2. #2
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    There's no relationship between the combine state and the blending state; the output of the per-fragment stage (set via the combiner mode) is used as input to the blending stage (set via the blend mode) (potentially after going through some other tests which don't really concern us here) so all that the blend stage needs is some form of input; it doesn't really care about what kind of states were used to get that input.

    In your case, glColor (1, 1, 1, 0.5) with an old-fashioned TexEnv of GL_MODULATE (i.e. no combines needed) will get you an output from the per-fragment stage that contains alpha 0.5. Then setting up a glBlendFunc of (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), together with glEnable (GL_BLEND) (of course) should be all you need.

    I'm curious what you mean by "it isn't working" here. You really should post some code so that we can help you properly because this is something that should work.

    It's also the case that if you're talking about using GL_COMBINE modes, you're really at the stage where you should be seriously considering shaders instead.

Similar Threads

  1. Texture combiners
    By red_gfx in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-24-2009, 02:55 PM
  2. Texture combiners
    By muratmat in forum OpenGL ES
    Replies: 2
    Last Post: 02-06-2009, 04:20 AM
  3. glColor with multi-texture / texture combiners
    By Quasius in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 08-12-2008, 02:20 PM
  4. Combiners and 2 texture units
    By ChadIsBad in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-19-2005, 10:17 PM
  5. texture combiners
    By Bruno in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-18-2004, 01:26 PM

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