GLSL SDF function for generating a box. Determines the distance between a point and the surface of a box at the origin.
float box(vec3 position, vec3 dimensions)
Returns the signed distanced between
position and a box at the origin
with a given set of
dimensions. For example, to draw a 2x2x2 box in a
# box = require('glsl-sdf-box')vec2
See stackgl/contributing for details.
MIT. See LICENSE.md for details.