attribute vec4 secondary_colour;
attribute vec4 colour;
attribute vec2 uv1;
attribute vec2 uv0;
attribute vec3 normal;
attribute vec4 vertex;
uniform vec4 WorldMatrixArray[216];
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 ()
{
  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 = float(tmpvar_1.w);
  float tmpvar_8;
  tmpvar_8 = dot (tmpvar_6, -(Lamp0Dir));
  vec4 tmpvar_9;
  tmpvar_9.xw = vec2(1.0, 1.0);
  tmpvar_9.y = max (0.0, tmpvar_8);
  tmpvar_9.z = pow ((max (0.0, dot (normalize((-(Lamp0Dir) + normalize((CameraPosition - tmpvar_5)))), tmpvar_6)) * float((tmpvar_8 >= 0.0))), tmpvar_7);
  vec4 tmpvar_10;
  tmpvar_10.w = 1.0;
  tmpvar_10.xyz = tmpvar_5;
  vec4 tmpvar_11;
  tmpvar_11 = (ViewProjection * tmpvar_10);
  vec4 tmpvar_12;
  tmpvar_12.xyz = (((tmpvar_5 + (tmpvar_6 * 6.0)).xzy * LightConfig0.xyz) + LightConfig1.xyz);
  tmpvar_12.w = ((FogParams.z - tmpvar_11.w) * FogParams.w);
  vec4 tmpvar_13;
  tmpvar_13.xyz = (CameraPosition - tmpvar_5);
  tmpvar_13.w = tmpvar_11.w;
  vec4 tmpvar_14;
  tmpvar_14.xyz = tmpvar_6;
  tmpvar_14.w = tmpvar_7;
  vec4 tmpvar_15;
  tmpvar_15.xyz = ((tmpvar_9.y * Lamp0Color) + (max (-(tmpvar_8), 0.0) * Lamp1Color));
  tmpvar_15.w = (tmpvar_9.z * (float(tmpvar_1.y) / 255.0));
  gl_Position = tmpvar_11;
  vec4 tmpvar_16;
  tmpvar_16.zw = vec2(0.0, 1.0);
  tmpvar_16.xy = uv0;
  gl_TexCoord[0] = tmpvar_16;
  vec4 tmpvar_17;
  tmpvar_17.zw = vec2(0.0, 1.0);
  tmpvar_17.xy = uv1;
  gl_TexCoord[1] = tmpvar_17;
  gl_FrontColor = colour;
  gl_TexCoord[2] = tmpvar_12;
  gl_TexCoord[3] = tmpvar_13;
  gl_TexCoord[4] = tmpvar_14;
  gl_FrontSecondaryColor = tmpvar_15;
  gl_FogFragCoord = tmpvar_11.w;
}

