If you aren't familiar with SDFs, some rough intuition for what's going on here: you have some primitive functions that define shapes, you have combinators that distort shapes, and you then have combinators that distort space. And then when you trace rays through distorted space, you render an image that looks like your combinators distorted the shapes themselves, but really you're distorting the path that your rays travel along.
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:
"The Timeless" [0] is an example of what can be achieved with domain repetition over signed distance functions - the video is of a self-contained 64kb executable running in realtime! One of the authors Johann "Cupe" Korndörfer also gave a great talk [1] regarding the creative/development process.
I remember stumbling upon the “64k demo” phenomenon on YouTube where people created animations that were astronomically small (in code) compared with their rendered video representation.
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.
If you're interested in 64k intros, check out https://64k-scene.github.io/ (I've just created it and shared it for the first time yesterday).
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.
Absolutely this. I had a similar experience, where first I didn't know what I stumbled upon and then I found the explanations and intros but still feel like I'm scratching the surface. Also, somehow, in this context, the phrase "astronomically small" makes perfect sense.
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.
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:
Obviously a lot less compelling than the author's examples...