やっぱαブレンディングでしょ-その4

ピクセルシェーダとかない時代は、ブレンディングの設定を利用していろんな表現をしてきました。ブレンディングの設定は、まずはこの2つの設定から始まります。

 graphics.GraphicsDevice.RenderState.SourceBlend = Blend.SourceAlpha;
 graphics.GraphicsDevice.RenderState.DestinationBlend = Blend.InverseSourceAlpha;

この設定で、テクスチャをフレームバッファに書き込む時のルールを指定します。ブレンディングの種類としては以下のような物があります。
(英語の部分はおいおい、日本語にしておきます)



■Zero
(0, 0, 0, 0).
■SourceAlphaSat
f = min(A, 1 - Ad);
(f, f, f, 1).
■InvDestinationColor
(1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).
■DestinationColor
(Rd, Gd, Bd, Ad).
■InvDestinationAlpha
(1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).
■DestinationAlpha
(Ad, Ad, Ad, Ad).
■InvSourceAlpha
( 1 - As, 1 - As, 1 - As, 1 - As).
■SourceAlpha
(As, As, As, As).
■InvSourceColor
(1 - Rs, 1 - Gs, 1 - Bs, 1 - As).
■SourceColor
(Rs, Gs, Bs, As).
■One
(1, 1, 1, 1).
■InvBlendFactor
Inverted constant color blending factor used by the frame-buffer blender.
This blend mode is supported only if the BlendCaps.SupportsBlendFactor property is set to true.
■BlendFactor
Constant color blending factor used by the frame-buffer blender.
This blend mode is supported only if the BlendCaps.SupportsBlendFactor property is set to true.
■BothInvSourceAlpha
Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As), and destination blend factor is (As, As, As, As);
the destination blend selection is overridden. This blend mode is supported only if the RenderStateManager.SourceBlend property is set to true.
■BothSourceAlpha
Obsolete. To achieve the same effect, set the source and destination blend factors to SourceAlpha and InvSourceAlpha in separate calls.