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;
/*
float4 cmm=tex2D (decal2,oPosition*2);
float4 cmm2=tex2D (decal3,oPosition);

float4 ccl;
float v=sin(cmm.x*cmm2.x*6.14);
//v=v*v;
v=0.08*v;
v=0.1*v;
*/
float v=0.102;

float dss=1+length(oPosition-float2 (0.5,0.5));

float2 dirr=float2 (0.5,0.5);

v*=dss*dss;
v=0.002;
float2 MX=float2 (v,0);
float2 MU=float2 (0,v);

 cl=float4 (0,0,0,0);
/*
for (int t=0;t<7;t++) { 
float ff=float (t)/(20.0f);
//    cl+=0.11*(1-ff)*tex2D (decal,ff*dirr+(1-ff)*oPosition);
cl+=0.19*(1-ff)*tex2D (decal,ff*dirr+(1-ff)*oPosition);

}

0.05,0.1,0.15,0.2,0.25,0.3
*/


cl+=0.191*tex2D (decal,oPosition);

cl+=0.191*(0.95)*tex2D (decal,0.075*dirr+(1-0.075)*oPosition);
cl+=0.191*(0.9)*tex2D (decal,0.15*dirr+(1-0.015)*oPosition);
cl+=0.191*(0.85)*tex2D (decal,0.225*dirr+(1-0.225)*oPosition);

cl+=0.191*(0.8)*tex2D (decal,0.300*dirr+(1-0.300)*oPosition);
cl+=0.191*(0.75)*tex2D (decal,0.375*dirr+(1-0.375)*oPosition);
cl+=0.191*(0.7)*tex2D (decal,0.450*dirr+(1-0.450)*oPosition);


cl=round(cl*50)/50.0f;




/*
cl+=0.5*0.217*tex2D (decal,oPosition+MX);
cl+=0.5*0.217*tex2D (decal,oPosition-MX);

cl+=0.2*0.217*tex2D (decal,oPosition+2*MX);
cl+=0.2*0.217*tex2D (decal,oPosition-2*MX);


cl+=0.5*0.217*tex2D (decal,oPosition+MU);
cl+=0.5*0.217*tex2D (decal,oPosition-MU);

cl+=0.2*0.217*tex2D (decal,oPosition+2*MU);
cl+=0.2*0.217*tex2D (decal,oPosition-2*MU);


cl+=0.3*0.217*tex2D (decal,oPosition+1.3*MX);
cl+=0.3*0.217*tex2D (decal,oPosition-1.3*MU);

cl+=0.3*0.217*tex2D (decal,oPosition+1.3*MU);
cl+=0.3*0.217*tex2D (decal,oPosition-1.3*MX);
*/
//float dvv=40;
//cl=round (cl*dvv)/dvv;  
  



//float4 p1=1+4*tex2D (decal,oPosition+MX)-tex2D (decal,oPosition-MX);

//float4 p2=1+fabs(tex2D (decal,oPosition+MU)-tex2D (decal,oPosition+MU));



//if (cl.x<0.5) cl=1; else cl=0; 
/*
OUT.color.z=cl/1.4f;
OUT.color.y=cl/2.9f;
OUT.color.x=cl/11.9f;
*/

//cl.x*=0.6;

OUT.color=cl;



//OUT.color=0.4+noise (oPosition.x*1000);

/*
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;




}
*/