Here's a p5js sketch using WEBGL to do something similar. Not as flexible as the shadertoy, but arguably simpler to interact with: https://openprocessing.org/sketch/2203876
Oh duh, this is inherent in binary counting. When y is equal to one any even x will be a zero. The when y is equal to 2 you get groups of zeros two at a time 0, 1; 4, 5; 8, 9; etc. The pattern repeats in lengthening, self similar way as the values of y increase leaving ever lager gaps and sequences of zeros (with the top edges of the triangles corresponding to powers of two, which give long sequences of zeros or non zeros respectively.
I always think of this pattern geometrically so it’s weird to see it pop out in simple math.
sflanker|1 year ago
(y * 4 & x *4) % (frameCount / 10 % 300)
sflanker|1 year ago
I always think of this pattern geometrically so it’s weird to see it pop out in simple math.