Glsl implementation of the rectangular function.
npm install glsl-rectangular-function
#pragma glslify: rectangularFunction = require(glsl-rectangular-function)
void main() {
vec2 p = gl_FragCoord.xy / resolution.xy;
float center = 0.5;
float width = 0.25;
float y = rectangularFunction(p.x, center, width);
gl_FragColor = vec4(vec3(y), 1.0);
}