#include "ShaderMacros.h"

void _fragPosIn(float4 pos : POSITION, out float4 vPos: r_vPos)
{
	vPos = float4(0,0,0,0);
};

pixelfragment PosIn = compile_fragment PIXELPROFILE _fragPosIn();

void _fragColorIn(float4 color: COLOR0, out float4 cVertexColor: r_cVertexColor)
{
	cVertexColor = color;
};

pixelfragment ColorIn = compile_fragment PIXELPROFILE _fragColorIn();

#define TEXCOORDTOREGISTER(fragname, register) \
void _frag##fragname(float2 inTexCoord : register, out float2 vTexCoord : r_vTexCoord)\
{\
	vTexCoord = inTexCoord;\
};\
pixelfragment fragname = compile_fragment PIXELPROFILE _frag##fragname();

TEXCOORDTOREGISTER(TexCoord0ToRegister, TEXCOORD0);
TEXCOORDTOREGISTER(TexCoord1ToRegister, TEXCOORD1);
TEXCOORDTOREGISTER(TexCoord2ToRegister, TEXCOORD2);
TEXCOORDTOREGISTER(TexCoord3ToRegister, TEXCOORD3);
TEXCOORDTOREGISTER(TexCoord4ToRegister, TEXCOORD4);
TEXCOORDTOREGISTER(TexCoord5ToRegister, TEXCOORD5);
TEXCOORDTOREGISTER(TexCoord6ToRegister, TEXCOORD6);
TEXCOORDTOREGISTER(TexCoord7ToRegister, TEXCOORD7);

void _fragChannel1FromVertexColor(out float4 cColor1: r_cColor2, float4 cVertexColor: r_cVertexColor)
{
	cColor1 = cVertexColor;
};

pixelfragment Channel1FromVertexColor = compile_fragment PIXELPROFILE _fragChannel1FromVertexColor();

void _fragChannel2FromVertexColor(out float4 cColor2: r_cColor2, float4 cVertexColor: r_cVertexColor)
{
	cColor2 = cVertexColor;
};

pixelfragment Channel2FromVertexColor = compile_fragment PIXELPROFILE _fragChannel2FromVertexColor();

void _fragChannel1FromOutColor(out float4 cColor1: r_cColor1, float4 cOutColor: r_cOutColor)
{
	cColor1 = cOutColor;
};

pixelfragment Channel1FromOutColor = compile_fragment PIXELPROFILE _fragChannel1FromOutColor();

void _fragChannel2FromOutColor(out float4 cColor2: r_cColor2, float4 cOutColor: r_cOutColor)
{
	cColor2 = cOutColor;
};

pixelfragment Channel2FromOutColor = compile_fragment PIXELPROFILE _fragChannel2FromOutColor();

void _fragChannel1FromConstant(out float4 cColor1: r_cColor1, uniform float4 cConstant)
{
	cColor1 = cConstant;
};

pixelfragment Channel1FromConstant1 = compile_fragment PIXELPROFILE _fragChannel1FromConstant(cColorConstant1);
pixelfragment Channel1FromConstant2 = compile_fragment PIXELPROFILE _fragChannel1FromConstant(cColorConstant2);

void _fragChannel2FromConstant(out float4 cColor2: r_cColor2, uniform float4 cConstant)
{
	cColor2 = cConstant;
};

pixelfragment Channel2FromConstant1 = compile_fragment PIXELPROFILE _fragChannel2FromConstant(cColorConstant1);
pixelfragment Channel2FromConstant2 = compile_fragment PIXELPROFILE _fragChannel2FromConstant(cColorConstant2);

void _fragChannel1FromTexture(out float4 cColor1: r_cColor1, float2 vTexCoord: r_vTexCoord, uniform sampler2D tex)
{
	cColor1 = tex2D(tex, vTexCoord);
};

pixelfragment Channel1FromTexture0 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture0);
pixelfragment Channel1FromTexture1 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture1);
pixelfragment Channel1FromTexture2 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture2);
pixelfragment Channel1FromTexture3 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture3);
pixelfragment Channel1FromTexture4 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture4);
pixelfragment Channel1FromTexture5 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture5);
pixelfragment Channel1FromTexture6 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture6);
pixelfragment Channel1FromTexture7 = compile_fragment PIXELPROFILE _fragChannel1FromTexture(texture7);

void _fragChannel2FromTexture(out float4 cColor2: r_cColor2, float2 vTexCoord: r_vTexCoord, uniform sampler2D tex)
{
	cColor2 = tex2D(tex, vTexCoord);
};

pixelfragment Channel2FromTexture0 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture0);
pixelfragment Channel2FromTexture1 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture1);
pixelfragment Channel2FromTexture2 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture2);
pixelfragment Channel2FromTexture3 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture3);
pixelfragment Channel2FromTexture4 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture4);
pixelfragment Channel2FromTexture5 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture5);
pixelfragment Channel2FromTexture6 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture6);
pixelfragment Channel2FromTexture7 = compile_fragment PIXELPROFILE _fragChannel2FromTexture(texture7);

void _fragChannel1ToOpRegister(float4 cColor1: r_cColor1, out float4 cOutColor: r_cOutColor)
{
	cOutColor = cColor1;
}

pixelfragment Channel1ToOpReg = compile_fragment PIXELPROFILE _fragChannel1ToOpRegister();

void _fragChannel2ToOpRegister(float4 cColor2: r_cColor2, out float4 cOutColor: r_cOutColor)
{
	cOutColor = cColor2;
}

pixelfragment Channel2ToOpReg = compile_fragment PIXELPROFILE _fragChannel2ToOpRegister();

void _fragModulateColors(float4 cColor1: r_cColor1, float4 cColor2: r_cColor2, out float4 cOutColor: r_cOutColor)
{
	cOutColor = cColor1 * cColor2;
};

pixelfragment ModulateColors = compile_fragment PIXELPROFILE _fragModulateColors();

void _fragAddColors(float4 cColor1: r_cColor1, float4 cColor2: r_cColor2, out float4 cOutColor: r_cOutColor)
{
	cOutColor = cColor1 + cColor2;
};

pixelfragment AddColors = compile_fragment PIXELPROFILE _fragAddColors();

void _fragOutputColor(float4 cOutColor: r_cOutColor, out float4 cFinal:COLOR)
{
	cFinal = cOutColor;
};

pixelfragment OutputColor = compile_fragment PIXELPROFILE _fragOutputColor();

void _fragOutputChannel1(float4 cColor1: r_cColor1, out float4 cFinal: COLOR)
{
	cFinal = cColor1;
};

pixelfragment Channel1Output = compile_fragment PIXELPROFILE _fragOutputChannel1();

void _fragOutputChannel2(float4 cColor2: r_cColor2, out float4 cFinal: COLOR)
{
	cFinal = cColor2;
};

pixelfragment Channel2Output = compile_fragment PIXELPROFILE _fragOutputChannel2();
