struct C2E2f_Output { 
	float3 color: COLOR;
};



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


	C2E2f_Output OUT;

//float3 sk=tex2D (decal,round (oPosition*80)/80.0f);
float3 sk=tex2D (decal,oPosition);

    
    float3 oPosition3;//=float3 (1,1,sk.y);
oPosition3.xy=(cl.xy)*(20);
oPosition3.z=sk.x*0.99;

float4 cll2=(tex3D (decal2,oPosition3));
float2 nps=sk.xy-float2 (0.5,0.5);
nps.x=0;
//OUT.color=tex3D (decal2,oPosition3);
//sk.x=sk.x-0.5;
sk.x*=0.01;
sk.x+=0.0;
sk.y=0.0-sk.x;



OUT.color.x=tex2D (decal,oPosition+sk.x*4);
OUT.color.y=tex2D (decal,oPosition+sk.x*3);
OUT.color.z=tex2D (decal,oPosition+sk.x*7);
//OUT.color+=0.3*tex2D (decal,round(oPosition*sk.x)/sk.x);

OUT.color=OUT.color;
/*
OUT.color.x=tex2D (decal,oPosition+sk.x*5.5);
OUT.color.y=tex2D (decal,oPosition+sk.x*3.3);
OUT.color.z=tex2D (decal,oPosition+sk.y*1);
*/
//OUT.color.x-=tex2D (decal,oPosition+sk.x*1.5);
//OUT.color.y-=tex2D (decal,oPosition+sk.x*1.3);
//OUT.color.z-=tex2D (decal,oPosition+sk.y*20.3);

//OUT.color=round(OUT.color*1)/1.0f;

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;




}
*/