struct C2E2f_Output { 
	float3 color: COLOR;
};



C2E2f_Output main (    float2 oPosition : TEXCOORD0,
	uniform sampler2D decal,			   
	uniform sampler2D decal2,
//uniform sampler2D decal3,
//float4 cl : COLOR
//float4 HCOL2 : COLOR0
 uniform float3 alpha
 ) 
{


	C2E2f_Output OUT;


	float4 cl;

float ccl1;
float v=0.0102;


//oPosition*=0.3;
//oPosition+=0.5;

//mx=0.4;
//oPosition+=(tex2D (decal2,oPosition)-0.5)*0.7; 
//oPosition*=0.2;

cl=3*abs(tex2D (decal,oPosition)-tex2D (decal,oPosition+float2 (0.008,0)));
//cl=tex2D (decal,oPosition);


//cl+=abs(tex2D (decal,oPosition)-tex2D (decal,oPosition+float2 (0,0.005)));

//oPosition+=0.6*tex2D(decal2,oPosition*0.2);
//cl-=tex2D (decal,oPosition+float2 (0.001,0));

//cl=tex2D (decal,oPosition)*0.01;
float4 cc=float4 (1,1,1,1)*cl;
//cc=min (1,cc);

OUT.color=cl*0.7*tex2D (decal2,oPosition)*float4 (1,0.5,0.3,1);
OUT.color=0.99*tex2D (decal,oPosition);


float cmm=dot (tex2D(decal2,round(oPosition*40)/40),float4 (1,1,1,1));
//float cmm=dot (cl,float4 (1,1,1,1));
/*

if (cmm<2.9)
OUT.color=float4 (0,0,0,0);
else
OUT.color=ound(float4 (cmm*cmm*0.01,0,0,0));
*/

//OUT.color=cl*1*(1+tex2D (decal2,oPosition));
//OUT.color=(cl*0.3);

//OUT.color=cl*1.25+float4 (0.0,0,0,1);
//OUT.color=float4 (1,1,1,1)-cl*211*float4 (0.5,0.8,1,1);

//OUT.color=tex2D (decal,oPosition);
//OUT.color=tex2D (decal2,oPosition)*1;


//OUT.color+=0.5*tex2D (decal,round(oPosition*10)/10.0f);

//OUT.color=cl*0.2;
//OUT.color=round(OUT.color*60)/60.0f;
/*
OUT.color.z=cl.x/11.9f;
OUT.color.y=cl.y/11.9f;
OUT.color.x=cl.z/11.9f;
*/



return OUT;




}









































/* 


  FRAGMENT ENV MAP 



  struct C2E2f_Output { 
	float4 color: COLOR;
};


C2E2f_Output main (    float2 oPosition : TEXCOORD0,
    float2 oPosition2 : TEXCOORD1,
	uniform sampler2D decal,			   
	uniform sampler2D decal2					   
				   ) 
{



	C2E2f_Output OUT;

//float fc=1;
//fc=position.x;
	//float2 norm;
	//norm.x=oNormal.x;
	//norm.y=oNormal.y;

OUT.color=tex2D (decal2,oPosition);

float dx=ddx(OUT.color.x);
float dy=ddx(OUT.color.x);

oPosition2.x+=dx*1;
oPosition2.y+=dy*1;


  OUT.color=tex2D (decal,oPosition2);




  
  
  //OUT.color.y=0;
//OUT.color.z=0;
//  OUT.color-=tex2D (decal,oPosition2);


	return OUT;




}
*/