protected virtual void InitShadowVolumeMaterials()
{
if ( this.shadowMaterialInitDone )
{
return;
}
if ( this.shadowDebugPass == null )
{
this.InitShadowDebugPass();
}
if ( this.shadowStencilPass == null )
{
this.InitShadowStencilPass();
}
if ( this.shadowModulativePass == null )
{
this.InitShadowModulativePass();
}
// Also init full screen quad while we're at it
if ( this.fullScreenQuad == null )
{
this.fullScreenQuad = new Rectangle2D();
this.fullScreenQuad.SetCorners( -1, 1, 1, -1 );
}
// Also init shadow caster material for texture shadows
if ( this.shadowCasterPlainBlackPass == null )
{
this.InitShadowCasterPass();
}
if ( this.shadowReceiverPass == null )
{
this.InitShadowReceiverPass();
}
// InitShadowReceiverPass up spot shadow fade texture (loaded from code data block)
Texture spotShadowFadeTex = TextureManager.Instance[ SPOT_SHADOW_FADE_IMAGE ];
if ( spotShadowFadeTex == null )
{
// Load the manual buffer into an image
MemoryStream imgStream = new MemoryStream( SpotShadowFadePng.SPOT_SHADOW_FADE_PNG );
Image img = Image.FromStream( imgStream, "png" );
spotShadowFadeTex = TextureManager.Instance.LoadImage( SPOT_SHADOW_FADE_IMAGE,
ResourceGroupManager.InternalResourceGroupName,
img,
TextureType.TwoD );
}
this.shadowMaterialInitDone = true;
}