package com.stencyl.graphics.shaders;

class GrayscaleShader extends BasicShader
{
	public function new()
	{
		super();
	
		var script = "
			#ifdef GL_ES
				precision mediump float;
			#endif
			
			varying vec2 vTexCoord;
			uniform sampler2D uImage0;
			
			void main(void)
			{
				vec4 color = texture2D(uImage0, vTexCoord);
				float gray = dot(color.rgb, vec3(0.299, 0.587, 0.114));
				gl_FragColor = vec4(gray, gray, gray, 1.0);
			}
		";
	
		model = new PostProcess(this, script, true);
	}
}