uniform sampler2D _BumpMap;
uniform vec4 _Color;
uniform samplerCube _Cube;
uniform sampler2D _LightBuffer;
uniform sampler2D _MainTex;
uniform vec4 _ReflectColor;
uniform vec4 _SpecColor;
uniform vec4 unity_Ambient;
void main ()
{
  vec4 tmpvar_1;
  tmpvar_1 = gl_TexCoord[0];
  vec4 tmpvar_2;
  tmpvar_2 = gl_TexCoord[2];
  vec4 tmpvar_3;
  tmpvar_3 = gl_TexCoord[3];
  vec4 tmpvar_4;
  tmpvar_4 = gl_TexCoord[4];
  vec4 col_5;
  vec4 light_6;
  vec3 tmpvar_7;
  tmpvar_7.x = tmpvar_2.w;
  tmpvar_7.y = tmpvar_3.w;
  tmpvar_7.z = tmpvar_4.w;
  vec4 reflcol_8;
  vec4 tmpvar_9;
  tmpvar_9 = texture2D (_MainTex, tmpvar_1.xy);
  vec4 normal_10;
  normal_10.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
  normal_10.z = sqrt(((1.0 - 
    (normal_10.x * normal_10.x)
  ) - (normal_10.y * normal_10.y)));
  vec3 tmpvar_11;
  tmpvar_11.x = dot (tmpvar_2.xyz, normal_10.xyz);
  tmpvar_11.y = dot (tmpvar_3.xyz, normal_10.xyz);
  tmpvar_11.z = dot (tmpvar_4.xyz, normal_10.xyz);
  reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 * 
    (dot (tmpvar_11, tmpvar_7) * tmpvar_11)
  ))) * tmpvar_9.w);
  light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
  light_6.xyz = (light_6.xyz + unity_Ambient.xyz);
  vec4 c_12;
  float spec_13;
  spec_13 = (light_6.w * tmpvar_9.w);
  c_12.xyz = (((tmpvar_9 * _Color).xyz * light_6.xyz) + ((light_6.xyz * _SpecColor.xyz) * spec_13));
  c_12.w = ((reflcol_8.w * _ReflectColor.w) + (spec_13 * _SpecColor.w));
  col_5.w = c_12.w;
  col_5.xyz = (c_12.xyz + (reflcol_8.xyz * _ReflectColor.xyz));
  gl_FragData[0] = col_5;
}


// stats: 29 alu 4 tex 0 flow
// inputs: 1
//  #0: gl_TexCoord (high float) 4x1 [5] loc 4
// uniforms: 4 (total size: 0)
//  #0: _Color (high float) 4x1 [-1]
//  #1: _ReflectColor (high float) 4x1 [-1]
//  #2: _SpecColor (high float) 4x1 [-1]
//  #3: unity_Ambient (high float) 4x1 [-1]
// textures: 4
//  #0: _BumpMap (high 2d) 0x0 [-1]
//  #1: _Cube (high cube) 0x0 [-1]
//  #2: _LightBuffer (high 2d) 0x0 [-1]
//  #3: _MainTex (high 2d) 0x0 [-1]
