attribute vec2 uv0;
attribute vec3 normal;
attribute vec4 vertex;
uniform mat4 WorldMatrix;
uniform float WaterTimeframe;
uniform float WaterSintime;
uniform mat4 ViewProjection;
uniform vec4 LightConfig1;
uniform vec4 LightConfig0;
uniform vec3 Lamp1Color;
uniform vec3 Lamp0Dir;
uniform vec3 Lamp0Color;
uniform vec4 FogParams;
uniform vec3 CameraPosition;
void main ()
{
  vec3 tmpvar_1;
  tmpvar_1 = (WorldMatrix * vertex).xyz;
  vec3 tmpvar_2;
  tmpvar_2 = normalize(normal);
  float tmpvar_3;
  tmpvar_3 = dot (tmpvar_2, -(Lamp0Dir));
  vec4 tmpvar_4;
  tmpvar_4.w = 1.0;
  tmpvar_4.xyz = tmpvar_1;
  vec4 tmpvar_5;
  tmpvar_5 = (ViewProjection * tmpvar_4);
  vec4 tmpvar_6;
  tmpvar_6.xw = vec2(1.0, 1.0);
  tmpvar_6.y = max (0.0, tmpvar_3);
  tmpvar_6.z = pow ((max (0.0, dot (normalize((-(Lamp0Dir) + normalize((CameraPosition - tmpvar_1)))), tmpvar_2)) * float((tmpvar_3 >= 0.0))), 25.0);
  vec4 tmpvar_7;
  tmpvar_7.xyz = ((clamp (tmpvar_3, 0.0, 1.0) * Lamp0Color) + (max (-(tmpvar_3), 0.0) * Lamp1Color));
  tmpvar_7.w = (0.4 * tmpvar_6.z);
  vec4 tmpvar_8;
  tmpvar_8.xyz = (((tmpvar_1 + (tmpvar_2 * 6.0)).xzy * LightConfig0.xyz) + LightConfig1.xyz);
  tmpvar_8.w = ((FogParams.z - tmpvar_5.w) * FogParams.w);
  vec4 tmpvar_9;
  tmpvar_9.xyz = tmpvar_1;
  tmpvar_9.w = tmpvar_5.w;
  float tmpvar_10;
  tmpvar_10 = floor(abs(dot (normal, vec3(1.0, 1.0, 1.0))));
  float tmpvar_11;
  tmpvar_11 = min (1.0, tmpvar_10);
  float tmpvar_12;
  tmpvar_12 = (1.0 - tmpvar_11);
  float tmpvar_13;
  tmpvar_13 = (((tmpvar_11 * WaterTimeframe) * tmpvar_10) + ((tmpvar_12 * 0.125) * WaterSintime));
  vec2 tmpvar_14;
  tmpvar_14.x = tmpvar_12;
  tmpvar_14.y = tmpvar_11;
  vec2 tmpvar_15;
  tmpvar_15.x = uv0.x;
  tmpvar_15.y = (uv0.y - (4.0 * tmpvar_13));
  gl_Position = tmpvar_5;
  vec4 tmpvar_16;
  tmpvar_16.zw = vec2(0.0, 1.0);
  tmpvar_16.xy = (uv0 - ((tmpvar_14 * 3.0) * tmpvar_13));
  gl_TexCoord[0] = tmpvar_16;
  vec4 tmpvar_17;
  tmpvar_17.zw = vec2(0.0, 1.0);
  tmpvar_17.xy = tmpvar_15;
  gl_TexCoord[1] = tmpvar_17;
  gl_FrontColor = tmpvar_7;
  gl_TexCoord[2] = tmpvar_8;
  gl_TexCoord[3] = tmpvar_9;
  gl_FogFragCoord = tmpvar_5.w;
}

