Jon Baker, Graphics Programming

    home

    writings

The Distance Estimator Compendium (DEC)

Introduction

 My goal here is to provide a collected resource of these signed distance functions (SDFs) in a standardized format given by float de( vec3 p ){...}.

 SDFs are an interesting method for representing geometry as an implicit functional representation, which produces a result by querying with a given point in space and returning an estimate of the distance to the surface - positive outside, and negative inside. I emphasize that this result is an estimate, especially for some of the fractal SDFs which produce a result by distorting the space in a highly nonlinear fashion.

 This representation is often used in realtime raymarching, but they come up in applications such as pathtracing and producing of meshes. I have seen several resources on this topic but I hope to gather as much as I can in one place on this page.

 Click titles to show/hide section. Mouse over each of the images to view it larger.







Licensing

  This is an educational resource provided under the CC Attribution-NonCommercial-ShareAlike 3.0 Unported License.

  This is the default Shadertoy license unless otherwise specified by the shader author, the same license provided with the hg_sdf header. There are some utility functions referenced which are provided by the Twigl noise header, available under the MIT license, and the hg_sdf header. The primitives provided by Inigo Quilez are under the MIT License.

  I have gathered these distance estimator functions from several sources (discussions with individuals, the hg_sdf header, Shadertoy examples, code deobfuscated from the #つぶやきGLSL tag on Twitter, among others). I have done my best to give credit to the authors, but I do not have a complete record - if you have information to that end, please contact me via email. If you are doing something cool with them, or would like to contribute to this resource, please contact me at jb239812@ohio.edu.


Last updated 4/6/2024