/*=============================================================================
	TranslucencyPixelShader.usf: Shader for rendering unlit translucency
	Copyright © 2004-2006 Epic Games, Inc. All Rights Reserved.
=============================================================================*/

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

void Main(
	FVertexFactoryInterpolants Interpolants,
	float4	ScreenPosition	: TEXCOORD5,
	float3	CameraVector	: TEXCOORD6,
	half4	Fog				: TEXCOORD7,
	out float4 OutColor		: COLOR0
	)
{
	FMaterialParameters MaterialParameters = GetMaterialParameters(Interpolants);
	CalcMaterialParameters(MaterialParameters,CameraVector,ScreenPosition);
	

	half Opacity = GetMaterialOpacity(MaterialParameters);
	half3 Color = GetMaterialEmissive(MaterialParameters);

#if MATERIALBLENDING_TRANSLUCENT
	OutColor = RETURN_COLOR( float4(Color * Fog.a + Fog.rgb,Opacity) );
#elif MATERIALBLENDING_ADDITIVE
	OutColor = RETURN_COLOR( float4(Color * Fog.a,Opacity) );
#elif MATERIALBLENDING_MODULATE
	// RETURN_COLOR not used for modulated blending
	OutColor = float4(Color,Opacity);
#else
	OutColor = RETURN_COLOR( float4(Color,1) );
#endif
}


