varying float X, Y; varying vec4 Color; varying float LightIntensity; uniform float A; uniform float P; uniform float Tol; void main( void ) { vec4 WHITE = vec4( 1., 1., 1., 1. ); float f = fract( A*X ); float t = smoothstep( 0.5-P-Tol, 0.5-P+Tol, f ) - smoothstep( 0.5+P-Tol, 0.5+P+Tol, f ); gl_FragColor = mix( WHITE, Color, t ); gl_FragColor.rgb *= LightIntensity; }