Where does the GL_CONST_COLOR or GL_CONSTANT_ALPHA come from?

Member
Posts: 321
Joined: 2004.10
Post: #1
This is probably right in front of me, but i've read the blending
section in chapter 6 Red Book about glBlendFunc() and even the
glBlendEquation() about ten times to no avail.

Where does the GL_CONST_COLOR or GL_CONSTANT_ALPHA come from?

Is this just the current setting of glColor4f( r, g, b, alpha) or is it
a different mechanism entirely?

Sorry.
Quote this message in a reply
DoG
Moderator
Posts: 869
Joined: 2003.01
Post: #2
You could read the man pages, as always. To make it short, you can specify a blend color (with glBlendColor(), surprise, surprise) and those constants refer to that color.
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #3
Code:
NOTES
       glBlendColor  is  part  of  the  GL_ARB_imaging subset. glBlendColor is
       present only if GL_ARB_imaging is returned when glGetString  is  called
       with GL_EXTENSIONS as its argument.
Quote this message in a reply
Member
Posts: 47
Joined: 2004.07
Post: #4
In practice, that means that it works on any Geforce, Radeon8000 & up

Nicholas Francis
http://www.otee.dk
Quote this message in a reply
Member
Posts: 321
Joined: 2004.10
Post: #5
DoG Wrote:You could read the man pages, as always. To make it short, you can specify a blend color (with glBlendColor(), surprise, surprise) and those constants refer to that color.


Thanks. I'm running OS 9 on a G3 so I don't have access to man pages.
But I will on my new G5 imac when Tiger comes out!

glBlendColor() isn't even in the Third Edition version 1.2 Red Book.
Or at least it is not in the index.
Quote this message in a reply
Moderator
Posts: 335
Joined: 2002.04
Post: #6
That's because it's glBlendFunc(src,dest) Wink

If you're just starting in GL, define yourself 2 functions

#define DrawModeNormal glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA)
#define DrawModeAdditive glBlendFunc(GL_SRC_ALPHA,GL_ONE)

do DrawModeNormal; for most drawing situations (it'll blend based on the alpha channel in the texture). when you want to do more glowy stuff do DrawModeAdditive;

enjoy Wink
Quote this message in a reply
Sage
Posts: 1,232
Joined: 2002.10
Post: #7
BlendFunc != BlendColor != BlendEquation != BlendFuncSeparate != BlendEquationSeparate.
Quote this message in a reply
Moderator
Posts: 335
Joined: 2002.04
Post: #8
My Bad Smile I'm blaming senility Smile
Quote this message in a reply
Post Reply