About

This page hosts the hg_sdf library for building signed distance functions (or more precise: signed distance bounds). Those are a very elegant and flexible representation of geometry that can be rendered or otherwise processed. Roughly, coded SDFs are to triangle meshes or voxels what vector graphics are to pixels.

Building them is not easy yet. This is a bit like writing svg files by hand. Except fun.

This lib is the one that we used ourselves to make 64k intros like the timeless and on, straight from our version control system. Much of what we learned from those productions ended up in here. This includes the following items:

A Collection of distance functions for primitives : Boxes, cones, cylinders, tori, blobby balls, you name it. This is the boring part.

: Boxes, cones, cylinders, tori, blobby balls, you name it. This is the boring part. An Assortment of space-folding operators . Get an infinite amount of objects for the price of 1.3!

. Get an infinite amount of objects for the price of 1.3! An Arsenal of boolean operators to combine objects. Add fancy bevels of all kinds where objects meet or create entire nontrivial new objects from seemingly nothing! Be the envy of your fellow sceners!

All info on this page (except for the screenshots) can also be found in the source code, which is the definitive source. It also contains a FAQ and instructions on how to use the individual functions.