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= "glBlendFunc" >
<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 >
2014-03-28 19:06:55 +00:00
<year > 2010-2014</year>
2013-12-15 21:32:32 +00:00
<holder > Khronos Group</holder>
</copyright>
2014-03-28 19:06:55 +00:00
</info>
2009-03-08 00:46:58 +00:00
<refmeta >
<refentrytitle > glBlendFunc</refentrytitle>
<manvolnum > 3G</manvolnum>
</refmeta>
<refnamediv >
<refname > glBlendFunc</refname>
<refpurpose > specify pixel arithmetic</refpurpose>
</refnamediv>
<refsynopsisdiv > <title > C Specification</title>
<funcsynopsis >
<funcprototype >
<funcdef > void <function > glBlendFunc</function> </funcdef>
<paramdef > GLenum <parameter > sfactor</parameter> </paramdef>
<paramdef > GLenum <parameter > dfactor</parameter> </paramdef>
</funcprototype>
</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 >
<varlistentry >
<term > <parameter > sfactor</parameter> </term>
<listitem >
<para >
Specifies how the red, green, blue,
and alpha source blending factors are computed.
The initial value is <constant > GL_ONE</constant> .
</para>
</listitem>
</varlistentry>
<varlistentry >
<term > <parameter > dfactor</parameter> </term>
<listitem >
<para >
Specifies how the red, green, blue,
and alpha destination blending factors are computed.
The following symbolic constants are accepted:
<constant > GL_ZERO</constant> ,
<constant > GL_ONE</constant> ,
<constant > GL_SRC_COLOR</constant> ,
<constant > GL_ONE_MINUS_SRC_COLOR</constant> ,
<constant > GL_DST_COLOR</constant> ,
<constant > GL_ONE_MINUS_DST_COLOR</constant> ,
<constant > GL_SRC_ALPHA</constant> ,
<constant > GL_ONE_MINUS_SRC_ALPHA</constant> ,
<constant > GL_DST_ALPHA</constant> ,
<constant > GL_ONE_MINUS_DST_ALPHA</constant> .
<constant > GL_CONSTANT_COLOR</constant> ,
<constant > GL_ONE_MINUS_CONSTANT_COLOR</constant> ,
<constant > GL_CONSTANT_ALPHA</constant> , and
<constant > GL_ONE_MINUS_CONSTANT_ALPHA</constant> .
The initial value is <constant > GL_ZERO</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 >
2010-11-21 14:34:29 +00:00
Pixels can be drawn using a function that blends
2009-03-08 00:46:58 +00:00
the incoming (source) RGBA values with the RGBA values
that are already in the frame buffer (the destination values).
Blending is initially disabled.
Use <citerefentry > <refentrytitle > glEnable</refentrytitle> </citerefentry> and <citerefentry > <refentrytitle > glDisable</refentrytitle> </citerefentry> with argument <constant > GL_BLEND</constant>
to enable and disable blending.
</para>
<para >
2014-03-28 19:06:55 +00:00
<function > glBlendFunc</function> defines the operation of blending when it is enabled.
2009-03-08 00:46:58 +00:00
<parameter > sfactor</parameter> specifies which method is used to scale the
source color components.
<parameter > dfactor</parameter> specifies which method is used to scale the
destination color components.
2010-11-21 14:34:29 +00:00
Both parameters must be one of the following symbolic constants:
<constant > GL_ZERO</constant> ,
<constant > GL_ONE</constant> ,
<constant > GL_SRC_COLOR</constant> ,
<constant > GL_ONE_MINUS_SRC_COLOR</constant> ,
<constant > GL_DST_COLOR</constant> ,
<constant > GL_ONE_MINUS_DST_COLOR</constant> ,
<constant > GL_SRC_ALPHA</constant> ,
<constant > GL_ONE_MINUS_SRC_ALPHA</constant> ,
<constant > GL_DST_ALPHA</constant> ,
<constant > GL_ONE_MINUS_DST_ALPHA</constant> ,
<constant > GL_CONSTANT_COLOR</constant> ,
<constant > GL_ONE_MINUS_CONSTANT_COLOR</constant> ,
<constant > GL_CONSTANT_ALPHA</constant> ,
<constant > GL_ONE_MINUS_CONSTANT_ALPHA</constant> ,
<constant > GL_SRC_ALPHA_SATURATE</constant> ,
2009-03-08 00:46:58 +00:00
The possible methods are described in the following table.
Each method defines four scale factors,
one each for red, green, blue, and alpha.
2014-03-28 19:06:55 +00:00
In the table and in subsequent equations, source
2010-11-21 14:34:29 +00:00
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" >
<!-- 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>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2010-11-21 14:34:29 +00:00
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> ,
2009-03-08 00:46:58 +00:00
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>
2010-11-21 14:34:29 +00:00
</mml:math> </inlineequation> , respectively.
2009-03-08 00:46:58 +00:00
The color specified by <citerefentry > <refentrytitle > glBlendColor</refentrytitle> </citerefentry> 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 c , G sub c , B sub c , A sub c ): -->
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" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> .
2014-03-28 19:06:55 +00:00
</para>
2009-03-08 00:46:58 +00:00
<para >
Source and destination scale factors 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: ( 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> .
The scale factors described in the table,
2013-11-03 11:43:50 +00:00
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: ( f sub R , f sub G , f sub B , f sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation> ,
represent either source or destination factors.
2013-11-03 11:43:50 +00:00
All scale factors have 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> .
2014-03-28 19:06:55 +00:00
</para>
<para >
Prior to blending, unsigned normalized fixed-point color components undergo
an implied conversion to floating-point using equation 2.1. This conversion must
leave the values 0 and 1 invariant. Blending computations are treated as if carried
out in floating-point and will be performed with a precision and dynamic range no
lower than that used to represent destination components.
If the value of <constant > GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant> for the
framebuffer attachment corresponding to the destination buffer is <constant > GL_SRGB</constant> ,
the R, G, and B destination color values (after conversion from fixed-point
to floating-point) are considered to be encoded for the sRGB color space and
hence must be linearized prior to their use in blending. Each R, G, and B component
is converted in the same fashion described for sRGB texture components.
2009-03-08 00:46:58 +00:00
</para>
<para >
</para>
2013-12-15 21:32:32 +00:00
<informaltable >
2009-03-08 00:46:58 +00:00
<tgroup cols= "2" align= "left" >
<colspec />
<colspec />
<thead >
<row >
2013-12-15 21:32:32 +00:00
<entry >
<emphasis role= "bold" > Parameter </emphasis>
</entry>
<entry >
2014-03-28 19:06:55 +00:00
<emphasis role= "bold" >
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2013-12-15 21:32:32 +00:00
<!-- eqn: ( f sub R , f sub G , f sub B , f sub A ): -->
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > f</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation>
2014-03-28 19:06:55 +00:00
</emphasis>
2013-12-15 21:32:32 +00:00
</entry>
2009-03-08 00:46:58 +00:00
</row>
</thead>
<tbody >
<row >
2013-12-15 21:32:32 +00:00
<entry >
2014-03-28 19:06:55 +00:00
<constant > GL_ZERO</constant>
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: ( 0, 0, 0, 0 ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mn > 0</mml:mn>
<mml:mn > 0</mml:mn>
<mml:mn > 0</mml:mn>
<mml:mn > 0</mml:mn>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE</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: ( 1, 1, 1, 1 ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_SRC_COLOR</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" >
<!-- eqn: ( R sub s / k sub R , G sub s / k sub G , B sub s / k sub B , A sub s / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_SRC_COLOR</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" >
<!-- eqn: ( 1, 1, 1, 1 ) - (R sub s / k sub R , G sub s / k sub G , B sub s / k sub B , A sub s / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_DST_COLOR</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: ( R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_DST_COLOR</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: ( 1, 1, 1, 1 ) - (R sub d / k sub R , G sub d / k sub G , B sub d / k sub B , A sub d / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_SRC_ALPHA</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" >
<!-- eqn: ( A sub s / k sub A , A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_SRC_ALPHA</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" >
<!-- eqn: ( 1, 1, 1, 1 ) - (A sub s / k sub A , A sub s / k sub A , A sub s / k sub A , A sub s / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2014-03-28 19:06:55 +00:00
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_DST_ALPHA</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: ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_DST_ALPHA</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: ( 1, 1, 1, 1 ) - ( A sub d / k sub A , A sub d / k sub A , A sub d / k sub A , A sub d / k sub A ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
<mml:mfrac >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_CONSTANT_COLOR</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: ( R sub c, G sub c, B sub c, A sub c ): -->
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" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_CONSTANT_COLOR</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: ( 1, 1, 1, 1 ) - ( R sub c, G sub c, B sub c, A sub c ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_CONSTANT_ALPHA</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: ( A sub c, A sub c, A sub c, A sub c ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_ONE_MINUS_CONSTANT_ALPHA</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: ( 1, 1, 1, 1 ) - ( A sub c, A sub c, A sub c, A sub c ): -->
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mfenced open= "(" close= ")" >
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
<mml:mn > 1</mml:mn>
</mml:mfenced>
<mml:mo > -</mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > c</mml:mi>
</mml:msub>
</mml:mfenced>
</mml:mrow>
</mml:math> </inlineequation>
</entry>
</row>
<row >
2013-12-15 21:32:32 +00:00
<entry >
2009-03-08 00:46:58 +00:00
<constant > GL_SRC_ALPHA_SATURATE</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: ( i, i, i, 1 ): -->
2009-03-08 00:46:58 +00:00
<mml:mfenced open= "(" close= ")" >
<mml:mi mathvariant= "italic" > i</mml:mi>
<mml:mi mathvariant= "italic" > i</mml:mi>
<mml:mi mathvariant= "italic" > i</mml:mi>
<mml:mn > 1</mml:mn>
</mml:mfenced>
</mml:math> </inlineequation>
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
<para >
In the table,
</para>
<para >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2013-11-03 11:43:50 +00:00
<!-- eqn: i = min (A sub s , k sub A - A sub d ) / k sub A: -->
<mml:mrow >
<mml:mi mathvariant= "italic" > i</mml:mi>
<mml:mo > =</mml:mo>
<mml:mfrac >
2009-03-08 00:46:58 +00:00
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
2013-11-03 11:43:50 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > s</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
<mml:mrow >
2013-11-03 11:43:50 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
2009-03-08 00:46:58 +00:00
</mml:msub>
2013-11-03 11:43:50 +00:00
<mml:mo > -</mml:mo>
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
2009-03-08 00:46:58 +00:00
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
</mml:mrow>
</mml:mfenced>
</mml:mrow>
2013-11-03 11:43:50 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:mfrac>
</mml:mrow>
</mml:math> </inlineequation>
</para>
<para >
To determine the blended RGBA values of a pixel,
the system uses the following equations:
</para>
<para >
2014-03-28 19:06:55 +00:00
<inlineequation > <mml:math xmlns:mml= "http://www.w3.org/1998/Math/MathML" overflow= "scroll" >
2013-11-03 11:43:50 +00:00
<!-- eqn: R sub d = min ( k sub R, R sub s s sub R + R sub d d sub R ): -->
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > R</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > =</mml:mo>
<mml:mrow >
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > R</mml:mi>
</mml:msub>
<mml:mrow >
<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>
</mml:mrow>
</mml:mfenced>
2009-03-08 00:46:58 +00:00
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:mrow>
</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" >
2013-11-03 11:43:50 +00:00
<!-- eqn: G sub d = min ( k sub G, G sub s s sub G + G sub d d sub G ): -->
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > G</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > =</mml:mo>
2009-03-08 00:46:58 +00:00
<mml:mrow >
2013-11-03 11:43:50 +00:00
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
<mml:mrow >
<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>
2009-03-08 00:46:58 +00:00
<mml:mi mathvariant= "italic" > G</mml:mi>
</mml:msub>
2013-11-03 11:43:50 +00:00
<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>
</mml:mrow>
</mml:mfenced>
2009-03-08 00:46:58 +00:00
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:mrow>
</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" >
2013-11-03 11:43:50 +00:00
<!-- eqn: B sub d = min ( k sub B, B sub s s sub B + B sub d d sub B ): -->
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > B</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > =</mml:mo>
2009-03-08 00:46:58 +00:00
<mml:mrow >
2013-11-03 11:43:50 +00:00
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
<mml:mrow >
<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>
2009-03-08 00:46:58 +00:00
<mml:mi mathvariant= "italic" > B</mml:mi>
</mml:msub>
2013-11-03 11:43:50 +00:00
<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>
</mml:mrow>
</mml:mfenced>
2009-03-08 00:46:58 +00:00
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:mrow>
</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" >
2013-11-03 11:43:50 +00:00
<!-- eqn: A sub d = min ( k sub A, A sub s s sub A + A sub d d sub A ): -->
<mml:mrow >
<mml:msub > <mml:mi mathvariant= "italic" > A</mml:mi>
<mml:mi mathvariant= "italic" > d</mml:mi>
</mml:msub>
<mml:mo > =</mml:mo>
2009-03-08 00:46:58 +00:00
<mml:mrow >
2013-11-03 11:43:50 +00:00
<mml:mi mathvariant= "italic" > min</mml:mi>
<mml:mo > ⁡ </mml:mo>
<mml:mfenced open= "(" close= ")" >
<mml:msub > <mml:mi mathvariant= "italic" > k</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
<mml:mrow >
<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>
2009-03-08 00:46:58 +00:00
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
2013-11-03 11:43:50 +00:00
<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>
</mml:mrow>
</mml:mfenced>
2009-03-08 00:46:58 +00:00
</mml:mrow>
2013-11-03 11:43:50 +00:00
</mml:mrow>
</mml:math> </inlineequation>
2009-03-08 00:46:58 +00:00
</para>
<para >
2014-03-28 19:06:55 +00:00
If the value of <constant > GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant> for the framebuffer
attachment corresponding to the destination buffer is <constant > GL_SRGB</constant> , the R, G, and B
values after blending are converted into the non-linear sRGB color space by computing
<!-- Missing equation! -->
where cl is the R, G, or B element and cs is the result (effectively converted into an
sRGB color space).
If <constant > GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</constant> is not <constant > GL_SRGB</constant> , then
cs = cl:
The resulting cs values for R, G, and B, and the unmodified A form a new
RGBA color value. If the color buffer is fixed-point, each component is clamped
to the range [0; 1] and then converted to a fixed-point value using equation
2009-03-08 00:46:58 +00:00
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "examples" > <title > Examples</title>
2009-03-08 00:46:58 +00:00
<para >
</para>
<para >
Transparency is best implemented using blend function
(<constant > GL_SRC_ALPHA</constant> , <constant > GL_ONE_MINUS_SRC_ALPHA</constant> )
with primitives sorted from farthest to nearest.
Note that this transparency calculation does not require
the presence of alpha bitplanes in the frame buffer.
</para>
<para >
Blend function
(<constant > GL_SRC_ALPHA</constant> , <constant > GL_ONE_MINUS_SRC_ALPHA</constant> )
is also useful for rendering antialiased points and lines
in arbitrary order.
</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 >
Incoming (source) alpha is correctly thought of as a material opacity,
2013-11-03 11:43:50 +00:00
ranging from 1.0
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: K sub A: -->
2009-03-08 00:46:58 +00:00
<mml:msub > <mml:mi mathvariant= "italic" > K</mml:mi>
<mml:mi mathvariant= "italic" > A</mml:mi>
</mml:msub>
</mml:math> </inlineequation> ),
representing complete opacity,
to 0.0 (0), representing complete
transparency.
</para>
<para >
When more than one color buffer is enabled for drawing,
the GL performs blending separately for each enabled buffer,
using the contents of that buffer for destination color.
2014-03-28 19:06:55 +00:00
(See <citerefentry > <refentrytitle > glDrawBuffers</refentrytitle> </citerefentry> .)
2009-03-08 00:46:58 +00:00
</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 >
2010-11-21 14:34:29 +00:00
<constant > GL_INVALID_ENUM</constant> is generated if either <parameter > sfactor</parameter>
or <parameter > dfactor</parameter> is not an accepted value.
2009-03-08 00:46:58 +00:00
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "associatedgets" > <title > Associated Gets</title>
2013-10-23 18:17:08 +00:00
<para >
2014-03-28 19:06:55 +00:00
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with argument <constant > GL_BLEND_SRC</constant>
2009-03-08 00:46:58 +00:00
</para>
<para >
2014-03-28 19:06:55 +00:00
<citerefentry > <refentrytitle > glGet</refentrytitle> </citerefentry> with argument <constant > GL_BLEND_DST</constant>
2009-03-08 00:46:58 +00:00
</para>
<para >
<citerefentry > <refentrytitle > glIsEnabled</refentrytitle> </citerefentry> with argument <constant > GL_BLEND</constant>
</para>
<para >
</para>
</refsect1>
2014-03-28 19:06:55 +00:00
<refsect1 xml:id= "versions" >
<title > API Version Support</title>
<informaltable >
<tgroup cols= "3" align= "left" >
<xi:include xmlns:xi= "http://www.w3.org/2001/XInclude" href= "apifunchead.xml" xpointer= "xpointer(/*/*)" />
<tbody >
<row >
<entry > glBlendFunc</entry>
<xi:include xmlns:xi= "http://www.w3.org/2001/XInclude" href= "apiversion.xml" xpointer= "xpointer(/*/*[@role='es20']/*)" />
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 xml:id= "seealso" > <title > See Also</title>
2009-03-08 00:46:58 +00:00
<para >
<citerefentry > <refentrytitle > glBlendColor</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glBlendEquation</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glBlendFuncSeparate</refentrytitle> </citerefentry> ,
<citerefentry > <refentrytitle > glClear</refentrytitle> </citerefentry> ,
2014-03-28 19:06:55 +00:00
<citerefentry > <refentrytitle > glDrawBuffers</refentrytitle> </citerefentry> ,
2009-03-08 00:46:58 +00:00
<citerefentry > <refentrytitle > glEnable</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-2014 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>