float4x4 ShadowMatrix : register(c27);
float4x4 ShadowAdjustment : register(c31);

float RangeScale : register(c35);

void ComputeShadow(float3 InputPos, out float Depth, out float4 ShadowPos){
	float4x4 ShadowWorldViewProj = mul(World, ShadowMatrix);
	float4x4 AdjustedShadowWorldViewProj = mul(World, ShadowAdjustment);

	Depth = mul(float4(InputPos, 1), ShadowWorldViewProj).z * RangeScale;
	
	ShadowPos = mul(float4(InputPos, 1), AdjustedShadowWorldViewProj);
}

void ComputeShadowSimple(float3 InputPos, out float4 ShadowPos){
	float4x4 AdjustedShadowWorldViewProj = mul(World, ShadowAdjustment);
	
	ShadowPos = mul(float4(InputPos, 1), AdjustedShadowWorldViewProj);
}