private void InitShadowModulativePass()
{
Material matModStencil = (Material)MaterialManager.Instance[ STENCIL_SHADOW_MODULATIVE_MATERIAL ];
if ( matModStencil == null )
{
// Create
matModStencil =
(Material)
MaterialManager.Instance.Create( STENCIL_SHADOW_MODULATIVE_MATERIAL,
ResourceGroupManager.InternalResourceGroupName );
this.shadowModulativePass = matModStencil.GetTechnique( 0 ).GetPass( 0 );
this.shadowModulativePass.SetSceneBlending( SceneBlendFactor.DestColor, SceneBlendFactor.Zero );
this.shadowModulativePass.LightingEnabled = false;
this.shadowModulativePass.DepthWrite = false;
this.shadowModulativePass.DepthCheck = false;
TextureUnitState t = this.shadowModulativePass.CreateTextureUnitState();
t.SetColorOperationEx(
LayerBlendOperationEx.Modulate,
LayerBlendSource.Manual,
LayerBlendSource.Current,
this.shadowColor );
this.shadowModulativePass.CullingMode = CullingMode.None;
}
else
{
this.shadowModulativePass = matModStencil.GetTechnique( 0 ).GetPass( 0 );
}
}