Skip to main content
100%

Gist 327439fea1dac34da901622a2fbe7ff8

✓ Published0🌍 Public
Aandybak
Last edited Aug 28, 2017
Created on Aug 28, 2017

This example renders a 3D scene of a box and a sphere using a signed distance function. The shader code defines `fBox` and `fBoxCheap` to compute box distances, while `DistanceFunction` combines a sphere, a box, and a guard region with an absolute offset. The scene is visualized by ray marching, likely through a graphics API such as OpenGL or Vulkan, as the code is written in a CGINC shader include file. The final image shows the primitive shapes intersecting, with the guard acting as a thin shell around the box’s interior.

AI-generated description

Similar vizzes