struct C2E2f_Output { 
	float3 color: COLOR;
};



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


	C2E2f_Output OUT;


	float4 cl;

float ccl1;

float4 ccl;

float2 MX=float2 (0.01,0);
float2 MU=float2 (0,0.01);

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

cl=1*tex2D (decal,oPosition);

cl+=1*tex2D (decal,oPosition+MX);
cl+=1*tex2D (decal,oPosition-MX);

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

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

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

cl+=1*tex2D (decal,oPosition+4*MX);
cl+=1*tex2D (decal,oPosition-4*MX);

cl+=1*tex2D (decal,oPosition+4*MU);
cl+=1*tex2D (decal,oPosition-4*MU);

OUT.color=cl/11.9f;


  /*
  OUT.color.x=1;
OUT.color.y=0;
OUT.color.z=0;*/
  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;




}
*/