// Aliased checkboard pattern...
// this is a rather poorly designed shader, as it has multiple
// branches and doesn't have any configurability.
//
// texCoord and vertexColor come from res://simpleshader_vert_txt, which is
// where a fragment-only GLSLObject gets its vertex stage.
#version 330 core

in vec2 texCoord;
in vec4 vertexColor;
out vec4 fragColor;

void main() {
	if (texCoord.x > .5) {
		if (texCoord.y > .5) {
			fragColor = mix( vertexColor, vec4( 0,0,0,1 ), .5);
		} else {
			fragColor = mix( vertexColor, vec4( 1,1,1,1 ), .5);
		}
	} else {
		if (texCoord.y > .5) {
			fragColor = mix( vertexColor, vec4( 1,1,1,1 ), .5);
		} else {
			fragColor = mix( vertexColor, vec4( 0,0,0,1 ), .5);
		}
	}
}
