/*=============================================================================
	PostProcess.hlsl: Scene post processing pixel shaders.
	Copyright © 2003-2005 Epic Games, Inc. All Rights Reserved.
=============================================================================*/

#include "Common.hlsl"

sampler shadowTexture;
float   blackValue;
half4   skyColorScaledAndBiased;

struct vertexShaderOutput
{
	float4	position : POSITION;
	float2	texCoord : TEXCOORD0;
};

vertexShaderOutput vertexShader(float4 position : POSITION, float3 texCoord : TEXCOORD0)
{
	vertexShaderOutput result;
	result.position = position;
	result.texCoord = texCoord;
	return result;
}

half4 shadowHack(float2 UV : TEXCOORD0) : COLOR0
{
	half4 result = tex2D(shadowTexture, UV);

	if (result.r == 1)
	{
		return half4(0,0,0,1);
	}
	else
	{
		result.a = (1 - blackValue) * result.r + blackValue;
		result.rgb = skyColorScaledAndBiased * (1 - result.a);
		
		return result;
	}
}

