uniform sampler2D myTexture1;
uniform sampler2D myTexture2;
uniform sampler2D myTexture3;
uniform sampler2D myTexture4;
uniform sampler2D myTexture5;
uniform sampler2D myTexture6;
uniform sampler2D myTexture7;
uniform sampler2D myTexture8;
uniform sampler2D myTexture9;
uniform sampler2D myTexture10;
uniform sampler2D myTexture11;
uniform sampler2D myTexture12;
uniform sampler2D myTexture13;
uniform sampler2D myTexture14;
uniform sampler2D myTexture15;

uniform float myAmp1;
uniform float myAmp2;
uniform float myAmp3;
uniform float myAmp4;
uniform float myAmp5;
uniform float myAmp6;
uniform float myAmp7;
uniform float myAmp8;
uniform float myAmp9;
uniform float myAmp10;
uniform float myAmp11;
uniform float myAmp12;
uniform float myAmp13;
uniform float myAmp14;
uniform float myAmp15;

void main (void)
{
   vec4 texval1 = texture2D(myTexture1, vec2(gl_TexCoord[0]));
   vec4 texval2 = texture2D(myTexture2, vec2(gl_TexCoord[0]));
   vec4 texval3 = texture2D(myTexture3, vec2(gl_TexCoord[0]));
   float texval4 = texture2D(myTexture4, vec2(gl_TexCoord[0])).x;
   
/*   vec4 texval5 = myAmp5*texture2D(myTexture5, vec2(gl_TexCoord[0]));
   vec4 texval6 = myAmp6*texture2D(myTexture6, vec2(gl_TexCoord[0]));
   vec4 texval7 = myAmp7*texture2D(myTexture7, vec2(gl_TexCoord[0]));
   vec4 texval8 = myAmp8*texture2D(myTexture8, vec2(gl_TexCoord[0]));
   vec4 texval9 = myAmp9*texture2D(myTexture9, vec2(gl_TexCoord[0]));
   vec4 texval10 = myAmp10*texture2D(myTexture10, vec2(gl_TexCoord[0]));
   vec4 texval11 = myAmp11*texture2D(myTexture11, vec2(gl_TexCoord[0]));
   vec4 texval12 = myAmp12*texture2D(myTexture12, vec2(gl_TexCoord[0]));
   vec4 texval13 = myAmp13*texture2D(myTexture13, vec2(gl_TexCoord[0]));
   vec4 texval14 = myAmp14*texture2D(myTexture14, vec2(gl_TexCoord[0]));
   vec4 texval15 = myAmp15*texture2D(myTexture15, vec2(gl_TexCoord[0]));*/
   
   float invtexval4;
   if (myAmp1<=1.0)
   {
  	 texval4*=myAmp1;
  	 invtexval4 = 1.0-texval4.x;
  }
   else
   {
   
   	  float ratio = myAmp1 - 1.0;
   	  float val = texval4;
   	  invtexval4 = 1.0-texval4;
   	  texval4 = val;
   	  texval1 = mix(texval1, texval2, ratio);
   	  
   }
   gl_FragColor = texval1*(invtexval4) + (texval2*(texval4));
   
   
   
   
}