#include "Post.fxh"

texture2D gShd;
sampler2D samGshd = sampler_state
{
    Texture = gShd;
    MinFilter = LINEAR;
    MagFilter = LINEAR;    
    MipFilter = NONE;
	
};
texture2D colorTex;
sampler2D samColor = sampler_state
{
    Texture = colorTex;
    MinFilter = LINEAR;
    MagFilter = LINEAR;    
    MipFilter = NONE;
};

struct PSInput
{
	float2 TexCoord : TEXCOORD0;
};

struct PSOutput
{
    float4 Color : COLOR;
};

float4 GSDHCompMain(PSInput ip) : COLOR
{
	float4 color = tex2D(samColor, ip.TexCoord);
	float4 rawShd = tex2D(samGshd, ip.TexCoord);
	
	float4 shd = float4(1,0,0,1);
	float alpha = (1-rawShd.g) * rawShd.a * 1.5f;

    return lerp(color, shd, alpha);
}


technique GSDHComp
{
	pass p0
	{
		VertexShader = compile vs_3_0 PostQuad();
		PixelShader = compile ps_3_0 GSDHCompMain();
	}
}