varying vec4 projPos;

uniform sampler2D Color1;
uniform sampler2D SceneLight;

uniform float LightAmount;

void main()
{
  vec2 texScene = projPos.xy / projPos.w * .5 + .5;;
  vec4 light = texture2D( SceneLight, texScene );
  // modulate with texture color
  vec4 color = texture2D( Color1, gl_TexCoord[0].st );
  vec3 lightColor = light.rgb + light.a;
  
  color.rgb *= lightColor;
  const vec3 cLightAmount = vec3( 8.0, 8.0, 6.0 );
  vec3 emissive = cLightAmount * color.rgb;
  color.rgb = mix( color.rgb, emissive, color.a );

  gl_FragColor = vec4( color.rgb, 1.0 );
}