mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-26 21:15:28 +00:00
1257 lines
67 KiB
XML
1257 lines
67 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
|
|
"http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
|
|
<refentry id="glBlendFunc">
|
|
<refmeta>
|
|
<refmetainfo>
|
|
<copyright>
|
|
<year>1991-2006</year>
|
|
<holder>Silicon Graphics, Inc.</holder>
|
|
</copyright>
|
|
</refmetainfo>
|
|
<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>
|
|
<!-- eqn: ignoring delim $$ -->
|
|
<refsect1 id="parameters"><title>Parameters</title>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>sfactor</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Specifies how the red, green, blue,
|
|
and alpha source 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>,
|
|
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>, and
|
|
<constant>GL_SRC_ALPHA_SATURATE</constant>.
|
|
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>
|
|
<refsect1 id="description"><title>Description</title>
|
|
<para>
|
|
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 <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry> and <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> with argument <constant>GL_BLEND</constant>
|
|
to enable and disable blending.
|
|
</para>
|
|
<para>
|
|
<function>glBlendFunc</function> defines the operation of blending when it is enabled.
|
|
<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.
|
|
The possible methods are described in the following table.
|
|
Each method defines four scale factors,
|
|
one each for red, green, blue, and alpha.
|
|
In the table and in subsequent equations, source and destination
|
|
color components are referred to as
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( R sub s , G sub s , B sub s , A sub s ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>
|
|
and
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( R sub d , G sub d , B sub d , A sub d ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>.
|
|
The color specified by <citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry> is referred to as
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( R sub c , G sub c , B sub c , A sub c ):-->
|
|
<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>.
|
|
They are understood to have integer values between 0 and
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( k sub R , k sub G , k sub B , k sub A ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">R</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">G</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">B</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>,
|
|
where
|
|
</para>
|
|
<para>
|
|
<para>
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: k sub c = 2 sup {m sub c} - 1:-->
|
|
<mml:mrow>
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>=</mml:mo>
|
|
<mml:mrow>
|
|
<mml:msup><mml:mn>2</mml:mn>
|
|
<mml:mfenced open="" close="">
|
|
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
|
|
<mml:mi mathvariant="italic">c</mml:mi>
|
|
</mml:msub>
|
|
</mml:mfenced>
|
|
</mml:msup>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mrow>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</para>
|
|
</para>
|
|
<para>
|
|
and
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( m sub R , m sub G , m sub B , m sub A ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
|
|
<mml:mi mathvariant="italic">R</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
|
|
<mml:mi mathvariant="italic">G</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
|
|
<mml:mi mathvariant="italic">B</mml:mi>
|
|
</mml:msub>
|
|
<mml:msub><mml:mi mathvariant="italic">m</mml:mi>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>
|
|
is the number of red,
|
|
green,
|
|
blue,
|
|
and alpha bitplanes.
|
|
</para>
|
|
<para>
|
|
Source and destination scale factors are referred to as
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( s sub R , s sub G , s sub B , s sub A ):-->
|
|
<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
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( d sub R , d sub G , d sub B , d sub A ):-->
|
|
<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,
|
|
denoted
|
|
<inlineequation><mml:math>
|
|
<!-- 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>,
|
|
represent either source or destination factors.
|
|
All scale factors have range
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: [0,1]:-->
|
|
<mml:mfenced open="[" close="]">
|
|
<mml:mn>0</mml:mn>
|
|
<mml:mn>1</mml:mn>
|
|
</mml:mfenced>
|
|
</mml:math></inlineequation>.
|
|
</para>
|
|
<para>
|
|
</para>
|
|
<informaltable frame="topbot">
|
|
<tgroup cols="2" align="left">
|
|
<colspec/>
|
|
<colspec/>
|
|
<thead>
|
|
<row>
|
|
<entry rowsep="1" align="left"><emphasis role="bold">
|
|
Parameter
|
|
</emphasis></entry>
|
|
<entry rowsep="1" align="left"><emphasis role="bold">
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
</emphasis></entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry align="left">
|
|
<constant>GL_ZERO</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( 0, 0, 0, 0 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_ONE</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( 1, 1, 1, 1 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_SRC_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mfrac>
|
|
<mml:msub><mml:mi mathvariant="italic">R</mml:mi>
|
|
<mml:mi mathvariant="italic">s</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">s</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">s</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">s</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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_SRC_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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">s</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">s</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">s</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">s</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>
|
|
<entry align="left">
|
|
<constant>GL_DST_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_DST_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_SRC_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:mfrac>
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">s</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">s</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">s</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">s</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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_SRC_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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">s</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">s</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">s</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">s</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>
|
|
<entry align="left">
|
|
<constant>GL_DST_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_DST_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- 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 ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_CONSTANT_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( R sub c, G sub c, B sub c, A sub c ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( 1, 1, 1, 1 ) - ( R sub c, G sub c, B sub c, A sub c ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_CONSTANT_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( A sub c, A sub c, A sub c, A sub c ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( 1, 1, 1, 1 ) - ( A sub c, A sub c, A sub c, A sub c ):-->
|
|
<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>
|
|
<entry align="left">
|
|
<constant>GL_SRC_ALPHA_SATURATE</constant>
|
|
</entry>
|
|
<entry align="left">
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: ( i, i, i, 1 ):-->
|
|
<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>
|
|
<para>
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
<mml:mrow>
|
|
<mml:mi mathvariant="italic">min</mml:mi>
|
|
<mml:mo>⁡</mml:mo>
|
|
<mml:mfenced open="(" close=")">
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
<mml:mrow>
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>-</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
</mml:mrow>
|
|
<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>
|
|
<para>
|
|
To determine the blended RGBA values of a pixel when drawing in RGBA mode,
|
|
the system uses the following equations:
|
|
</para>
|
|
<para>
|
|
<para>
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
</mml:mrow>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
<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">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>
|
|
<mml:mi mathvariant="italic">G</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">G</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
|
|
<mml:mi mathvariant="italic">G</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
</mml:mrow>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
<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">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>
|
|
<mml:mi mathvariant="italic">B</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">B</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
|
|
<mml:mi mathvariant="italic">B</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
</mml:mrow>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- 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>
|
|
<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">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>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>+</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">d</mml:mi>
|
|
</mml:msub>
|
|
<mml:mo>⁢</mml:mo>
|
|
<mml:msub><mml:mi mathvariant="italic">d</mml:mi>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:mfenced>
|
|
</mml:mrow>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</para>
|
|
</para>
|
|
<para>
|
|
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 <parameter>sfactor</parameter> is <constant>GL_SRC_ALPHA</constant>,
|
|
<parameter>dfactor</parameter> is <constant>GL_ONE_MINUS_SRC_ALPHA</constant>,
|
|
and
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: A sub s:-->
|
|
<mml:msub><mml:mi mathvariant="italic">A</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:math></inlineequation>
|
|
is equal to
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: k sub A:-->
|
|
<mml:msub><mml:mi mathvariant="italic">k</mml:mi>
|
|
<mml:mi mathvariant="italic">A</mml:mi>
|
|
</mml:msub>
|
|
</mml:math></inlineequation>,
|
|
the equations reduce to simple replacement:
|
|
</para>
|
|
<para>
|
|
<para>
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: R sub d = R sub s:-->
|
|
<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:msub><mml:mi mathvariant="italic">R</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: G sub d = G sub s:-->
|
|
<mml:mrow>
|
|
<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">G</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: B sub d = B sub s:-->
|
|
<mml:mrow>
|
|
<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">B</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
<inlineequation><mml:math>
|
|
<!-- eqn: A sub d = A sub s:-->
|
|
<mml:mrow>
|
|
<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">A</mml:mi>
|
|
<mml:mi mathvariant="italic">s</mml:mi>
|
|
</mml:msub>
|
|
</mml:mrow>
|
|
</mml:math></inlineequation>
|
|
</para>
|
|
</para>
|
|
<para>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="examples"><title>Examples</title>
|
|
<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>
|
|
<para>
|
|
Polygon antialiasing is optimized using blend function
|
|
(<constant>GL_SRC_ALPHA_SATURATE</constant>, <constant>GL_ONE</constant>)
|
|
with polygons sorted from nearest to farthest.
|
|
(See the <citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>, <citerefentry><refentrytitle>glDisable</refentrytitle></citerefentry> reference page and the
|
|
<constant>GL_POLYGON_SMOOTH</constant> argument for information on polygon antialiasing.)
|
|
Destination alpha bitplanes,
|
|
which must be present for this blend function to operate correctly,
|
|
store the accumulated coverage.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="notes"><title>Notes</title>
|
|
<para>
|
|
Incoming (source) alpha is correctly thought of as a material opacity,
|
|
ranging from 1.0
|
|
(<inlineequation><mml:math>
|
|
<!-- eqn: K sub A:-->
|
|
<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.
|
|
(See <citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>.)
|
|
</para>
|
|
<para>
|
|
Blending affects only RGBA rendering.
|
|
It is ignored by color index renderers.
|
|
</para>
|
|
<para>
|
|
<constant>GL_CONSTANT_COLOR</constant>, <constant>GL_ONE_MINUS_CONSTANT_COLOR</constant>,
|
|
<constant>GL_CONSTANT_ALPHA</constant>, <constant>GL_ONE_MINUS_CONSTANT_ALPHA</constant> are available only
|
|
if the GL version is 1.4 or greater or if the <code>ARB_imaging</code> is
|
|
supported by your implementation.
|
|
</para>
|
|
<para>
|
|
<constant>GL_SRC_COLOR</constant> and <constant>GL_ONE_MINUS_SRC_COLOR</constant> are valid only for
|
|
<parameter>sfactor</parameter> if the GL version is 1.4 or greater.
|
|
</para>
|
|
<para>
|
|
<constant>GL_DST_COLOR</constant> and <constant>GL_ONE_MINUS_DST_COLOR</constant> are valid only for
|
|
<parameter>dfactor</parameter> if the GL version is 1.4 or greater.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="errors"><title>Errors</title>
|
|
<para>
|
|
<constant>GL_INVALID_ENUM</constant> is generated if either <parameter>sfactor</parameter> or <parameter>dfactor</parameter> is not an
|
|
accepted value.
|
|
</para>
|
|
<para>
|
|
<constant>GL_INVALID_OPERATION</constant> is generated if <function>glBlendFunc</function>
|
|
is executed between the execution of <citerefentry><refentrytitle>glBegin</refentrytitle></citerefentry>
|
|
and the corresponding execution of <citerefentry><refentrytitle>glEnd</refentrytitle></citerefentry>.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="associatedgets"><title>Associated Gets</title>
|
|
<para>
|
|
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_BLEND_SRC</constant>
|
|
</para>
|
|
<para>
|
|
<citerefentry><refentrytitle>glGet</refentrytitle></citerefentry> with argument <constant>GL_BLEND_DST</constant>
|
|
</para>
|
|
<para>
|
|
<citerefentry><refentrytitle>glIsEnabled</refentrytitle></citerefentry> with argument <constant>GL_BLEND</constant>
|
|
</para>
|
|
<para>
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="seealso"><title>See Also</title>
|
|
<para>
|
|
<citerefentry><refentrytitle>glAlphaFunc</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glBlendColor</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glBlendEquation</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glBlendFuncSeparate</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glClear</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glDrawBuffer</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glEnable</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glLogicOp</refentrytitle></citerefentry>,
|
|
<citerefentry><refentrytitle>glStencilFunc</refentrytitle></citerefentry>
|
|
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 id="Copyright"><title>Copyright</title>
|
|
<para>
|
|
Copyright <trademark class="copyright"></trademark> 1991-2006
|
|
Silicon Graphics, Inc. This document is licensed under the SGI
|
|
Free Software B License. For details, see
|
|
<ulink url="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</ulink>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|