#ifndef GL_ES
#define lowp
#define mediump
#define highp
#endif

varying mediump vec2 oTexcoords;

uniform lowp sampler2D uTexture0;
uniform lowp sampler2D uTexture1;

void main()
{
	float index = texture2D(uTexture0, oTexcoords).r * (255.0 / 15.0);
	vec4 color = texture2D(uTexture1, vec2(index, 0.));
    gl_FragColor = color;
}