varying vec2 texCoord;
uniform sampler2D colorMap;
uniform sampler2D paletteMap;


void main(){
	vec4 color=texture2D(colorMap, texCoord);
	float g=color.r+color.g+color.b; g/=3.0;
	vec4 result=texture2D(paletteMap, vec2(g,0.5));
	gl_FragColor = result; 
}