2014-03-28 19:06:55 +00:00
<!DOCTYPE refentry [ <!ENTITY % mathent SYSTEM "math.ent"> %mathent; ]>
<!-- Converted by db4 - upgrade version 1.1 -->
<refentry xmlns= "http://docbook.org/ns/docbook" version= "5.0" xml:id= "glBlendEquation" >
<info >
2013-11-03 11:43:50 +00:00
<copyright >
<year > 1991-2006</year>
<holder > Silicon Graphics, Inc.</holder>
</copyright>
2013-12-15 21:32:32 +00:00
<copyright >
<year > 2010-2013</year>
<holder > Khronos Group</holder>
</copyright>
2014-03-28 19:06:55 +00:00
</info>
2009-03-08 00:46:58 +00:00
<refmeta >
<refentrytitle > glBlendEquation</refentrytitle>
<manvolnum > 3G</manvolnum>
</refmeta>
<refnamediv >
<refname > glBlendEquation</refname>
<refpurpose > specify the equation used for both the RGB blend equation and the Alpha blend equation</refpurpose>
</refnamediv>
<refsynopsisdiv > <title > C Specification</title>
<funcsynopsis >
<funcprototype >
<funcdef > void <function > glBlendEquation</function> </funcdef>
<paramdef > GLenum <parameter > mode</parameter> </paramdef>
</funcprototype>
2013-10-23 18:17:08 +00:00
<funcprototype >
<funcdef > void <function > glBlendEquationi</function> </funcdef>
<paramdef > GLuint <parameter > buf</parameter> </paramdef>
<paramdef > GLenum <parameter > mode</parameter> </paramdef>
</funcprototype>
2009-03-08 00:46:58 +00:00
</funcsynopsis>
</refsynopsisdiv>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "parameters" > <title > Parameters</title>
2009-03-08 00:46:58 +00:00
<variablelist >
2013-10-23 18:17:08 +00:00
<varlistentry >
<term > <parameter > buf</parameter> </term>
<listitem >
<para >
for <function > glBlendEquationi</function> , specifies the index of the draw buffer
for which to set the blend equation.
</para>
</listitem>
</varlistentry>
2009-03-08 00:46:58 +00:00
<varlistentry >
<term > <parameter > mode</parameter> </term>
<listitem >
<para >
specifies how source and destination colors are combined.
It must be <constant > GL_FUNC_ADD</constant> , <constant > GL_FUNC_SUBTRACT</constant> ,
<constant > GL_FUNC_REVERSE_SUBTRACT</constant> , <constant > GL_MIN</constant> , <constant > GL_MAX</constant> .
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "description" > <title > Description</title>
2009-03-08 00:46:58 +00:00
<para >
The blend equations determine how a new pixel (the ''source'' color)
is combined with a pixel already in the framebuffer (the ''destination''
2013-11-03 11:43:50 +00:00
color). This function sets both the RGB blend equation and the alpha
2013-10-23 18:17:08 +00:00
blend equation to a single equation. <function > glBlendEquationi</function>
specifies the blend equation for a single draw buffer whereas <function > glBlendEquation</function>
sets the blend equation for all draw buffers.
2009-03-08 00:46:58 +00:00
</para>
<para >
These equations use the source and destination blend factors
specified by either <citerefentry > <refentrytitle > glBlendFunc</refentrytitle> </citerefentry> or
<citerefentry > <refentrytitle > glBlendFuncSeparate</refentrytitle> </citerefentry> .
See <citerefentry > <refentrytitle > glBlendFunc</refentrytitle> </citerefentry> or <citerefentry > <refentrytitle > glBlendFuncSeparate</refentrytitle> </citerefentry>
for a description of the various blend factors.
</para>
<para >
In the equations that follow, source and destination
color components are referred to as
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: ( R sub s, G sub s, B sub s, A sub s ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation>
and
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: ( R sub d, G sub d, B sub d, A sub d ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> ,
respectively.
The result color is referred to as
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: ( R sub r, G sub r, B sub r, A sub r ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > r</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > r</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > r</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > r</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> .
The source and destination blend factors are denoted
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: ( s sub R, s sub G, s sub B, s sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation>
and
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: ( d sub R, d sub G, d sub B, d sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> ,
respectively.
For these equations all color components are understood to have values
2013-11-03 11:43:50 +00:00
in the range
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: [0,1]: -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "[" close= "]" >
<mml:mn > 0</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
</mml:math> </inlineequation> .
2013-12-15 21:32:32 +00:00
<informaltable >
2009-03-08 00:46:58 +00:00
<tgroup cols= "3" align= "left" >
2014-03-28 19:06:55 +00:00
<colspec colwidth= "1.1*" />
<colspec colwidth= "1*" />
<colspec colwidth= "1*" />
2009-03-08 00:46:58 +00:00
<thead >
<row >
2013-12-15 21:32:32 +00:00
<entry >
<emphasis role= "bold" > Mode </emphasis>
</entry>
<entry >
<emphasis role= "bold" > RGB Components </emphasis>
</entry>
<entry >
<emphasis role= "bold" > Alpha Component </emphasis>
</entry>
2009-03-08 00:46:58 +00:00
</row>
</thead>
<tbody >
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_FUNC_ADD</constant>
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Rr = R sub s s sub R + R sub d d sub R : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Rr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:mo > +</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Gr = G sub s s sub G + G sub d d sub G : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Gr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:mo > +</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Br = B sub s s sub B + B sub d d sub B : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Br</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:mo > +</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Ar = A sub s s sub A + A sub d d sub A : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Ar</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
<mml:mo > +</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_FUNC_SUBTRACT</constant>
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Rr = R sub s s sub R - R sub d d sub R : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Rr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Gr = G sub s s sub G - G sub d d sub G : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Gr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Br = B sub s s sub B - B sub d d sub B : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Br</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Ar = A sub s s sub A - A sub d d sub A : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Ar</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_FUNC_REVERSE_SUBTRACT</constant>
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Rr = R sub d d sub R - R sub s s sub R : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Rr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Gr = G sub d d sub G - G sub s s sub G : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Gr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Br = B sub d d sub B - B sub s s sub B : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Br</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Ar = A sub d d sub A - A sub s s sub A : -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Ar</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
2010-11-21 14:34:29 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > d</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
<mml:mo > ⁢ </mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > s</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
2009-03-08 00:46:58 +00:00
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_MIN</constant>
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Rr = min ( R sub s, R sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Rr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Gr = min ( G sub s, G sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Gr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Br = min ( B sub s, B sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Br</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Ar = min ( A sub s, A sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Ar</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_MAX</constant>
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Rr = max ( R sub s, R sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Rr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > max</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Gr = max ( G sub s, G sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Gr</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > max</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Br = max ( B sub s, B sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Br</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > max</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: Ar = max ( A sub s, A sub d): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > Ar</mml:mi>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > max</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
</mml:msub>
</mml:mrow>
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
<para >
2013-11-03 11:43:50 +00:00
The results of these equations are clamped to the range
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2010-11-21 14:34:29 +00:00
<!-- eqn: [0,1]: -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "[" close= "]" >
<mml:mn > 0</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
</mml:math> </inlineequation> .
</para>
<para >
The <constant > GL_MIN</constant> and <constant > GL_MAX</constant> equations are useful for applications
that analyze image data (image thresholding against a constant color,
for example).
The <constant > GL_FUNC_ADD</constant> equation is useful
for antialiasing and transparency, among other things.
</para>
<para >
Initially, both the RGB blend equation and the alpha blend equation are set to <constant > GL_FUNC_ADD</constant> .
</para>
<para >
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "notes" > <title > Notes</title>
2009-03-08 00:46:58 +00:00
<para >
The <constant > GL_MIN</constant> , and <constant > GL_MAX</constant> equations do not use
the source or destination factors, only the source and destination colors.
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "errors" > <title > Errors</title>
2009-03-08 00:46:58 +00:00
<para >
<constant > GL_INVALID_ENUM</constant> is generated if <parameter > mode</parameter> is not one of
<constant > GL_FUNC_ADD</constant> , <constant > GL_FUNC_SUBTRACT</constant> , <constant > GL_FUNC_REVERSE_SUBTRACT</constant> ,
<constant > GL_MAX</constant> , or <constant > GL_MIN</constant> .
</para>
2013-10-23 18:17:08 +00:00
<para >
<constant > GL_INVALID_VALUE</constant> is generated by <function > glBlendEquationi</function> if <parameter > buf</parameter> is greater
than or equal to the value of <constant > GL_MAX_DRAW_BUFFERS</constant> .
</para>
2009-03-08 00:46:58 +00:00
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "associatedgets" > <title > Associated Gets</title>
2009-03-08 00:46:58 +00:00
<para >
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with an argument of <constant > GL_BLEND_EQUATION_RGB</constant>
</para>
<para >
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with an argument of <constant > GL_BLEND_EQUATION_ALPHA</constant>
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "seealso" > <title > See Also</title>
2009-03-08 00:46:58 +00:00
<para >
<citerefentry > <refentrytitle > glBlendColor</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glBlendFunc</refentrytitle> </citerefentry>
<citerefentry > <refentrytitle > glBlendFuncSeparate</refentrytitle> </citerefentry>
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "Copyright" > <title > Copyright</title>
2009-03-08 00:46:58 +00:00
<para >
2014-03-28 19:06:55 +00:00
Copyright <trademark class= "copyright" /> 1991-2006 Silicon Graphics, Inc.
Copyright <trademark class= "copyright" /> 2010-2013 Khronos Group.
2013-12-15 21:32:32 +00:00
This document is licensed under the SGI Free Software B License.
For details, see
2014-03-28 19:06:55 +00:00
<link xmlns:xlink= "http://www.w3.org/1999/xlink" xlink:href= "http://oss.sgi.com/projects/FreeB/" > http://oss.sgi.com/projects/FreeB/</link> .
2009-03-08 00:46:58 +00:00
</para>
</refsect1>
</refentry>