//Effect to render a poygon with texturing but masked to red

matrix matWorldViewProj;	//The World*View*Projection matrix

texture texDiffuseMap; //The diffuse colour texture map

VertexShader VS11 =
	decl
	{
		stream 0;
		float v0[3];	//Vertex Position
		d3dcolor v1[1]; //Vertex Colour
		float v2[2];	//Vertex UV
	}
	asm
	{
		vs.1.1					//Version 1.1 Vertex Shader
		m4x4	oPos, v0, c0	//Transform vertex to projection space and place in position register
		mul		oD0, v1, c4		//Multiply vertex colour and red shift constant into colour register
		mov		oT0.xy, v2		//Move texture coord into texture output register
	};

PixelShader PS14 =
	asm
	{
		ps.1.4					//Version 1.4 Pixel Shader
		texld r0, t0			//load diffuse texture into r0
		add r1, r0, c0			//Add constant red shift to texture diffuse colour and place in temporary register r1
		mul r0, v0, r0.a		//Multiply the input vertex colour and texture mask into output colour register
		mul r0, r0, r1			//Multiplay output colour with (texture colour + constant red shift) stored in r1
	};
	
PixelShader PS13 =
	asm
	{
		ps.1.3					//Version 1.3 Pixel Shader
		tex t0					//Declare the diffuse texture
		add r1, t0, c0			//Add constant red shift to texture diffuse colour and place in temporary register r1
		mul r0, v0, t0.a		//Multiply the input vertex colour and texture mask into output colour register
		mul r0, r0, r1			//Multiplay output colour with (texture colour + constant red shift) stored in r1
	};

//First technique is for VS1.1 and PS1.4
technique VS1_1__PS_1_4
{
	pass P0
	{
		//Load matrices
		VertexShaderConstant[0] = <matWorldViewProj>; // World*View*Projection
		
		//Load constanst used to red shift
		VertexShaderConstant[4] = (0.9, 0, 0, 1);
		PixelShaderConstant[0]  = (1, 0, 0, 1);
		
		// textures
		Texture[0] = <texDiffuseMap>;
		
		VertexShader = <VS11>;
		PixelShader = <PS14>;
		
	}
}

//Second technique is for VS1.1 and PS1.3
technique VS1_1__PS_1_3
{
	pass P0
	{
		//Load matrices
		VertexShaderConstant[0] = <matWorldViewProj>; // World*View*Projection
		
		//Load constanst used to red shift
		VertexShaderConstant[4] = (0.9, 0, 0, 1);
		PixelShaderConstant[0]  = (1, 0, 0, 1);
		
		// textures
		Texture[0] = <texDiffuseMap>;
		
		VertexShader = <VS11>;
		PixelShader = <PS13>;
	}
}

//First technique for no shaders
technique Intel_Default
{
    pass P0
    {
        // textures
        Texture[0] = <texDiffuseMap>;
        
        ColorArg1[0] = COMPLEMENT | TEXTURE;
    }
}

technique Xaber_Default
{
    pass P0
    {
        // textures
        Texture[0] = <texDiffuseMap>;
        
        ColorArg1[0] = COMPLEMENT | TEXTURE;
    }
}

//Second technique for no shaders
//doesn't redmask at all
technique TNoShader2
{
    pass P0
    {
        // textures
        Texture[0] = <texDiffuseMap>;        
    }
}