// O[XP[
//================================================================
//ݒl
//Texture
sampler sampler0_ : register(s0);

//--------------------------------

float power_; //O[XP[̋x(0-1)


//================================================================
//--------------------------------
//sNZVF[_͒l
struct PS_INPUT
{
	float4 diffuse : COLOR0;  //fBt[YF
	float2 texCoord : TEXCOORD0; //eNX`W
	float2 vPos : VPOS; //`W
};

//--------------------------------
//sNZVF[_o͒l
struct PS_OUTPUT
{
    float4 color : COLOR0; //o͐F
};


//================================================================
// VF[_
//--------------------------------
//sNZVF[_
PS_OUTPUT PscMonotone( PS_INPUT In ) : COLOR0
{
	PS_OUTPUT Out;

	//--------------------------------
	//eNX`̐F
	float4 colorTexture = tex2D(sampler0_, In.texCoord);

	//_fBt[YF
	float4 colorDiffuse = In.diffuse;

	//
	float4 color = colorTexture * colorDiffuse;

	//mg[̌vZ
//	Out.color.rgb = (color.r+color.g+color.b)*0.3333f;
	Out.color.r = color.r*(1.0f-0.6667f*power_) + (color.g+color.b)*power_*0.3333f;
	Out.color.g = color.g*(1.0f-0.6667f*power_) + (color.r+color.b)*power_*0.3333f;
	Out.color.b = color.b*(1.0f-0.6667f*power_) + (color.r+color.g)*power_*0.3333f;
	Out.color.a = color.a;

	return Out;
}


//================================================================
//--------------------------------
//technique
technique TecMonotone
{
	pass P0
	{
		PixelShader = compile ps_3_0 PscMonotone();
	}
}

