Description

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 glEnable and glDisable with argument GL_BLEND
to enable and disable blending.

glBlendFunc defines the operation of blending when it is enabled.
sfactor specifies which method is used to scale the
source color components.
dfactor 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
RsGsBsAs
and
RdGdBdAd.
The color specified by glBlendColor is referred to as
RcGcBcAc.
They are understood to have integer values between 0 and
kRkGkBkA,
where

kc=2mc-1

and
mRmGmBmA
is the number of red,
green,
blue,
and alpha bitplanes.

Source and destination scale factors are referred to as
sRsGsBsA
and
dRdGdBdA.
The scale factors described in the table,
denoted
fRfGfBfA,
represent either source or destination factors.
All scale factors have range
01.

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.

Notes

Transparency is best implemented using blend function
(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
with primitives sorted from farthest to nearest.
Note that this transparency calculation does not require
the presence of alpha bitplanes in the frame buffer.

Errors

GL_INVALID_ENUM is generated if either sfactor or dfactor is not an
accepted value.