<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "xhtml1-transitional.dtd">
<!-- saved from url=(0013)about:internet -->
<?xml-stylesheet type="text/xsl" href="mathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:pref="http://www.w3.org/2002/Math/preference" pref:renderer="mathplayer-dl"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>glBlendFunc</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /></head><body><div class="refentry" title="glBlendFunc"><a id="glBlendFunc"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glBlendFunc — specify pixel arithmetic</p></div><div class="refsynopsisdiv" title="C Specification"><h2>C Specification</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">void <strong>fsfuncglBlendFunc</strong>(</code></td><td>GLenum <var class="pdparam">sfactor</var>, </td></tr><tr><td> </td><td>GLenum <var class="pdparam">dfactor</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer"> </div></div></div><div class="refsect1" title="Parameters"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term">
		    <em class="parameter"><code>sfactor</code></em>
		</span></dt><dd><p>
		    Specifies how the red, green, blue, and alpha
		    source blending factors are computed. The following
		    symbolic constants are accepted:
		    <code class="constant">GL_ZERO</code>,
		    <code class="constant">GL_ONE</code>,
		    <code class="constant">GL_DST_COLOR</code>,
		    <code class="constant">GL_ONE_MINUS_DST_COLOR</code>,
		    <code class="constant">GL_SRC_ALPHA</code>,
		    <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>,
		    <code class="constant">GL_DST_ALPHA</code>,
		    <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>, and
		    <code class="constant">GL_SRC_ALPHA_SATURATE</code>.
		    The initial value is <code class="constant">GL_ONE</code>.
		    </p></dd><dt><span class="term">
		    <em class="parameter"><code>dfactor</code></em>
		</span></dt><dd><p>Specifies how the red, green, blue, and alpha
		    destination blending factors are computed. Eight symbolic
		    constants are accepted:
		    <code class="constant">GL_ZERO</code>,
		    <code class="constant">GL_ONE</code>,
		    <code class="constant">GL_SRC_COLOR</code>,
		    <code class="constant">GL_ONE_MINUS_SRC_COLOR</code>,
		    <code class="constant">GL_SRC_ALPHA</code>,
		    <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>,
		    <code class="constant">GL_DST_ALPHA</code>, and
		    <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>. The initial value is
		    <code class="constant">GL_ZERO</code>.</p></dd></dl></div></div><div class="refsect1" title="Description"><a id="description"></a><h2>Description</h2><p>Pixels can be drawn using a function that blends the
	incoming (source) values with the values that are already in
	the color buffer (the destination values). Use
	<a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a> and
	<a class="citerefentry" href="glDisable.xml"><span class="citerefentry"><span class="refentrytitle">glDisable</span></span></a>
	with argument <code class="constant">GL_BLEND</code>
	to enable and disable blending.
	Blending is initially disabled.
	</p><p>
	<code class="function">glBlendFunc</code>
	defines the operation of blending when it is enabled.
	<em class="parameter"><code>sfactor</code></em>
	specifies which of eleven methods is used to scale the source color components.
	<em class="parameter"><code>dfactor</code></em>
	specifies which of ten methods is used to scale the destination color components.
	The eleven possible methods are described in the following table.
	Each method defines four scale factors, one each for red, green, blue, and alpha.
	</p><p>In the table and in subsequent equations, source and
	destination color components are referred to as
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>R</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>G</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>B</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>
	and
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>.
	They are understood to have integer values between 0 and
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>,
	where</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
	    <mml:msub><mml:mi>k</mml:mi><mml:mi>c</mml:mi></mml:msub>
	    <mml:mo>=</mml:mo>
	    <mml:msup><mml:mn>2</mml:mn><mml:msub><mml:mi>m</mml:mi><mml:mi>c</mml:mi></mml:msub></mml:msup>
	    <mml:mo>-</mml:mo>
	    <mml:mn>1</mml:mn>
	</mml:math></div><p> and
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>m</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>m</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>m</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>m</mml:mi><mml:mi>A</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>
	is the number of red, green, blue, and alpha bitplanes.</p><p>Source and destination scale factors are referred to as
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>s</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>s</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>s</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>s</mml:mi><mml:mi>A</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>
	and
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>d</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>d</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>d</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>d</mml:mi><mml:mi>A</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>.

	The scale factors described in the table, denoted
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
	    <mml:msub><mml:mi>f</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>f</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>f</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
	    <mml:msub><mml:mi>f</mml:mi><mml:mi>A</mml:mi></mml:msub>
	<mml:mo>)</mml:mo></mml:mrow></mml:math>,
	represent either source or destination factors. All scale
	factors have range [0, 1].</p><div class="informaltable"><table border="0"><colgroup><col align="left" /><col align="center" /></colgroup><thead><tr><th align="left">Parameter</th><th align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:msub><mml:mi>f</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>f</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>f</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>f</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</th></tr></thead><tbody><tr><td align="left">
			    <code class="constant">GL_ZERO</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:mn>0</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>0</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>0</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>0</mml:mn>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_ONE</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_SRC_COLOR</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:msub><mml:mi>R</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>G</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>B</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_ONE_MINUS_SRC_COLOR</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow>
			    <mml:mo>(</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo>
			    <mml:mo>-</mml:mo>
			    <mml:mo>(</mml:mo>
				<mml:msub><mml:mi>R</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>G</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>B</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_DST_COLOR</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_ONE_MINUS_DST_COLOR</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow>
			    <mml:mo>(</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo>
			    <mml:mo>-</mml:mo>
			    <mml:mo>(</mml:mo>
				<mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_SRC_ALPHA</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow>
			    <mml:mo>(</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo>
			    <mml:mo>-</mml:mo>
			    <mml:mo>(</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_DST_ALPHA</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_ONE_MINUS_DST_ALPHA</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow>
			    <mml:mo>(</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo>
			    <mml:mo>-</mml:mo>
			    <mml:mo>(</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
				<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub><mml:mo>/</mml:mo><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr><tr><td align="left">
			    <code class="constant">GL_SRC_ALPHA_SATURATE</code>
			</td><td align="center">
			    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow><mml:mo>(</mml:mo>
				<mml:mi>i</mml:mi><mml:mo>,</mml:mo>
				<mml:mi>i</mml:mi><mml:mo>,</mml:mo>
				<mml:mi>i</mml:mi><mml:mo>,</mml:mo>
				<mml:mn>1</mml:mn>
			    <mml:mo>)</mml:mo></mml:mrow></mml:math>
			</td></tr></tbody></table></div><p>In the table,</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mrow>
		<mml:mi>i</mml:mi><mml:mo>=</mml:mo><mml:mo>min</mml:mo><mml:mo>(</mml:mo>
		    <mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub><mml:mo>,</mml:mo>
		    <mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>-</mml:mo><mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub>
		    <mml:mo>)</mml:mo>
		    <mml:mo>/</mml:mo>
		    <mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub>
	    </mml:mrow></mml:math></div><p>To determine the blended values of a pixel, the system
	uses the following equations:</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mtable>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>min</mml:mo><mml:mo>(</mml:mo>
		<mml:msub><mml:mi>k</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>,</mml:mo>
		<mml:msub><mml:mi>R</mml:mi><mml:mi>s</mml:mi></mml:msub>
		<mml:msub><mml:mi>s</mml:mi><mml:mi>R</mml:mi></mml:msub><mml:mo>+</mml:mo>
		<mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:msub><mml:mi>d</mml:mi><mml:mi>R</mml:mi></mml:msub>
		<mml:mo>)</mml:mo>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>min</mml:mo><mml:mo>(</mml:mo>
		<mml:msub><mml:mi>k</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>,</mml:mo>
		<mml:msub><mml:mi>G</mml:mi><mml:mi>s</mml:mi></mml:msub>
		<mml:msub><mml:mi>s</mml:mi><mml:mi>G</mml:mi></mml:msub><mml:mo>+</mml:mo>
		<mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:msub><mml:mi>d</mml:mi><mml:mi>G</mml:mi></mml:msub>
		<mml:mo>)</mml:mo>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>min</mml:mo><mml:mo>(</mml:mo>
		<mml:msub><mml:mi>k</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>,</mml:mo>
		<mml:msub><mml:mi>B</mml:mi><mml:mi>s</mml:mi></mml:msub>
		<mml:msub><mml:mi>s</mml:mi><mml:mi>B</mml:mi></mml:msub><mml:mo>+</mml:mo>
		<mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:msub><mml:mi>d</mml:mi><mml:mi>B</mml:mi></mml:msub>
		<mml:mo>)</mml:mo>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>min</mml:mo><mml:mo>(</mml:mo>
		<mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>,</mml:mo>
		<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub>
		<mml:msub><mml:mi>s</mml:mi><mml:mi>A</mml:mi></mml:msub><mml:mo>+</mml:mo>
		<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:msub><mml:mi>d</mml:mi><mml:mi>A</mml:mi></mml:msub>
		<mml:mo>)</mml:mo>
	    </mml:mtd></mml:mtr>
	</mml:mtable></mml:math></div><p>Despite the apparent precision of the above equations,
	blending arithmetic is not exactly specified, because blending
	operates with imprecise integer color values. However, a blend
	factor that should be equal to 1 is guaranteed not to modify
	its multiplicand, and a blend factor equal to 0 reduces its
	multiplicand to 0. For example, when <em class="parameter"><code>sfactor</code></em>
	is <code class="constant">GL_SRC_ALPHA</code>,
	<em class="parameter"><code>dfactor</code></em> is
	<code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>, and
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub></mml:math>
	is equal to
	<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub></mml:math>,
	the equations reduce to simple replacement:</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:mtable>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>R</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:msub><mml:mi>R</mml:mi><mml:mi>s</mml:mi></mml:msub>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>G</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:msub><mml:mi>G</mml:mi><mml:mi>s</mml:mi></mml:msub>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>B</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:msub><mml:mi>B</mml:mi><mml:mi>s</mml:mi></mml:msub>
	    </mml:mtd></mml:mtr>
	    <mml:mtr><mml:mtd>
		<mml:msub><mml:mi>A</mml:mi><mml:mi>d</mml:mi></mml:msub>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:mo>=</mml:mo>
		<mml:mgroupalign></mml:mgroupalign>
		<mml:msub><mml:mi>A</mml:mi><mml:mi>s</mml:mi></mml:msub>
	    </mml:mtd></mml:mtr>
	</mml:mtable></mml:math></div><p>
	<code class="function">glBlendFunc</code> operates on all pixel write operations,
	including the scan conversion of points, lines, and polygons.
	<code class="function">glBlendFunc</code> does not affect
	<a class="citerefentry" href="glClear.xml"><span class="citerefentry"><span class="refentrytitle">glClear</span></span></a>.
	</p></div><div class="refsect1" title="Examples"><a id="examples"></a><h2>Examples</h2><p>Transparency is best implemented using
	<code class="function">glBlendFunc</code>(<code class="constant">GL_SRC_ALPHA</code>,
	<code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>)
	with primitives sorted from farthest to nearest. Note that
	this transparency calculation does not require the presence of
	alpha bitplanes in the color buffer.</p><p><code class="function">glBlendFunc</code>(<code class="constant">GL_SRC_ALPHA</code>,
	<code class="constant">GL_ONE_MINUS_SRC_ALPHA</code>)
	is also useful for rendering antialiased points and lines.
	</p></div><div class="refsect1" title="Notes"><a id="notes"></a><h2>Notes</h2><p>Incoming (source) alpha is correctly thought of as a
	material opacity, ranging from 1.0
	(<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll"><mml:msub><mml:mi>k</mml:mi><mml:mi>A</mml:mi></mml:msub></mml:math>),
	representing complete opacity, to 0.0 (0), representing
	complete transparency.</p></div><div class="refsect1" title="Errors"><a id="errors"></a><h2>Errors</h2><p><code class="constant">GL_INVALID_ENUM</code> is generated if either
	<em class="parameter"><code>sfactor</code></em> or <em class="parameter"><code>dfactor</code></em>
	is not an accepted value.</p></div><div class="refsect1" title="See Also"><a id="seealso"></a><h2>See Also</h2><p>
	    <a class="citerefentry" href="glAlphaFunc.xml"><span class="citerefentry"><span class="refentrytitle">glAlphaFunc</span></span></a>,
	    <a class="citerefentry" href="glClear.xml"><span class="citerefentry"><span class="refentrytitle">glClear</span></span></a>,
	    <a class="citerefentry" href="glDepthFunc.xml"><span class="citerefentry"><span class="refentrytitle">glDepthFunc</span></span></a>,
	    <a class="citerefentry" href="glEnable.xml"><span class="citerefentry"><span class="refentrytitle">glEnable</span></span></a>,
	    <a class="citerefentry" href="glLogicOp.xml"><span class="citerefentry"><span class="refentrytitle">glLogicOp</span></span></a>,
	    <a class="citerefentry" href="glStencilFunc.xml"><span class="citerefentry"><span class="refentrytitle">glStencilFunc</span></span></a>
	</p></div><div class="refsect1" title="Copyright"><a id="copyright"></a><h2>Copyright</h2><p>
	    Copyright <span class="trademark"></span>© 2003-2004
	    Silicon Graphics, Inc. This document is licensed under the SGI
	    Free Software B License. For details, see
	    <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
	</p></div></div></body></html>
