varying highp vec4 xlv_COLOR1;
varying highp vec4 xlv_TEXCOORD4;
varying highp vec4 xlv_TEXCOORD3;
varying highp vec4 xlv_TEXCOORD2;
varying highp vec4 xlv_COLOR0;
varying highp vec4 xlv_TEXCOORD1;
varying highp vec4 xlv_TEXCOORD0;
attribute vec4 uv4;
attribute vec4 secondary_colour;
attribute vec4 colour;
attribute vec2 uv1;
attribute vec2 uv0;
attribute vec3 normal;
attribute vec4 vertex;
uniform highp vec3 FadeDistance;
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;
  highp float tmpvar_3;
  tmpvar_3 = dot (normal, -(Lamp0Dir));
  highp float tmpvar_4;
  tmpvar_4 = clamp (tmpvar_3, 0.0, 1.0);
  highp vec2 tmpvar_5;
  tmpvar_5.x = tmpvar_4;
  tmpvar_5.y = float((tmpvar_3 > 0.0));
  highp vec4 tmpvar_6;
  tmpvar_6.w = 1.0;
  tmpvar_6.xyz = vertex.xyz;
  highp vec4 tmpvar_7;
  tmpvar_7 = (ViewProjection * tmpvar_6);
  tmpvar_1.xy = uv0;
  tmpvar_2.xy = uv1;
  highp vec4 tmpvar_8;
  tmpvar_8.xyz = (((vertex.xyz + (normal * 6.0)).yxz * LightConfig0.xyz) + LightConfig1.xyz);
  tmpvar_8.w = ((FogParams.z - tmpvar_7.w) * FogParams.w);
  highp vec4 tmpvar_9;
  tmpvar_9.xyz = (CameraPosition - vertex.xyz);
  tmpvar_9.w = (tmpvar_7.w * FadeDistance.y);
  highp vec4 tmpvar_10;
  tmpvar_10 = ((uv4 * FadeDistance.z) + (0.5 * tmpvar_9.w));
  tmpvar_1.zw = tmpvar_10.xy;
  tmpvar_2.zw = tmpvar_10.zw;
  highp vec4 tmpvar_11;
  tmpvar_11.xyz = normal;
  tmpvar_11.w = secondary_colour.z;
  highp vec4 tmpvar_12;
  tmpvar_12.xyz = ((tmpvar_4 * Lamp0Color) + (max (-(tmpvar_3), 0.0) * Lamp1Color));
  tmpvar_12.w = (tmpvar_5.y * (secondary_colour.y / 255.0));
  gl_Position = tmpvar_7;
  xlv_TEXCOORD0 = tmpvar_1;
  xlv_TEXCOORD1 = tmpvar_2;
  xlv_COLOR0 = colour;
  xlv_TEXCOORD2 = tmpvar_8;
  xlv_TEXCOORD3 = tmpvar_9;
  xlv_TEXCOORD4 = tmpvar_11;
  xlv_COLOR1 = tmpvar_12;
}

