varying highp vec4 xlv_COLOR1;
varying highp vec4 xlv_TEXCOORD2;
varying highp vec4 xlv_COLOR0;
varying highp vec4 xlv_TEXCOORD1;
varying highp vec4 xlv_TEXCOORD0;
attribute vec4 secondary_colour;
attribute vec4 colour;
attribute vec2 uv1;
attribute vec2 uv0;
attribute vec3 normal;
attribute vec4 vertex;
uniform highp vec4 WorldMatrixArray[96];
uniform highp vec4 LightConfig1;
uniform highp vec4 LightConfig0;
uniform highp vec4 FogParams;
uniform highp vec3 Lamp1Color;
uniform highp vec3 Lamp0Color;
uniform highp vec3 Lamp0Dir;
uniform highp mat4 ViewProjection;
uniform highp vec3 CameraPosition;
void main ()
{
  highp vec4 tmpvar_1;
  highp vec4 tmpvar_2;
  tmpvar_1.zw = vec2(0.0, 0.0);
  tmpvar_2.zw = vec2(0.0, 0.0);
  int tmpvar_3;
  tmpvar_3 = int(secondary_colour.x);
  highp vec4 tmpvar_4;
  tmpvar_4 = WorldMatrixArray[(tmpvar_3 * 3)];
  highp vec4 tmpvar_5;
  tmpvar_5 = WorldMatrixArray[((tmpvar_3 * 3) + 1)];
  highp vec4 tmpvar_6;
  tmpvar_6 = WorldMatrixArray[((tmpvar_3 * 3) + 2)];
  highp vec3 tmpvar_7;
  tmpvar_7.x = dot (tmpvar_4, vertex);
  tmpvar_7.y = dot (tmpvar_5, vertex);
  tmpvar_7.z = dot (tmpvar_6, vertex);
  highp vec3 tmpvar_8;
  tmpvar_8.x = dot (tmpvar_4.xyz, normal);
  tmpvar_8.y = dot (tmpvar_5.xyz, normal);
  tmpvar_8.z = dot (tmpvar_6.xyz, normal);
  highp float tmpvar_9;
  tmpvar_9 = dot (tmpvar_8, -(Lamp0Dir));
  highp vec4 tmpvar_10;
  tmpvar_10.xw = vec2(1.0, 1.0);
  tmpvar_10.y = max (0.0, tmpvar_9);
  tmpvar_10.z = pow ((max (0.0, dot (normalize((-(Lamp0Dir) + normalize((CameraPosition - tmpvar_7)))), tmpvar_8)) * float((tmpvar_9 >= 0.0))), secondary_colour.z);
  highp vec4 tmpvar_11;
  tmpvar_11.w = 1.0;
  tmpvar_11.xyz = tmpvar_7;
  highp vec4 tmpvar_12;
  tmpvar_12 = (ViewProjection * tmpvar_11);
  tmpvar_1.xy = uv0;
  tmpvar_2.xy = uv1;
  highp vec4 tmpvar_13;
  tmpvar_13.xyz = (((tmpvar_7 + (tmpvar_8 * 6.0)).yxz * LightConfig0.xyz) + LightConfig1.xyz);
  tmpvar_13.w = ((FogParams.z - tmpvar_12.w) * FogParams.w);
  highp vec4 tmpvar_14;
  tmpvar_14.xyz = ((tmpvar_10.y * Lamp0Color) + (max (-(tmpvar_9), 0.0) * Lamp1Color));
  tmpvar_14.w = (tmpvar_10.z * (secondary_colour.y / 255.0));
  gl_Position = tmpvar_12;
  xlv_TEXCOORD0 = tmpvar_1;
  xlv_TEXCOORD1 = tmpvar_2;
  xlv_COLOR0 = colour;
  xlv_TEXCOORD2 = tmpvar_13;
  xlv_COLOR1 = tmpvar_14;
}

