uniform vec4 vSunDir;
uniform vec4 vSkyLightDir;
uniform float fFogDensity;
uniform mat4 matWorldViewProj;
uniform mat4 matWorldView;
uniform mat4 matWorld;
uniform mat4 matSunViewProj;
uniform vec4 vCameraPos;
uniform float flora_detail;
attribute vec3 inPosition;
attribute vec3 inNormal;
attribute vec4 inColor0;
attribute vec4 inColor1;
attribute vec2 inTexCoord;
attribute vec3 inTangent;
attribute vec3 inBinormal;
varying vec4 VertexColor;
varying vec2 Tex0;
varying vec3 SunLightDir;
varying vec3 SkyLightDir;
varying vec4 PointLightDir;
varying vec4 ShadowTexCoord;
varying float Fog;
varying vec3 ViewDir;
varying vec3 WorldNormal;
void main ()
{
  vec4 tmpvar_1;
  tmpvar_1.w = 1.0;
  tmpvar_1.xyz = inPosition;
  vec4 tmpvar_2;
  vec4 tmpvar_3;
  vec4 tmpvar_4;
  tmpvar_4 = (matWorld * tmpvar_1);
  vec3 tmpvar_5;
  tmpvar_5 = (vCameraPos.xyz - tmpvar_4.xyz);
  float tmpvar_6;
  tmpvar_6 = (flora_detail * 0.75);
  vec4 tmpvar_7;
  tmpvar_7.w = 0.0;
  tmpvar_7.xyz = inNormal;
  vec3 tmpvar_8;
  tmpvar_8 = normalize((matWorld * tmpvar_7).xyz);
  vec4 tmpvar_9;
  tmpvar_9.w = 0.0;
  tmpvar_9.xyz = inBinormal;
  vec3 tmpvar_10;
  tmpvar_10 = normalize((matWorld * tmpvar_9).xyz);
  vec4 tmpvar_11;
  tmpvar_11.w = 0.0;
  tmpvar_11.xyz = inTangent;
  vec3 tmpvar_12;
  tmpvar_12 = normalize((matWorld * tmpvar_11).xyz);
  vec3 tmpvar_13;
  tmpvar_13 = (matWorldView * tmpvar_1).xyz;
  vec3 tmpvar_14;
  tmpvar_14.x = tmpvar_12.x;
  tmpvar_14.y = tmpvar_10.x;
  tmpvar_14.z = tmpvar_8.x;
  vec3 tmpvar_15;
  tmpvar_15.x = tmpvar_12.y;
  tmpvar_15.y = tmpvar_10.y;
  tmpvar_15.z = tmpvar_8.y;
  vec3 tmpvar_16;
  tmpvar_16.x = tmpvar_12.z;
  tmpvar_16.y = tmpvar_10.z;
  tmpvar_16.z = tmpvar_8.z;
  mat3 tmpvar_17;
  tmpvar_17[0] = tmpvar_14;
  tmpvar_17[1] = tmpvar_15;
  tmpvar_17[2] = tmpvar_16;
  tmpvar_3.xyz = ((2.0 * inColor1.xyz) - 1.0);
  tmpvar_3.w = inColor1.w;
  tmpvar_2.xyz = inColor0.zyx;
  tmpvar_2.w = (inColor0.w * clamp ((0.5 + 
    ((sqrt(dot (tmpvar_5, tmpvar_5)) - tmpvar_6) / (flora_detail - tmpvar_6))
  ), 0.0, 1.0));
  gl_Position = (matWorldViewProj * tmpvar_1);
  VertexColor = tmpvar_2;
  Tex0 = inTexCoord;
  SunLightDir = (tmpvar_17 * -(vSunDir.xyz));
  SkyLightDir = (tmpvar_17 * -(vSkyLightDir.xyz));
  PointLightDir = tmpvar_3;
  ShadowTexCoord = (matSunViewProj * tmpvar_4);
  Fog = (1.0/(exp2((
    sqrt(dot (tmpvar_13, tmpvar_13))
   * fFogDensity))));
  ViewDir = normalize((vCameraPos.xyz - tmpvar_4.xyz));
  WorldNormal = tmpvar_8;
}

