varying vec4 animLerpVposVarying;
varying vec4 uvVarying;
varying vec4 colorVarying;
uniform vec3 g_ParticleAnimFrames;
uniform vec3 g_vLightColorBottom;
uniform vec3 g_vLightColorTop;
uniform float g_fParticle3DRotation;
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;
  float tmpvar_12;
  tmpvar_12 = (g_fParticle3DRotation * (velocityRotation.w * 0.0174533));
  float tmpvar_13;
  tmpvar_13 = sin(tmpvar_12);
  float tmpvar_14;
  tmpvar_14 = cos(tmpvar_12);
  vec3 tmpvar_15;
  tmpvar_15.z = 0.000000;
  tmpvar_15.x = tmpvar_14;
  tmpvar_15.y = tmpvar_13;
  vec3 tmpvar_16;
  tmpvar_16.z = 0.000000;
  tmpvar_16.x = -(tmpvar_13);
  tmpvar_16.y = tmpvar_14;
  float tmpvar_17;
  tmpvar_17 = (g_fParticle3DRotation * rot3dAnimDispUser.x);
  float tmpvar_18;
  tmpvar_18 = sin(tmpvar_17);
  float tmpvar_19;
  tmpvar_19 = cos(tmpvar_17);
  mat3 tmpvar_20;
  tmpvar_20[0].x = tmpvar_19;
  tmpvar_20[0].y = 0.000000;
  tmpvar_20[0].z = tmpvar_18;
  tmpvar_20[1].x = 0.000000;
  tmpvar_20[1].y = 1.00000;
  tmpvar_20[1].z = 0.000000;
  tmpvar_20[2].x = -(tmpvar_18);
  tmpvar_20[2].y = 0.000000;
  tmpvar_20[2].z = tmpvar_19;
  mat3 tmpvar_21;
  tmpvar_21[0] = (tmpvar_15 * tmpvar_20);
  tmpvar_21[1] = (tmpvar_16 * tmpvar_20);
  tmpvar_21[2] = (vec3(0.000000, 0.000000, 1.00000) * tmpvar_20);
  vec3 tmpvar_22;
  tmpvar_22.z = 0.000000;
  tmpvar_22.xy = tmpvar_11.xy;
  vec3 tmpvar_23;
  tmpvar_23.xy = (tmpvar_22 * tmpvar_21).xy;
  tmpvar_23.z = tmpvar_11.z;
  vec4 tmpvar_24;
  tmpvar_24 = (color * g_vColor);
  vColor_2.w = tmpvar_24.w;
  vec3 tmpvar_25;
  tmpvar_25.z = 0.000000;
  tmpvar_25.x = tmpvar_11.x;
  tmpvar_25.y = tmpvar_11.y;
  vColor_2.xyz = ((tmpvar_24.xyz * mix (g_vLightColorTop, g_vLightColorBottom, clamp (((normalize((normalize(velocityRotation.xyz) + (0.300000 * (normalize(tmpvar_25) * tmpvar_21)))).y + 1.00000) * 0.500000), 0.000000, 1.00000))) + (tmpvar_24.xyz * scaleIncandVid.z));
  vec4 tmpvar_26;
  tmpvar_26.w = 1.00000;
  tmpvar_26.xyz = ((((tmpvar_23 + positionNormAge.xyz) * g_vScale) + g_vParticleToWorld) * 300.000);
  vec4 tmpvar_27;
  tmpvar_27 = (tmpvar_26 * g_mViewProj);
  gl_Position = tmpvar_27;
  vec4 tmpvar_28;
  tmpvar_28.zw = vec2(0.000000, 0.000000);
  tmpvar_28.xy = (tmpvar_5 + 0.500000);
  vec4 vFrameUVs_29;
  float tmpvar_30;
  tmpvar_30 = (rot3dAnimDispUser.y * g_ParticleAnimFrames.x);
  float tmpvar_31;
  tmpvar_31 = floor(tmpvar_30);
  vec2 vFrameOffset_32;
  float tmpvar_33;
  tmpvar_33 = (float(mod (tmpvar_31, g_ParticleAnimFrames.x)));
  vFrameOffset_32.x = (float(mod (tmpvar_33, g_ParticleAnimFrames.y)));
  vFrameOffset_32.y = floor((tmpvar_33 / g_ParticleAnimFrames.y));
  vFrameUVs_29.xy = ((vFrameOffset_32 + tmpvar_28.xy) * g_ParticleAnimFrames.z);
  float fFrameIndex_34;
  fFrameIndex_34 = (tmpvar_31 + 1.00000);
  vec2 vFrameOffset_35;
  float tmpvar_36;
  tmpvar_36 = (float(mod (fFrameIndex_34, g_ParticleAnimFrames.x)));
  fFrameIndex_34 = tmpvar_36;
  vFrameOffset_35.x = (float(mod (tmpvar_36, g_ParticleAnimFrames.y)));
  vFrameOffset_35.y = floor((tmpvar_36 / g_ParticleAnimFrames.y));
  vFrameUVs_29.zw = ((vFrameOffset_35 + tmpvar_28.xy) * g_ParticleAnimFrames.z);
  vec2 tmpvar_37;
  tmpvar_37 = (((tmpvar_27.xy / tmpvar_27.w) + 1.00000) * 0.500000);
  vNormScreenPos_1.x = tmpvar_37.x;
  vNormScreenPos_1.y = (1.00000 - tmpvar_37.y);
  uvVarying = vFrameUVs_29;
  colorVarying = vColor_2;
  vec4 tmpvar_38;
  tmpvar_38.w = 0.000000;
  tmpvar_38.x = (float(mod (tmpvar_30, 1.00000)));
  tmpvar_38.yz = vNormScreenPos_1;
  animLerpVposVarying = tmpvar_38;
}

