[[vertex]]

uniform mat4 mvp;

in vec4 pos;
in vec2 uvs;
out vec2 uv;

void main()
{
    uv = uvs;
    gl_Position = mvp * vec4(pos.xyz, 1.0);
}

[[fragment]]

uniform sampler2D tex;
uniform highp float alpha;
uniform bool highlight;

in highp vec2 uv;
out highp vec4 frag;

void main()
{
    highp vec4 c = texture(tex, uv);
    frag = highlight ? 
        vec4(clamp(vec3(0.3) + c.rgb, vec3(0.0), vec3(1.0)), c.a) : 
        c * vec4(1.0, 1.0, 1.0, alpha);
}
