'\" t
.\"     Title: glBlendEquationSeparate
.\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
.\"      Date: 03/08/2011
.\"    Manual: OpenGL 3.3
.\"    Source: OpenGL 3.3
.\"  Language: English
.\"
.TH "GLBLENDEQUATIONSEPAR" "3G" "03/08/2011" "OpenGL 3.3" "OpenGL 3\&.3"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
glBlendEquationSeparate \- set the RGB blend equation and the alpha blend equation separately
.SH "C SPECIFICATION"
.HP \w'void\ glBlendEquationSeparate('u
.BI "void glBlendEquationSeparate(GLenum\ " "modeRGB" ", GLenum\ " "modeAlpha" ");"
.SH "PARAMETERS"
.PP
\fImodeRGB\fR
.RS 4
specifies the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined\&. It must be
\fBGL_FUNC_ADD\fR,
\fBGL_FUNC_SUBTRACT\fR,
\fBGL_FUNC_REVERSE_SUBTRACT\fR,
\fBGL_MIN\fR,
\fBGL_MAX\fR\&.
.RE
.PP
\fImodeAlpha\fR
.RS 4
specifies the alpha blend equation, how the alpha component of the source and destination colors are combined\&. It must be
\fBGL_FUNC_ADD\fR,
\fBGL_FUNC_SUBTRACT\fR,
\fBGL_FUNC_REVERSE_SUBTRACT\fR,
\fBGL_MIN\fR,
\fBGL_MAX\fR\&.
.RE
.SH "DESCRIPTION"
.PP
The blend equations determines how a new pixel (the \*(Aq\*(Aqsource\*(Aq\*(Aq color) is combined with a pixel already in the framebuffer (the \*(Aq\*(Aqdestination\*(Aq\*(Aq color)\&. This function specifies one blend equation for the RGB\-color components and one blend equation for the alpha component\&.
.PP
The blend equations use the source and destination blend factors specified by either
\fBglBlendFunc\fR()
or
\fBglBlendFuncSeparate\fR()\&. See
\fBglBlendFunc\fR()
or
\fBglBlendFuncSeparate\fR()
for a description of the various blend factors\&.
.PP
In the equations that follow, source and destination color components are referred to as
R s G s B s A s
and
R d G d B d A d, respectively\&. The result color is referred to as
R r G r B r A r\&. The source and destination blend factors are denoted
s R s G s B s A
and
d R d G d B d A, respectively\&. For these equations all color components are understood to have values in the range
0 1\&.
.TS
allbox tab(:);
lB lB lB.
T{
\fB
                        Mode
                        \fR
T}:T{
\fB
                        RGB Components
                        \fR
T}:T{
\fB
                        Alpha Component
                        \fR
T}
.T&
l l l
l l l
l l l
l l l
l l l.
T{
\fBGL_FUNC_ADD\fR
T}:T{
<div>
                            
                            
                                Rr
                                =
                                
									R
									s
									
									⁢
									s
									R
									
									+
									R
									d
									
									⁢
									d
									R
									
                                
                            
                        </div>
                        <div>
                            
                            
                                Gr
                                =
                                
									G
									s
									
									⁢
									s
									G
									
									+
									G
									d
									
									⁢
									d
									G
									
                                
                            
                        </div>
                        <div>
                            
                            
                                Br
                                =
                                
									B
									s
									
									⁢
									s
									B
									
									+
									B
									d
									
									⁢
									d
									B
									
                                
                            
                        </div>
T}:T{
<div>
                            
                            
                                Ar
                                =
                                
									A
									s
									
									⁢
									s
									A
									
									+
									A
									d
									
									⁢
									d
									A
									
                                
                            
                        </div>
T}
T{
\fBGL_FUNC_SUBTRACT\fR
T}:T{
<div>
                            
                            
                                Rr
                                =
                                
									R
									s
									
									⁢
									s
									R
									
									\-
									R
									d
									
									⁢
									d
									R
									
                                
                            
                        </div>
                        <div>
                            
                            
                                Gr
                                =
                                
									G
									s
									
									⁢
									s
									G
									
									\-
									G
									d
									
									⁢
									d
									G
									
                                
                            
                        </div>
                        <div>
                            
                            
                                Br
                                =
                                
									B
									s
									
									⁢
									s
									B
									
									\-
									B
									d
									
									⁢
									d
									B
									
                                
                            
                        </div>
T}:T{
<div>
                            
                            
                                Ar
                                =
                                
									A
									s
									
									⁢
									s
									A
									
									\-
									A
									d
									
									⁢
									d
									A
									
                                
                            
                        </div>
T}
T{
\fBGL_FUNC_REVERSE_SUBTRACT\fR
T}:T{
<div>
                                
                                
                                    Rr
                                    =
                                    
										R
										d
										
										⁢
										d
										R
										
										\-
										R
										s
										
										⁢
										s
										R
										
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Gr
                                    =
                                    
										G
										d
										
										⁢
										d
										G
										
										\-
										G
										s
										
										⁢
										s
										G
										
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Br
                                    =
                                    
										B
										d
										
										⁢
										d
										B
										
										\-
										B
										s
										
										⁢
										s
										B
										
                                    
                                
                            </div>
T}:T{
<div>
                                
                                
                                    Ar
                                    =
                                    
										A
										d
										
										⁢
										d
										A
										
										\-
										A
										s
										
										⁢
										s
										A
										
                                    
                                
                            </div>
T}
T{
\fBGL_MIN\fR
T}:T{
<div>
                                
                                
                                    Rr
                                    =
                                    
                                        min
                                        ⁡
                                        
                                            
                                                R
                                                s
                                                
                                            
                                            
                                                R
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Gr
                                    =
                                    
                                        min
                                        ⁡
                                        
                                            
                                                G
                                                s
                                                
                                            
                                            
                                                G
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Br
                                    =
                                    
                                        min
                                        ⁡
                                        
                                            
                                                B
                                                s
                                                
                                            
                                            
                                                B
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
T}:T{
<div>
                                
                                
                                    Ar
                                    =
                                    
                                        min
                                        ⁡
                                        
                                            
                                                A
                                                s
                                                
                                            
                                            
                                                A
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
T}
T{
\fBGL_MAX\fR
T}:T{
<div>
                                
                                
                                    Rr
                                    =
                                    
                                        max
                                        ⁡
                                        
                                            
                                                R
                                                s
                                                
                                            
                                            
                                                R
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Gr
                                    =
                                    
                                        max
                                        ⁡
                                        
                                            
                                                G
                                                s
                                                
                                            
                                            
                                                G
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
                            <div>
                                
                                
                                    Br
                                    =
                                    
                                        max
                                        ⁡
                                        
                                            
                                                B
                                                s
                                                
                                            
                                            
                                                B
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
T}:T{
<div>
                                
                                
                                    Ar
                                    =
                                    
                                        max
                                        ⁡
                                        
                                            
                                                A
                                                s
                                                
                                            
                                            
                                                A
                                                d
                                                
                                            
                                        
                                    
                                
                            </div>
T}
.TE
.sp 1
.PP
The results of these equations are clamped to the range
0 1\&.
.PP
The
\fBGL_MIN\fR
and
\fBGL_MAX\fR
equations are useful for applications that analyze image data (image thresholding against a constant color, for example)\&. The
\fBGL_FUNC_ADD\fR
equation is useful for antialiasing and transparency, among other things\&.
.PP
Initially, both the RGB blend equation and the alpha blend equation are set to
\fBGL_FUNC_ADD\fR\&.
.PP
.SH "NOTES"
.PP
The
\fBGL_MIN\fR, and
\fBGL_MAX\fR
equations do not use the source or destination factors, only the source and destination colors\&.
.SH "ERRORS"
.PP

\fBGL_INVALID_ENUM\fR
is generated if either
\fImodeRGB\fR
or
\fImodeAlpha\fR
is not one of
\fBGL_FUNC_ADD\fR,
\fBGL_FUNC_SUBTRACT\fR,
\fBGL_FUNC_REVERSE_SUBTRACT\fR,
\fBGL_MAX\fR, or
\fBGL_MIN\fR\&.
.SH "ASSOCIATED GETS"
.PP

\fBglGet\fR()
with an argument of
\fBGL_BLEND_EQUATION_RGB\fR
.PP

\fBglGet\fR()
with an argument of
\fBGL_BLEND_EQUATION_ALPHA\fR
.SH "SEE ALSO"
.PP

\fBglGetString\fR(),
\fBglBlendColor\fR(),
\fBglBlendFunc\fR(),
\fBglBlendFuncSeparate\fR()
.SH "COPYRIGHT"
.PP
Copyright
\(co
2006 Khronos Group\&. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1\&.0, 8 June 1999\&.
\m[blue]\fBhttp://opencontent\&.org/openpub/\fR\m[]\&.
