
#ifdef VS

void main
(
	float4 ipos : POSITION0,
	float2 itex0 : TEXCOORD0,
	out float4 opos : POSITION0,
	out float2 otex : TEXCOORD0
)
{
	opos = ipos;
	otex = itex0;
}

#elif defined(PS)

sampler2D texOCOL : register(s0);
sampler2D texPARM : register(s1);
sampler2D texBLOOM : register(s2);

float4 main( float2 itex : TEXCOORD0 ) : COLOR0
{
	float3 parm = tex2D( texPARM, itex ).rgb;
	itex += parm.xy;
	float3 ocol = tex2D( texOCOL, itex ).rgb;
	float3 bloom = tex2D( texBLOOM, itex ).rgb;
	ocol += pow(bloom,1) * 0.5;
	ocol -= 1;
	ocol *= 1.02;
	ocol += 1;
	ocol = max( 0, ocol );
	ocol = pow( ocol, 1.0 / 2.5 );
	return float4(ocol,1);
}

#endif
