2D SDF Operations

I am using the signed distance function d as a height field as it provides some interesting results. To get more definition on the gradient, we use pow(d,x) for x in (0,1).

The following operations are shown in order:

  • SDF of circle

  • SDF of rectangle

  • Union

  • Intersection

  • Subtraction (a-b and b-a)

This is a work in progress. I am deriving the SDFs, extending to 3D, and implementing the volumetric raymarching.

Previous
Previous

three.js cloth simulation