varying vec4 animLerpVposVarying;
varying vec4 uvVarying;
varying vec4 colorVarying;
uniform vec3 g_ParticleAnimFrames;
uniform vec3 g_vLightColorBottom;
uniform vec3 g_vLightColorTop;
uniform mat4 g_mVertexPositions;
uniform vec2 g_vParticlePivot;
uniform vec4 g_vColor;
uniform mat4 g_mViewProj;
uniform vec3 g_vParticleToWorld;
uniform vec3 g_vScale;
attribute vec4 rot3dAnimDispUser;
attribute vec4 color;
attribute vec4 velocityRotation;
attribute vec4 scaleIncandVid;
attribute vec4 positionNormAge;
void main ()
{
  vec2 vNormScreenPos_1;
  vec4 vColor_2;
  vec3 vPos_3;
  int tmpvar_4;
  tmpvar_4 = int(scaleIncandVid.w);
  vec2 tmpvar_5;
  tmpvar_5 = g_mVertexPositions[tmpvar_4].xy;
  vec3 tmpvar_6;
  tmpvar_6.z = 0.000000;
  tmpvar_6.xy = (tmpvar_5 + g_vParticlePivot);
  vPos_3.z = tmpvar_6.z;
  vPos_3.x = (tmpvar_6.x * scaleIncandVid.x);
  vPos_3.y = ((tmpvar_6.y * scaleIncandVid.x) * scaleIncandVid.y);
  float tmpvar_7;
  tmpvar_7 = (velocityRotation.w * 0.0174533);
  float tmpvar_8;
  tmpvar_8 = sin(tmpvar_7);
  float tmpvar_9;
  tmpvar_9 = cos(tmpvar_7);
  mat2 tmpvar_10;
  tmpvar_10[0].x = tmpvar_9;
  tmpvar_10[0].y = -(tmpvar_8);
  tmpvar_10[1].x = tmpvar_8;
  tmpvar_10[1].y = tmpvar_9;
  vec3 tmpvar_11;
  tmpvar_11.xy = (vPos_3.xy * tmpvar_10);
  tmpvar_11.z = vPos_3.z;
  vPos_3 = tmpvar_11;
  vec3 tmpvar_12;
  tmpvar_12 = normalize(velocityRotation.xyz);
  vec3 tmpvar_13;
  tmpvar_13 = normalize(((vec3(0.000000, 1.00000, 0.000000) * tmpvar_12.zxy) - (vec3(1.00000, 0.000000, 0.000000) * tmpvar_12.yzx)));
  mat3 tmpvar_14;
  tmpvar_14[0] = tmpvar_13;
  tmpvar_14[1] = tmpvar_12;
  tmpvar_14[2] = ((tmpvar_12.yzx * tmpvar_13.zxy) - (tmpvar_12.zxy * tmpvar_13.yzx));
  vec3 tmpvar_15;
  tmpvar_15.z = 0.000000;
  tmpvar_15.xy = tmpvar_11.xy;
  vec3 tmpvar_16;
  tmpvar_16.xy = (tmpvar_15 * tmpvar_14).xy;
  tmpvar_16.z = tmpvar_11.z;
  vec3 tmpvar_17;
  tmpvar_17 = (tmpvar_16 + positionNormAge.xyz);
  vec4 tmpvar_18;
  tmpvar_18 = (color * g_vColor);
  vColor_2.w = tmpvar_18.w;
  vec3 tmpvar_19;
  tmpvar_19.z = 0.000000;
  tmpvar_19.x = tmpvar_11.x;
  tmpvar_19.y = tmpvar_11.y;
  vColor_2.xyz = ((tmpvar_18.xyz * mix (g_vLightColorTop, g_vLightColorBottom, clamp (((normalize((-(normalize(tmpvar_17)) + (2.00000 * (normalize(tmpvar_19) * tmpvar_14)))).y + 1.00000) * 0.500000), 0.000000, 1.00000))) + (tmpvar_18.xyz * scaleIncandVid.z));
  vec4 tmpvar_20;
  tmpvar_20.w = 1.00000;
  tmpvar_20.xyz = (((tmpvar_17 * g_vScale) + g_vParticleToWorld) * 300.000);
  vec4 tmpvar_21;
  tmpvar_21 = (tmpvar_20 * g_mViewProj);
  gl_Position = tmpvar_21;
  vec4 tmpvar_22;
  tmpvar_22.zw = vec2(0.000000, 0.000000);
  tmpvar_22.xy = (tmpvar_5 + 0.500000);
  float fLerpAmount_23;
  vec4 vFrameUVs_24;
  vec2 vFrameOffset_25;
  float tmpvar_26;
  tmpvar_26 = (float(mod (floor((rot3dAnimDispUser.y * g_ParticleAnimFrames.x)), g_ParticleAnimFrames.x)));
  vFrameOffset_25.x = (float(mod (tmpvar_26, g_ParticleAnimFrames.y)));
  vFrameOffset_25.y = floor((tmpvar_26 / g_ParticleAnimFrames.y));
  vFrameUVs_24.xy = ((vFrameOffset_25 + tmpvar_22.xy) * g_ParticleAnimFrames.z);
  vec2 tmpvar_27;
  tmpvar_27 = (((tmpvar_21.xy / tmpvar_21.w) + 1.00000) * 0.500000);
  vNormScreenPos_1.x = tmpvar_27.x;
  vNormScreenPos_1.y = (1.00000 - tmpvar_27.y);
  uvVarying = vFrameUVs_24;
  colorVarying = vColor_2;
  vec4 tmpvar_28;
  tmpvar_28.w = 0.000000;
  tmpvar_28.x = fLerpAmount_23;
  tmpvar_28.yz = vNormScreenPos_1;
  animLerpVposVarying = tmpvar_28;
}

