varying vec4 animLerpVposVarying;
varying vec4 uvVarying;
varying vec4 colorVarying;
uniform vec3 g_ParticleAnimFrames;
uniform vec3 g_vLightColorBottom;
uniform vec3 g_vLightColorTop;
uniform vec2 g_vProportionalVelocity;
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);
  vec3 tmpvar_7;
  tmpvar_7 = (normalize(velocityRotation.xyz) * clamp ((sqrt(dot (velocityRotation.xyz, velocityRotation.xyz)) * g_vProportionalVelocity.y), 0.000000, g_vProportionalVelocity.x));
  vec3 tmpvar_8;
  tmpvar_8 = normalize(((vec3(0.000000, 1.00000, 0.000000) * tmpvar_7.zxy) - (vec3(1.00000, 0.000000, 0.000000) * tmpvar_7.yzx)));
  mat3 tmpvar_9;
  tmpvar_9[0] = tmpvar_8;
  tmpvar_9[1] = tmpvar_7;
  tmpvar_9[2] = ((tmpvar_7.yzx * tmpvar_8.zxy) - (tmpvar_7.zxy * tmpvar_8.yzx));
  vec3 tmpvar_10;
  tmpvar_10.z = 0.000000;
  tmpvar_10.xy = vPos_3.xy;
  vec3 tmpvar_11;
  tmpvar_11.xy = (tmpvar_10 * tmpvar_9).xy;
  tmpvar_11.z = vPos_3.z;
  vec3 tmpvar_12;
  tmpvar_12 = (tmpvar_11 + positionNormAge.xyz);
  vec4 tmpvar_13;
  tmpvar_13 = (color * g_vColor);
  vColor_2.w = tmpvar_13.w;
  vec3 tmpvar_14;
  tmpvar_14.z = 0.000000;
  tmpvar_14.x = vPos_3.x;
  tmpvar_14.y = vPos_3.y;
  vColor_2.xyz = ((tmpvar_13.xyz * mix (g_vLightColorTop, g_vLightColorBottom, clamp (((normalize((-(normalize(tmpvar_12)) + (2.00000 * (normalize(tmpvar_14) * tmpvar_9)))).y + 1.00000) * 0.500000), 0.000000, 1.00000))) + (tmpvar_13.xyz * scaleIncandVid.z));
  vec4 tmpvar_15;
  tmpvar_15.w = 1.00000;
  tmpvar_15.xyz = (((tmpvar_12 * g_vScale) + g_vParticleToWorld) * 300.000);
  vec4 tmpvar_16;
  tmpvar_16 = (tmpvar_15 * g_mViewProj);
  gl_Position = tmpvar_16;
  vec4 tmpvar_17;
  tmpvar_17.zw = vec2(0.000000, 0.000000);
  tmpvar_17.xy = (tmpvar_5 + 0.500000);
  vec4 vFrameUVs_18;
  float tmpvar_19;
  tmpvar_19 = (rot3dAnimDispUser.y * g_ParticleAnimFrames.x);
  float tmpvar_20;
  tmpvar_20 = floor(tmpvar_19);
  vec2 vFrameOffset_21;
  float tmpvar_22;
  tmpvar_22 = (float(mod (tmpvar_20, g_ParticleAnimFrames.x)));
  vFrameOffset_21.x = (float(mod (tmpvar_22, g_ParticleAnimFrames.y)));
  vFrameOffset_21.y = floor((tmpvar_22 / g_ParticleAnimFrames.y));
  vFrameUVs_18.xy = ((vFrameOffset_21 + tmpvar_17.xy) * g_ParticleAnimFrames.z);
  float fFrameIndex_23;
  fFrameIndex_23 = (tmpvar_20 + 1.00000);
  vec2 vFrameOffset_24;
  float tmpvar_25;
  tmpvar_25 = (float(mod (fFrameIndex_23, g_ParticleAnimFrames.x)));
  fFrameIndex_23 = tmpvar_25;
  vFrameOffset_24.x = (float(mod (tmpvar_25, g_ParticleAnimFrames.y)));
  vFrameOffset_24.y = floor((tmpvar_25 / g_ParticleAnimFrames.y));
  vFrameUVs_18.zw = ((vFrameOffset_24 + tmpvar_17.xy) * g_ParticleAnimFrames.z);
  vec2 tmpvar_26;
  tmpvar_26 = (((tmpvar_16.xy / tmpvar_16.w) + 1.00000) * 0.500000);
  vNormScreenPos_1.x = tmpvar_26.x;
  vNormScreenPos_1.y = (1.00000 - tmpvar_26.y);
  uvVarying = vFrameUVs_18;
  colorVarying = vColor_2;
  vec4 tmpvar_27;
  tmpvar_27.w = 0.000000;
  tmpvar_27.x = (float(mod (tmpvar_19, 1.00000)));
  tmpvar_27.yz = vNormScreenPos_1;
  animLerpVposVarying = tmpvar_27;
}

