attribute vec4 secondary_colour;
attribute vec4 colour;
attribute vec2 uv0;
attribute vec3 normal;
attribute vec3 vertex;
uniform mat4 WorldMatrix;
uniform mat4 ViewProjection;
uniform vec3 Lamp1Dir;
uniform vec3 Lamp1Color;
uniform vec3 Lamp0Dir;
uniform vec3 Lamp0Color;
uniform vec3 CameraPosition;
uniform vec3 AmbientColor;
void main ()
{
  vec4 tmpvar_1;
  tmpvar_1.w = 1.00000;
  tmpvar_1.xyz = vertex;
  vec3 tmpvar_2;
  tmpvar_2 = (WorldMatrix * tmpvar_1).xyz;
  float tmpvar_3;
  tmpvar_3 = dot (normal, -(Lamp0Dir));
  vec4 tmpvar_4;
  tmpvar_4.w = 1.00000;
  tmpvar_4.xyz = tmpvar_2;
  vec4 tmpvar_5;
  tmpvar_5 = (ViewProjection * tmpvar_4);
  vec4 tmpvar_6;
  tmpvar_6.xyz = ((AmbientColor + ((max (0.000000, tmpvar_3) * Lamp0Color) + (max (dot (normal, -(Lamp1Dir)), 0.000000) * Lamp1Color))) * colour.xyz);
  tmpvar_6.w = colour.w;
  vec4 tmpvar_7;
  tmpvar_7.w = 0.000000;
  tmpvar_7.xyz = ((pow ((max (0.000000, dot (normalize ((-(Lamp0Dir) + normalize ((CameraPosition - tmpvar_2)))), normal)) * step (0.000000, tmpvar_3)), 50.0000) * Lamp0Color) * secondary_colour.xyz);
  gl_Position = tmpvar_5;
  vec4 tmpvar_8;
  tmpvar_8.zw = vec2(0.000000, 1.00000);
  tmpvar_8.xy = uv0;
  gl_TexCoord[0] = tmpvar_8;
  gl_FrontColor = tmpvar_6;
  gl_FrontSecondaryColor = tmpvar_7;
  gl_FogFragCoord = tmpvar_5.w;
}

