#version 150
#extension GL_ARB_explicit_attrib_location : enable

uniform sampler2D Color;
uniform sampler2D Tex0; //Grade map

out vec4 outColor;
in vec2 UV;

void main()
{
	vec3 color = texture2D(Color, UV).rgb;// / texture2D(Color, UV).a;
	vec3 colorTwo;
	colorTwo.r = texture2D(Tex0, vec2(color.r, 0.5)).r;
	colorTwo.g = texture2D(Tex0, vec2(color.g, 0.5)).g;
	colorTwo.b = texture2D(Tex0, vec2(color.b, 0.5)).b;
	
	//color *= texture2D(Color, UV).a;
	
	outColor = vec4(colorTwo, 1.0);
}