technique ShadowPrepare
{
	pass prepare
	{
		CullMode		= None;
		ZEnable			= True;
		ZWriteEnable	= False;

		StencilEnable	= True;

		StencilRef		= 1;
		StencilMask		= 0xffffffff;
		StencilWriteMask= 0xffffffff;

		StencilFunc		= Always;
		StencilPass		= Keep;
		StencilFail		= Keep;
		StencilZFail	= Keep;

		//with 2 stencil mode settings
		TwoSidedStencilMode = True;
		CCW_StencilFunc	= Always;
		CCW_StencilPass	= Keep;
		CCW_StencilFail	= Keep;
		CCW_StencilZFail= Keep;
        
		//Don't want to actually draw anything
		Lighting		= False;
		ShadeMode		= Flat;

		AlphaBlendEnable= True;
		SrcBlend		= Zero;
		DestBlend		= One;
		
		// texture stages
		TextureFactor = 0;

		ColorOp[0]   = Disable;
		AlphaOp[0]   = Disable;

		// shaders
		VertexShader = NULL;
		PixelShader  = NULL;
	}
}

technique ShadowPrepareWithout2xstencil
{
	pass prepare
	{
		CullMode		= None;
		ZEnable			= True;
		ZWriteEnable	= False;

		StencilEnable	= True;

		StencilRef		= 1;
		StencilMask		= 0xffffffff;
		StencilWriteMask= 0xffffffff;

		StencilFunc		= Always;
		StencilPass		= Keep;
		StencilFail		= Keep;
		StencilZFail	= Keep;
        
		//Don't want to actually draw anything
		Lighting		= False;
		ShadeMode		= Flat;

		AlphaBlendEnable= True;
		SrcBlend		= Zero;
		DestBlend		= One;
		
		// texture stages
		TextureFactor = 0;
		ColorOp[0]   = Disable;
		AlphaOp[0]   = Disable;

		// shaders
		VertexShader = NULL;
		PixelShader  = NULL;
	}
}