struct C2E2f_Output { 
	float4 color: COLOR;
};


C2E2f_Output main (    float4 oPosition : TEXCOORD1,
                      float2 oUV : TEXCOORD0,
                      float4 HCOL : COLOR, 
                      
	float4 HCOL2 : COLOR1,
                      
                      float3 oLight : TEXCOORD2,
                      float3 oHalf : TEXCOORD4,
                      float3 oNormal : TEXCOORD3,

    uniform float alpha2,  

                    uniform float3 alpha,  
                   uniform sampler2D decal,
				   uniform sampler2D light,
				   uniform sampler2D texture,
				   uniform sampler2D texture2
//uniform float3 lightPosition

                   ) 
{



	C2E2f_Output OUT;


//float4 cll4=tex2Dproj (light,oPosition);

   
    //oPosition.y+=2*res.x-1;

///float4 normals=tex2D (texture2,oUV);
//oPosition.w*=0.5;
    float4 basetexture=tex2D (texture2,oUV);

//oPosition+=px*36;
//oPosition+=py*36;

float cll4=tex2Dproj (light,oPosition);


OUT.color=(basetexture*HCOL2*cll4*float4 (2,0.8,0.8,1)+HCOL2*float4 (0.06,0.03,0.03,1))*1.65;


//OUT.color=float4 (0,1,0,0);
//OUT.color=float4 (0,0,1,0);
//OUT.color=OUT.color+HCOL* (HCOL2-OUT.color);
//*(basetexture*(1.3*cll4+0.1))*2;

//OUT.color=(HCOL2+0*(1-HCOL2*basetexture)*(0.15+2*cll4)*1;
//OUT.color=((1-cll4)*HCOL2+cll4*basetexture-cll4*HCOL2)*(0.15+2*cll4)*1;
//OUT.color=(HCOL2+cll4*(basetexture-HCOL2));
//*(0.15+1*cll4)*1;
//OUT.color=(HCOL2+(cll4)*(basetexture-HCOL2))*0.1;
//OUT.color=(HCOL2)*(0.15+5553*cll4)*1;
//OUT.color=5553*cll4;
//OUT.color=(HCOL2*basetexture);

//OUT.color.w=0.88;
//OUT.color=40*cll4;
	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;




}
*/