/*=============================================================================
	DepthOnlyPixelShader.hlsl: Depth-only pixel shader.
	Copyright 1998-2010 Epic Games, Inc. All Rights Reserved.
=============================================================================*/

#include "Common.usf"
#include "Material.usf"
#include "VertexFactory.usf"

void Main(
#if !MATERIALBLENDING_SOLID
	FVertexFactoryInterpolants FactoryInterpolants,
	float4 CameraVectorOrVertexColor : TEXCOORD4,
	float4 PixelPosition : TEXCOORD5,
	OPTIONAL_FacingSign
	OPTIONAL_PixelShaderScreenPosition
#elif MATERIAL_USE_SCREEN_DOOR_FADE
	OPTIONAL_PixelShaderScreenPosition
#endif

	out float4 OutColor : COLOR0
	)
{
#if !MATERIALBLENDING_SOLID

	FMaterialPixelParameters MaterialParameters = GetMaterialPixelParameters(FactoryInterpolants);
	CalcMaterialParameters(MaterialParameters, FacingSign, CameraVectorOrVertexColor, PixelPosition);

	#if MATERIAL_LIT_TRANSLUCENCY_PREPASS
		GetMaterialClippingLitTranslucencyDepthOnly(MaterialParameters);
	#else
		GetMaterialClipping(MaterialParameters, PixelShaderScreenPosition.xy);
	#endif

#elif MATERIAL_USE_SCREEN_DOOR_FADE
	// Apply screen door fade clip mask
	ApplyScreenDoorFadeMask( PixelShaderScreenPosition.xy );
#endif

	OutColor = 0;
}
