Thanks to , I'm learning how to do 2d SDFs... in 1-bit color. It's only been about an hour or so, but the results are very very promising so far!

Once again, Inigo Quilez is a fantastic resource[0]. All I'm doing is plugging in numbers. Though, instead of shader code, I'm using straight up C code with my 1-bit drawing library [1]. It's been interesting converting all the implicit vector operations to vanilla C functions. It's one of the few situations where I miss operator overloading.




Couldn't resist trying to play with color. I managed to work in a hack that for all intents and purposes seems to do anti-aliasing without oversampling.

· · brutaldon · 2 · 1 · 5

Composing SDFs together is very satisfying. Looking forward to controlling these things with sound/signal.

Show thread

@paul the trick, as i worked out in my own head while talking @selfsame through it, is the function you sample has gradients between edges that are exactly 1 pixel thick anywhere on the screen. this, by chance, happens to result in point samples that are more or less the same as what you’d get by super sampling at high resolution, so it feels like getting anti-aliasing for free.

@paul to state it in the opposite direction, an anti-alised pixel should represent the percentage of coverage by the shape over the pixel. if you want the correct values to appear underneath your point samples, the “filter” function just happens to be 1 pixel wide gradients around every hard edge, which just happens to be trivial to get with sdf. (though it gets more complicated once you involve perspective texture projection and gamma correction)

Sign in to participate in the conversation

Welcome to, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.