// shadow drawing

const float4 shadowcolor = float4(0,0,0,0.4);
//const float4 shadowcolor = float4(1,0,1,0.2);

static const float4x4 identity =
{ 
1,0,0,0,
0,1,0,0,
0,0,1,0,
0,0,0,1	
};

float4 ShadowDraw_PS() : color
{
	return shadowcolor;
}

technique FixedFunctionDraw
{
	pass p0
	{
		CullMode		= None;
		
		StencilEnable	= True;
		StencilRef		= 0x01;
		StencilFunc		= LessEqual;
		StencilPass		= Keep;

		AlphaBlendEnable= True;
		SrcBlend		= SrcAlpha;
		DestBlend		= InvSrcAlpha;

		//no z buffering today
		ZEnable		= False;
		ZWriteEnable= False;

		TextureFactor = (shadowcolor);

		ColorOp[0]	= SelectArg1;
		AlphaOp[0]	= SelectArg1;
		ColorArg1[0]= TFactor;
		AlphaArg1[0]= TFactor;

		ColorOp[1]	= Disable;
		AlphaOp[1]	= Disable;

		//PixelShader = compile ps_2_0 ShadowDraw_PS();
	}
}

technique empty
{
	//Old video card... nothing
}