At some point that led me to iq and his work is just incredible- not to mention he’s a great educator and freely shares his work and techniques with others.
Similar to his many under tutorials, this is a really great resource for generative artists and game developers.
One goal is to make 64k demos more accessible: for people to discover demos, and for people who are interested in the technical details. This will need some more iterations.
The operation here is that you distort space with the modulo operator. So now you have space that repeats -- and when you trace rays through this repeated space, you're basically teleporting the rays back to the origin (using mod in the classic "wrapping around" fashion) every time they pass out of a section of space.
And then ultimately the ray will collide with the shape -- the one shape -- that exists in this distorted space, after wrapping around some number of times.
If the idea of "taking the mod of space" is intriguing, I would encourage you to try playing with SDFs! It's a really incredible technique for real-time rendering of "3D vector graphics."
Also shameless plug for my SDF playground https://bauble.studio, and an example program that uses instanced repetition to render an "infinite" number of varying shapes:
(tile [400 0 300] (fn [i]
(torus :z 60 30
| twist :y (sin (t + (hash i * 10)) * 0.05)
| rotate :pi :y (t * hash i) :z 0.05
| move :x 50
| mirror :r 10 :x
| fresnel
| slow 0.5)))
Obviously a lot less compelling than the author's examples...An example of how different thinking in SDF is: in classic modeling, you define a 3D sphere mesh using a bunch of 3D coordinates (vertices), grouped into triangles for the surface. Therefore you need more vertices to make the sphere appear smoother.
On the other hand with SDF, you have a function that takes an arbitrary 3D coordinate and returns whether the coordinate is inside the sphere or not (easily done by comparing the distance from the center), meaning the smoothness of the sphere is already the maximum it can be.