#version 150 in vec4 vertColor; in vec2 vertTexCoord; out vec4 fragColor; uniform vec4 color1; uniform vec4 color2; uniform float patternSize; void main() { float colorMix = ((step(patternSize / 2, mod(vertTexCoord.x, patternSize)) * 2 - 1) * (step(patternSize / 2, mod(vertTexCoord.y, patternSize)) * 2 - 1) + 1) / 2; fragColor = vertColor * (color1 * (1.0 - colorMix) + color2 * colorMix); }