 // SUNSPOT PASS 3 FS
 
 uniform sampler2D fireTexture;
 uniform sampler2D secondPassFboTexture;
 uniform float screenWidth;
 uniform float screenHeight;
 
 void main()
 {	
	vec2 screenXY = vec2(gl_FragCoord.s / 512.0, gl_FragCoord.t / 512.0);
	vec4 pixelSecondPass = texture2D(secondPassFboTexture, screenXY);
	vec4 colorVal = vec4(pixelSecondPass.rgba);
	
	if (colorVal.r > 0.0)
	{
		vec2 firePos = vec2(pixelSecondPass.r*0.99, 0.0);
		vec4 fireColor = texture2D(fireTexture , firePos);
		gl_FragColor = fireColor*2.0;	
	}
 }
 