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,
 uniform float3 alpha2
 ) 
{


	C2E2f_Output OUT;


	float4 cl;
	float4 cl2;

cl=tex2D (decal,oPosition);


//cl2=tex2D (decal,oPosition+float2 (0.005,0));
//*float4 (1,0,0,0);
//cl=pow (cl,140-140*oPosition.y);
//cl=pow (cl,(1+oPosition.y*oPosition.y*oPosition.y*1)*1);
float ff=1;
//(2.3+3.2-8*oPosition.y*oPosition.y);





//float f=ff*66;
float f=((oPosition.y+alpha2)+(oPosition.x+alpha))*cl.z*0.1;
f=cl.z*0.4-cl.x*0.2;
//f=1;
f*=alpha;
//float f=((oPosition.y+alpha2)+(oPosition.x+alpha))*cl.z*0.1;

//200+cl.x*5;
float fft=150+f*80;
//f*=0.0;
//cl=tex2D (decal,oPosition-f);
f*=1.2;
fft=(oPosition.y+0.5)*3+1+(oPosition.x+0.5)*3+f;


fft=1.6-f*1+alpha2;
cl=tex2D (decal,round((oPosition)*fft)/fft);
//cl=tex2D (decal,oPosition);

//fft=f*100;
//cl=tex2D (decal,oPosition+float2 (fft,fft*0.0));
//cl=tex2D (decal,oPosition-f);





//float ff=7;
//cl=pow (cl,300);
//cl=0.02*pow (cl*ff,14);
cl=0.02*pow (cl*4,1+int(alpha2*10));
//cl=alpha*pow (cl*4,1+int(alpha2*10));

//cl+=(cl-cl2)*1.2;
//(1+oPosition.y*oPosition.y*oPosition.y*1)*1);

OUT.color=cl;


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;




}
*/