#version 150 in vec4 vertColor; in float vertOffset; in float vertGray; in vec2 vertTexCoord; flat in float vertDark; out vec4 fragColor; uniform float depthOffset; uniform float spacing; uniform float time; uniform float slant; uniform float contrast; uniform sampler2D colorTexture; void main() { float borderLuminance = step(0.5, mod(gl_FragCoord.x * slant + gl_FragCoord.y + time * 2 * spacing, spacing) / spacing); fragColor = vec4(mix(vertColor, vertColor * vec4(vertDark, vertDark, vertDark, 1.0), borderLuminance)); fragColor += vec4(vertGray); fragColor *= texture(colorTexture, vertTexCoord); gl_FragDepth = gl_FragCoord.z - depthOffset * vertOffset * gl_FragCoord.w; }