In general, I know of five ways to make use of blending functions (these are for OpenGL, but replace glBlendFunc()
with SetRenderState(D3DRS_SRCBLEND)
and SetRenderState(D3DRS_DESTBLEND)
for DirectX):
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
: Alpha blending (not premultiplied)
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
: Alpha blending (premultiplied)
glBlendFunc(GL_ONE, GL_ONE)
: Additive blending
glBlendFunc(GL_ZERO, GL_SRC_COLOR)
: Multiplicative blending
glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR)
: 2x Multiplicative blending (somewhat obscure)
But there are so many other values you can use when setting your blending function, and not only I've never seen them in use, but also have no idea what they could be used for. In particular, I don't see what GL_DST_ALPHA
could be used for.
What the rest of the blending functions used for?
xna
tag? XNA's has similar blending options too. \$\endgroup\$