<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glBlendFunc</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glBlendEquation.3G.xml" title="glBlendEquation"/><link rel="next" href="glCallList.3G.xml" title="glCallList"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glBlendFunc</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glBlendEquation.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glCallList.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glBlendFunc.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glBlendFunc.3G-name"/><h2>Name</h2><p>glBlendFunc &#8212; specify pixel arithmetic</p></div><div class="refsynopsisdiv"><a name="glBlendFunc.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glBlendFunc</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>sfactor</tt></i>, GLenum <i><tt>dfactor</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glBlendFunc.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glBlendFunc</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>sfactor</tt></i>, <i><tt>dfactor</tt></i>) &#8594; <tt>None</tt></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>sfactor</tt></i></span></dt><dd>
						Specifies how the red, green, blue, and alpha source blending factors are computed. The following symbolic
						constants are accepted: <tt>GL_ZERO</tt>, <tt>GL_ONE</tt>,
						<tt>GL_DST_COLOR</tt>, <tt>GL_ONE_MINUS_DST_COLOR</tt>,
						<tt>GL_SRC_ALPHA</tt>, <tt>GL_ONE_MINUS_SRC_ALPHA</tt>,
						<tt>GL_DST_ALPHA</tt>, <tt>GL_ONE_MINUS_DST_ALPHA</tt>, and
						<tt>GL_SRC_ALPHA_SATURATE</tt>. The initial value is <tt>GL_ONE</tt>. Additionally,
						if the <tt>GL_ARB_imaging</tt> extension is supported, the following constants are accepted:
						<tt>GL_CONSTANT_COLOR</tt>, <tt>GL_ONE_MINUS_CONSTANT_COLOR</tt>,
						<tt>GL_CONSTANT_ALPHA</tt>, <tt>GL_ONE_MINUS_CONSTANT_ALPHA</tt>.
					</dd><dt><span class="term"><i><tt>dfactor</tt></i></span></dt><dd>
						Specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic
						constants are accepted: <tt>GL_ZERO</tt>, <tt>GL_ONE</tt>,
						<tt>GL_SRC_COLOR</tt>, <tt>GL_ONE_MINUS_SRC_COLOR</tt>,
						<tt>GL_SRC_ALPHA</tt>, <tt>GL_ONE_MINUS_SRC_ALPHA</tt>,
						<tt>GL_DST_ALPHA</tt>, and <tt>GL_ONE_MINUS_DST_ALPHA</tt>. The initial value is
						<tt>GL_ZERO</tt>. Additionally, if the <tt>GL_ARB_imaging</tt> extension is
						supported, the following constants are accepted: <tt>GL_CONSTANT_COLOR</tt>,
						<tt>GL_ONE_MINUS_CONSTANT_COLOR</tt>, <tt>GL_CONSTANT_ALPHA</tt>,
						<tt>GL_ONE_MINUS_CONSTANT_ALPHA</tt>.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-description"/><h2>Description</h2><p>
			In RGBA mode, pixels can be drawn using a function that blends the incoming (source) RGBA values with the RGBA values
			that are already in the frame buffer (the destination values). Blending is initially disabled. Use <a href="glEnable.3G.xml"><tt>glEnable</tt></a> and <a href="glEnable.3G.xml"><tt>glDisable</tt></a> with argument
			<tt>GL_BLEND</tt> to enable and disable blending.
		</p><p>
			<tt>glBlendFunc</tt> defines the operation of blending when it is enabled. <i><tt>sfactor</tt></i>
			specifies which of nine methods is used to scale the source color components. <i><tt>dfactor</tt></i> specifies
			which of eight 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:mfenced separator=",">
						<mml:msub>
							<mml:mi>R</mml:mi>
							<mml:mi>s</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>G</mml:mi>
							<mml:mi>s</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>B</mml:mi>
							<mml:mi>s</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>A</mml:mi>
							<mml:mi>s</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:msub>
							<mml:mi>R</mml:mi>
							<mml:mi>d</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>G</mml:mi>
							<mml:mi>d</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>B</mml:mi>
							<mml:mi>d</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>A</mml:mi>
							<mml:mi>d</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math>. The color specified by <a href="glBlendColor.3G.xml"><tt>glBlendColor</tt></a> is referred to as
			<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:msub>
							<mml:mi>R</mml:mi>
							<mml:mi>c</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>G</mml:mi>
							<mml:mi>c</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>B</mml:mi>
							<mml:mi>c</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>A</mml:mi>
							<mml:mi>c</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</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:mfenced separator=",">
						<mml:msub>
							<mml:mi>k</mml:mi>
							<mml:mi>R</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>k</mml:mi>
							<mml:mi>G</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>k</mml:mi>
							<mml:mi>B</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>k</mml:mi>
							<mml:mi>A</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math>, where
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mrow>
					<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:mrow>
			</mml:math></div><p>
			and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:msub>
							<mml:mi>m</mml:mi>
							<mml:mi>R</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>m</mml:mi>
							<mml:mi>G</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>m</mml:mi>
							<mml:mi>B</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>m</mml:mi>
							<mml:mi>A</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</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:mfenced separator=",">
						<mml:msub>
							<mml:mi>s</mml:mi>
							<mml:mi>R</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>s</mml:mi>
							<mml:mi>G</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>s</mml:mi>
							<mml:mi>B</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>s</mml:mi>
							<mml:mi>A</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math> and <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:msub>
							<mml:mi>d</mml:mi>
							<mml:mi>R</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>d</mml:mi>
							<mml:mi>G</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>d</mml:mi>
							<mml:mi>B</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>d</mml:mi>
							<mml:mi>A</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math>. The scale factors described in the table, denoted <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator=",">
						<mml:msub>
							<mml:mi>f</mml:mi>
							<mml:mi>R</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>f</mml:mi>
							<mml:mi>G</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>f</mml:mi>
							<mml:mi>B</mml:mi>
						</mml:msub>
						<mml:msub>
							<mml:mi>f</mml:mi>
							<mml:mi>A</mml:mi>
						</mml:msub>
					</mml:mfenced>
				</mml:math>, represent either source or destination factors. All scale factors have range <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
					<mml:mfenced separator="," open="[" close="]">
						<mml:mn>0</mml:mn>
						<mml:mn>1</mml:mn>
					</mml:mfenced>
				</mml:math>.
		</p><div class="informaltable"><table border="1"><colgroup><col/><col align="center"/></colgroup><thead><tr><th><span class="bold"><b>Parameter</b></span></th><th align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:msub>
										<mml:mi>f</mml:mi>
										<mml:mi>R</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>f</mml:mi>
										<mml:mi>G</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>f</mml:mi>
										<mml:mi>B</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>f</mml:mi>
										<mml:mi>A</mml:mi>
									</mml:msub>
								</mml:mfenced>
							</mml:math></th></tr></thead><tbody><tr><td><tt>GL_ZERO</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mn>0</mml:mn>
									<mml:mn>0</mml:mn>
									<mml:mn>0</mml:mn>
									<mml:mn>0</mml:mn>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mn>1</mml:mn>
									<mml:mn>1</mml:mn>
									<mml:mn>1</mml:mn>
									<mml:mn>1</mml:mn>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_SRC_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_SRC_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_DST_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_DST_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_SRC_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_SRC_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_DST_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_DST_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mrow>
										<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:mrow>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_SRC_ALPHA_SATURATE</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:mi>i</mml:mi>
									<mml:mi>i</mml:mi>
									<mml:mi>i</mml:mi>
									<mml:mn>1</mml:mn>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_CONSTANT_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:msub>
										<mml:mi>R</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>G</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>B</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_CONSTANT_COLOR</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:msub>
										<mml:mi>R</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>G</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>B</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_CONSTANT_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
								</mml:mfenced>
							</mml:math></td></tr><tr><td><tt>GL_ONE_MINUS_CONSTANT_ALPHA</tt></td><td align="center"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
								<mml:mfenced separator=",">
									<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 separator=",">
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
									<mml:msub>
										<mml:mi>A</mml:mi>
										<mml:mi>c</mml:mi>
									</mml:msub>
								</mml:mfenced>
							</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" mode="display" overflow="scroll">
				<mml:mi>i</mml:mi>
				<mml:mo>=</mml:mo>
				<mml:mi>min</mml:mi>
				<mml:mfenced separator=",">
					<mml:msub>
						<mml:mi>A</mml:mi>
						<mml:mi>s</mml:mi>
					</mml:msub>
					<mml:mrow>
						<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:mrow>
				</mml:mfenced>
				<mml:mo>/</mml:mo>
				<mml:msub>
					<mml:mi>k</mml:mi>
					<mml:mi>A</mml:mi>
				</mml:msub>
			</mml:math></div><p>
			To determine the blended RGBA values of a pixel when drawing in RGBA mode, the system uses the following equations:
		</p><div class="informalequation"><mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" mode="display" overflow="scroll">
				<mml:mtable>
					<mml:mtr>
						<mml:mtd>
							<mml:msub>
								<mml:mi>R</mml:mi>
								<mml:mi>d</mml:mi>
							</mml:msub>
							<mml:mo>=</mml:mo>
							<mml:mo>min</mml:mo>
							<mml:mfenced separator=",">
								<mml:msub>
									<mml:mi>k</mml:mi>
									<mml:mi>R</mml:mi>
								</mml:msub>
								<mml:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mo>+</mml:mo>
									<mml:mrow>
										<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:mrow>
								</mml:mrow>
							</mml:mfenced>
						</mml:mtd>
					</mml:mtr>
					<mml:mtr>
						<mml:mtd>
							<mml:msub>
								<mml:mi>G</mml:mi>
								<mml:mi>d</mml:mi>
							</mml:msub>
							<mml:mo>=</mml:mo>
							<mml:mo>min</mml:mo>
							<mml:mfenced separator=",">
								<mml:msub>
									<mml:mi>k</mml:mi>
									<mml:mi>G</mml:mi>
								</mml:msub>
								<mml:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mo>+</mml:mo>
									<mml:mrow>
										<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:mrow>
								</mml:mrow>
							</mml:mfenced>
						</mml:mtd>
					</mml:mtr>
					<mml:mtr>
						<mml:mtd>
							<mml:msub>
								<mml:mi>B</mml:mi>
								<mml:mi>d</mml:mi>
							</mml:msub>
							<mml:mo>=</mml:mo>
							<mml:mo>min</mml:mo>
							<mml:mfenced separator=",">
								<mml:msub>
									<mml:mi>k</mml:mi>
									<mml:mi>B</mml:mi>
								</mml:msub>
								<mml:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mo>+</mml:mo>
									<mml:mrow>
										<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:mrow>
								</mml:mrow>
							</mml:mfenced>
						</mml:mtd>
					</mml:mtr>
					<mml:mtr>
						<mml:mtd>
							<mml:msub>
								<mml:mi>A</mml:mi>
								<mml:mi>d</mml:mi>
							</mml:msub>
							<mml:mo>=</mml:mo>
							<mml:mo>min</mml:mo>
							<mml:mfenced separator=",">
								<mml:msub>
									<mml:mi>k</mml:mi>
									<mml:mi>A</mml:mi>
								</mml:msub>
								<mml:mrow>
									<mml:mrow>
										<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:mrow>
									<mml:mo>+</mml:mo>
									<mml:mrow>
										<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:mrow>
								</mml:mrow>
							</mml:mfenced>
						</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
			<i><tt>sfactor</tt></i> is <tt>GL_SRC_ALPHA</tt>, <i><tt>dfactor</tt></i> is
			<tt>GL_ONE_MINUS_SRC_ALPHA</tt>, 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" mode="display" overflow="scroll">
				<mml:mtable>
					<mml:mtr>
						<mml:mtd>
							<mml:msub>
								<mml:mi>R</mml:mi>
								<mml:mi>d</mml:mi>
							</mml:msub>
							<mml:mo>=</mml:mo>
							<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:mo>=</mml:mo>
							<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:mo>=</mml:mo>
							<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:mo>=</mml:mo>
							<mml:msub>
								<mml:mi>A</mml:mi>
								<mml:mi>s</mml:mi>
							</mml:msub>
						</mml:mtd>
					</mml:mtr>
				</mml:mtable>
			</mml:math></div></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-examples"/><h2>Examples</h2><p>
			Transparency is best implemented using blend function (<tt>GL_SRC_ALPHA</tt>,
			<tt>GL_ONE_MINUS_SRC_ALPHA</tt>) with primitives sorted from farthest to nearest. Note that this
			transparency calculation does not require the presence of alpha bitplanes in the frame buffer.
		</p><p>
			Blend function (<tt>GL_SRC_ALPHA</tt>, <tt>GL_ONE_MINUS_SRC_ALPHA</tt>) is also useful for
			rendering antialiased points and lines in arbitrary order.
		</p><p>
			Polygon antialiasing is optimized using blend function (<tt>GL_SRC_ALPHA_SATURATE</tt>,
			<tt>GL_ONE</tt>) with polygons sorted from nearest to farthest. (See the <a href="glEnable.3G.xml"><tt>glEnable</tt></a>, <a href="glEnable.3G.xml"><tt>glDisable</tt></a> reference page and the
			<tt>GL_POLYGON_SMOOTH</tt> argument for information on polygon antialiasing.) Destination alpha bitplanes,
			which must be present for this blend function to operate correctly, store the accumulated coverage.
		</p></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-notes"/><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><p>
			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. (See <a href="glDrawBuffer.3G.xml"><tt>glDrawBuffer</tt></a>.)
		</p><p>
			Blending affects only RGBA rendering. It is ignored by color index renderers.
		</p><p>
			<tt>GL_CONSTANT_COLOR</tt>, <tt>GL_ONE_MINUS_CONSTANT_COLOR</tt>,
			<tt>GL_CONSTANT_ALPHA</tt>, <tt>GL_ONE_MINUS_CONSTANT_ALPHA</tt> are only available if the
			<tt>GL_ARB_imaging</tt> is supported by your implementation.
		</p></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if either <i><tt>sfactor</tt></i> or
			<i><tt>dfactor</tt></i> is not an accepted value.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glBlendFunc</tt> is executed between the
			execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of <a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-associated_gets"/><h2>Associated Gets</h2><p>
			<tt>glGet</tt> with argument <tt>GL_BLEND_SRC</tt>
		</p><p>
			<tt>glGet</tt> with argument <tt>GL_BLEND_DST</tt>
		</p><p>
			<a href="glIsEnabled.3G.xml"><tt>glIsEnabled</tt></a> with argument <tt>GL_BLEND</tt>
		</p></div><div class="refsect1" lang="en"><a name="glBlendFunc.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glAlphaFunc.3G.xml">glAlphaFunc</a>, <a href="glBlendColor.3G.xml">glBlendColor</a>, <a href="glBlendEquation.3G.xml">glBlendEquation</a>, <a href="glClear.3G.xml">glClear</a>, <a href="glDrawBuffer.3G.xml">glDrawBuffer</a>, <a href="glEnable.3G.xml">glEnable</a>, <a href="glLogicOp.3G.xml">glLogicOp</a>, <a href="glStencilFunc.3G.xml">glStencilFunc</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glBlendEquation.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glCallList.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glBlendEquation </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glCallList</td></tr></table></div></body></html>