void main ( 
		   float4 oPosition : TEXCOORD1,
		   float4 oPosition2 : TEXCOORD5,
		   float4 oThePos : TEXCOORD6,
                      float2 oUV : TEXCOORD0,
					  float3 oP : POSITION,
                      float4 HCOL : COLOR, 
                      
	float4 HCOL2 : COLOR1,
	float3 Ramp : TEXCOORD7,
                      
                      float3 oLight : TEXCOORD2,
                      float3 oHalf : TEXCOORD4,
                      float2 uvl : TEXCOORD5,
                      float3 oNormal : TEXCOORD3,



                    uniform float3 alpha,  
                    uniform float alpha2,  
                    uniform float alphaplane,  
                    uniform float alphaplane2,  
                    uniform float planecut,  
                    uniform float ttime,  
                   uniform sampler2D decal,
				   uniform sampler2D light,
                 uniform samplerCUBE cube,
				   uniform sampler2D texture,
                   uniform sampler1D oned,
				   uniform sampler2D texture2,
				   out float4 oColor1: COLOR0,
out float4 oColor2: COLOR1
//                   uniform samplerCUBE cube
//                   uniform sampler2D cubes
//uniform float3 lightPositionk   v

                   ) 
{



//if (sin(25*oUV.y)*sin(25*oUV.x)>0.2) discard;
oUV.y+=0.01*ttime;
oUV*=0.1;
float flt=sin(2*oUV.y)*sin(2*oUV.x)-ttime;
flt+=sin(5*oUV.y)*sin(4*oUV.x);
flt+=sin(3*oUV.y)*sin(3*oUV.x);
flt+=sin(7*oUV.y)*sin(6*oUV.x);
flt+=sin(14*oUV.y)*sin(13.2*oUV.x);
flt+=oUV.y*3;
flt=saturate(flt*115.5);

//flt*=20;
//flt=sin(flt*25);
//if (flt<0.5) flt=0; else flt=1;
//if (sin(5*oUV.x)>0.2) discard;
if (flt>0.5) discard;
//flt=1-flt;
oColor1=HCOL+(float4 (0.5,0.5,0.5,0)-HCOL)*flt;
oColor1*=tex2D (texture,oUV*0.4);
//oColor1=HCOL;

//float4 (1,0,0,1)+oUV.xyxy;
//oColor2=float4 (1,0,0,1);






}









































/* 


  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;




}
*/