attribute vec4 secondary_colour;
attribute vec2 uv1;
attribute vec2 uv0;
attribute vec3 normal;
attribute vec4 vertex;
uniform vec4 WorldMatrixArray[216];
uniform mat4 ViewProjection;
uniform vec3 Lamp1Dir;
uniform vec3 Lamp1Color;
uniform vec3 Lamp0Dir;
uniform vec3 Lamp0Color;
uniform vec4 DebugColor;
uniform vec3 CameraPosition;
uniform vec3 AmbientColor;
void main ()
{
  ivec4 tmpvar_1;
  tmpvar_1 = ivec4(secondary_colour);
  vec4 tmpvar_2;
  tmpvar_2 = WorldMatrixArray[(tmpvar_1.x * 3)];
  vec4 tmpvar_3;
  tmpvar_3 = WorldMatrixArray[((tmpvar_1.x * 3) + 1)];
  vec4 tmpvar_4;
  tmpvar_4 = WorldMatrixArray[((tmpvar_1.x * 3) + 2)];
  vec3 tmpvar_5;
  tmpvar_5.x = dot (tmpvar_2, vertex);
  tmpvar_5.y = dot (tmpvar_3, vertex);
  tmpvar_5.z = dot (tmpvar_4, vertex);
  vec3 tmpvar_6;
  tmpvar_6.x = dot (tmpvar_2.xyz, normal);
  tmpvar_6.y = dot (tmpvar_3.xyz, normal);
  tmpvar_6.z = dot (tmpvar_4.xyz, normal);
  float tmpvar_7;
  tmpvar_7 = dot (tmpvar_6, -(Lamp0Dir));
  vec4 tmpvar_8;
  tmpvar_8.w = 1.00000;
  tmpvar_8.xyz = tmpvar_5;
  vec4 tmpvar_9;
  tmpvar_9 = (ViewProjection * tmpvar_8);
  vec4 tmpvar_10;
  tmpvar_10.xyz = ((AmbientColor + ((max (0.000000, tmpvar_7) * Lamp0Color) + (max (dot (tmpvar_6, -(Lamp1Dir)), 0.000000) * Lamp1Color))) * DebugColor.xyz);
  tmpvar_10.w = DebugColor.w;
  vec4 tmpvar_11;
  tmpvar_11.w = 0.000000;
  tmpvar_11.xyz = ((pow ((max (0.000000, dot (normalize ((-(Lamp0Dir) + normalize ((CameraPosition - tmpvar_5)))), tmpvar_6)) * step (0.000000, tmpvar_7)), 50.0000) * Lamp0Color) * 0.900000);
  gl_Position = tmpvar_9;
  vec4 tmpvar_12;
  tmpvar_12.zw = vec2(0.000000, 1.00000);
  tmpvar_12.xy = uv0;
  gl_TexCoord[0] = tmpvar_12;
  vec4 tmpvar_13;
  tmpvar_13.zw = vec2(0.000000, 1.00000);
  tmpvar_13.xy = uv1;
  gl_TexCoord[1] = tmpvar_13;
  gl_FrontColor = tmpvar_10;
  gl_FrontSecondaryColor = tmpvar_11;
  gl_FogFragCoord = tmpvar_9.w;
}

