News for hackers. Stuff that matters.
Re:How much boilerplate code you need to write a ray-tracer? by otaviogood on Friday February 18, 2022 @01:15AM (#30382653)
The geometry in my raytracer can either be ray-traced primitives, like spheres or boxes, or it can be "signed distance functions" (SDFs), which let you define all kinda of crazy shapes. Inigo Quilez does a good job of explaining SDFs here: https://www.iquilezles.org/www/articles/distfunctions/distfu... The refraction math in my code is around line 799 or 809 depending on what you're looking for. There are a few errors in the refraction code in this version. :/ But caustics are handled well by my renderer.

There are no comments on this comment yet.