protected void RenderSingleShadowVolumeToStencil( ShadowRenderable sr,
bool zfail,
bool stencil2sided,
LightList manualLightList,
bool isSecondPass )
{
// Render a shadow volume here
// - if we have 2-sided stencil, one render with no culling
// - otherwise, 2 renders, one with each culling method and invert the ops
if ( !isSecondPass )
{
this.SetShadowVolumeStencilState( false, zfail, stencil2sided );
this.RenderSingleObject( sr, this.shadowStencilPass, false, manualLightList );
}
if ( !stencil2sided && isSecondPass )
{
// Second pass
this.SetShadowVolumeStencilState( true, zfail, false );
this.RenderSingleObject( sr, this.shadowStencilPass, false );
}
// Do we need to render a debug shadow marker?
if ( this.showDebugShadows && ( isSecondPass || stencil2sided ) )
{
// reset stencil & colour ops
this.targetRenderSystem.SetStencilBufferParams();
this.SetPass( this.shadowDebugPass );
this.RenderSingleObject( sr, this.shadowDebugPass, false, manualLightList );
this.targetRenderSystem.SetColorBufferWriteEnabled( false, false, false, false );
}
}