[[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 bool colorize;

in mediump vec2 uv;
out mediump vec4 frag;

void main()
{
    const mediump vec4 c1 = vec4(1.0, 1.0, 1.0, 1.0);
    const mediump vec4 c2 = vec4(0.9, 0.9, 0.9, 1.0);
    mediump vec2 c = floor(fract(uv * 10.0) * 2.0);
    mediump float alpha = mix(c.x, 1.0 - c.x, c.y);
    if (colorize)
        frag = mix(c1, c2, alpha) * vec4(fract(uv.x * 5.0), uv.y, 1.0, 1.0);
    else 
        frag = mix(c1, c2, alpha);
}
