float4 cFinal;
float4 vPos;
float4 cColor1;
float4 cColor2;
float4 cVertexColor;
float4 cOutColor;
float2 vTexCoord;

void _fragPosIn(in float4 pos)
{
	vPos = pos;
}

void _fragColorIn(in float4 color)
{
	cVertexColor = color;
}

void _fragTexCoordToRegister(in float2 inTexCoord)
{
	vTexCoord = inTexCoord;
}

void _fragChannel1FromVertexColor(in float4 color)
{
	cColor1 = color;
}

void _fragChannel2FromVertexColor(in float4 color)
{
	cColor2 = color;
}

void _fragChannel1FromOutColor()
{
	cColor1 = cOutColor;
}

void _fragChannel2FromOutColor()
{
	cColor2 = cOutColor;
}

void _fragChannel1FromConstant(uniform float4 cConstant)
{
	cColor1 = cConstant;
}


void _fragChannel2FromConstant(uniform float4 cConstant)
{
	cColor2 = cConstant;
}

void _fragChannel1FromTexture(uniform sampler2D tex)
{
	cColor1 = tex2D(tex, vTexCoord);
}

void _fragChannel2FromTexture(uniform sampler2D tex)
{
	cColor2 = tex2D(tex, vTexCoord);
}

void _fragChannel1ToOpRegister()
{
	cOutColor = cColor1;
}

void _fragChannel2ToOpRegister()
{
	cOutColor = cColor2;
}

void _fragModulateColors()
{
	cOutColor = cColor1 * cColor2;
}

void _fragAddColors()
{
	cOutColor = cColor1 + cColor2;
}

void _fragMulAddChannel1()
{
	cOutColor = (cColor1 * cColorConstant1) + cColorConstant3;
}

void _fragLerpColors(const float lerpAmount)
{
	cOutColor.rgb = lerp(cColor1.rgb, cColor2.rgb, lerpAmount);
	cOutColor.a = cColor1.a;
}

void _fragLerpColorsKeepAlpha1(const float lerpAmount)
{
	cOutColor.rgb = lerp(cColor1.rgb, cColor2.rgb, lerpAmount);
	cOutColor.a = cColor1.a;
}

void _fragLerpColorsKeepAlpha2(const float lerpAmount)
{
	cOutColor.rgb = lerp(cColor1.rgb, cColor2.rgb, lerpAmount);
	cOutColor.a = cColor2.a;
}

void _fragOutputColor()
{
	cFinal = cOutColor;
}

void _fragOutputChannel1()
{
	cFinal = cColor1;
}

void _fragOutputChannel2()
{
	cFinal = cColor2;
}

void _fragChannel1FogLinear()
{
	float fLerp = 1.0f - clamp(FOGITEMDIST * FOGMAXDIST, 0, 1);
	cOutColor *= fLerp;
}

void _fragChannel2FogLinear()
{
	float fLerp = 1.0f - clamp(FOGITEMDIST * FOGMAXDIST, 0, 1);
	cOutColor *= fLerp;
}