public void SetColorOperation( LayerBlendOperation operation )
{
colorOp = operation;
// configure the multitexturing operations
switch ( operation )
{
case LayerBlendOperation.Replace:
SetColorOperationEx( LayerBlendOperationEx.Source1, LayerBlendSource.Texture, LayerBlendSource.Current );
SetColorOpMultipassFallback( SceneBlendFactor.One, SceneBlendFactor.Zero );
break;
case LayerBlendOperation.Add:
SetColorOperationEx( LayerBlendOperationEx.Add, LayerBlendSource.Texture, LayerBlendSource.Current );
SetColorOpMultipassFallback( SceneBlendFactor.One, SceneBlendFactor.One );
break;
case LayerBlendOperation.Modulate:
SetColorOperationEx( LayerBlendOperationEx.Modulate, LayerBlendSource.Texture, LayerBlendSource.Current );
SetColorOpMultipassFallback( SceneBlendFactor.DestColor, SceneBlendFactor.Zero );
break;
case LayerBlendOperation.AlphaBlend:
SetColorOperationEx( LayerBlendOperationEx.BlendTextureAlpha, LayerBlendSource.Texture, LayerBlendSource.Current );
SetColorOpMultipassFallback( SceneBlendFactor.SourceAlpha, SceneBlendFactor.OneMinusSourceAlpha );
break;
}
}