1. 61
  1.  

    1. 8

      This is such a great introduction to SDFs – I’ve seen a lot of SDF posts that are basically “boolean operations are wild” and stop there. But I think this is the first one I’ve seen that walks through using a variety of operations to actually build up to a non-trivial non-abstract image. (I know there are some YouTube videos in that genre, but as an old person I appreciate being able to read this. And the interactiveness is so nice!)

      Did you use ShapeUp or something similar to help compose this? I feel like this is the sort of work where “interactive editing” really helps.

        1. 3

          Thank you!

          It is, why do you mention it? Did you notice something wrong?

          1. 4

            No, I was just furiously curious as to how it all worked!

            Any chance you might post it on GitHub? I’d love to link people to it with a more stable URL.

            Looks like it uses this new-to-me web API - https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext - const gl = canvas.getContext("webgl2");

            Just noticed I said “your code into a shader” - by that I meant “renders user-provided code into a shader”.

            1. 4

              Here’s a github gist: https://gist.github.com/danielchasehooper/72da5d9c286e5e94fdfb8e82bea288cc Let me know if you post about it or something!

                1. 2

                  If you haven’t seen it before, check out https://www.shadertoy.com/! People have done a lot of cool things with webgl, and you can click any of them to live-edit the code (in kind of the worst editor ever but what’re you gonna do).

          2. 1

            I had no idea this was possible and came here to ask the same thing. Thanks!

          3. 4

            This is beyond impressive! Kudos!

            1. [Comment removed by author]