// This binding semantic requires CG_PROFILE_ARBVP1 or higher.
uniform float4x4 modelViewProj : state.matrix.mvp;

void main(float4 position	:	POSITION,
		  float3 normal		:	NORMAL,
		  uniform float4x4 ShadowMapmvmatrix,
		  uniform float4x4 ShadowMapprojmatrix,
		  out float4 oPosition	:	POSITION,
		  out float3 objectPos	:	TEXCOORD0,
		  out float3 oNormal	:	TEXCOORD1,
		  out float4 objectPos2	:	TEXCOORD2,
		  out float2 texcoord3	:	TEXCOORD3)
{
	
	float4x4 modelViewProj2=mul(ShadowMapprojmatrix,ShadowMapmvmatrix);
	float4 objectPosShadowMap=mul( modelViewProj2,position );
	texcoord3.x=objectPosShadowMap.x/(objectPosShadowMap.w*2)+0.5;
	texcoord3.y=objectPosShadowMap.y/(objectPosShadowMap.w*2)+0.5;
	objectPos2=objectPosShadowMap;

	oPosition = mul(modelViewProj, position);
	objectPos = position.xyz;
	oNormal = normal;
}