in vec2 texCoord;

uniform sampler2D colorMap;
uniform sampler2D paletteMap;
uniform float rpalette;

uniform vec4 glColor;



void main (void)
{
	//float index=clamp(texture2D(colorMap, texCoord).r,1.0/255.0,1.0-1.0/255);
	float texCoordx=(texCoord.x-0.5)*2.0;
	float texCoordy=(texCoord.y-0.5)*2.0;
	float index=clamp(1.0-sqrt(texCoordx*texCoordx+texCoordy*texCoordy),1.0/255.0,1.0-1.0/255);
	if (abs(sqrt(texCoordx*texCoordx+texCoordy*texCoordy))>0.5) discard;
	vec4 col=texture2D(paletteMap, vec2(index,rpalette));
	gl_FragColor = col;//texture2D(colorMap, texCoord)*glColor;
}
