3D SDF Shapes
Sphere
A sphere has a single parameter r
, which is the radius of the sphere.

1 2 3 |
|
Box
A box has three parameters, which are stored in a vec3
.
These are used to define the width, length, and height of the box.

1 2 3 4 5 |
|
Credits
- https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm