Skip to content

chriscummings100/signeddistancefields

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.

Signed Distance Fields

Welcome to the signed distance fields repo. This contains the sample code for the signed distance field series at https://shaderfun.com/.

Whilst the repo is focussed on the blog, it is designed to be a simple toolkit for generating and rendering signed distance fields. Currently it is focussed on 2D fields, and supports:

  • Rendering a field texture on screen using a variety of different demo algorithms
  • Generating a distance field from explicit primitives such as circles, lines, rectangles
  • Generating a distance field from an image, with simple handling for anti aliased images
  • Sweeping a field using either 8PSSDT sweep or a brute force eikonal algorithm
  • Downsampling
  • Softening

Effects in the demo so far:

  • Simple visualisation of the field
  • Creating soft borders to avoid aliasing
  • Edging effects such as gradients or neon glows
  • Drop shadows
  • Morphing between fields

Enjoy!

About

Signed distance field demos and examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published