uniform sampler2D lensTex; // input from the blur stage
uniform sampler2D dirtyTex; // full resolution dirt texture
uniform sampler2D starTex; // diffraction starburst texture

uniform mat3 	starTM; // transforms texcoords
varying vec2 	texcoord;

void main() 
{
    vec4 lensMod = texture2D(dirtyTex, texcoord);
	lensMod.rgb=pow(lensMod.rgb,vec3(2.2));
	
	vec4 lensFlare = texture2D(lensTex, texcoord);// * lensMod;

 //   vec2 lensStarTexcoord = (starTM * vec3(texcoord, 1.0)).xy;
 //   lensMod += texture2D(starTex, lensStarTexcoord);

    gl_FragColor = lensFlare*lensMod; 
}
