raytracing.github.io
raytracing.github.io copied to clipboard
Infinite loop in book 1, simple diffusion material
I go through the book 1 (book1-review branch) reimplementing it in Clojure.
Listing 40 introduces recursive ray casting which is infinite. When world.hit hits a sphere, rec.p contains point on sphere. Next hit check always returns the same rec.p.
The reason is that ray_t.contains(...) in listing 28, checks closed interval (listing 25) instead of open one (as it was defined in listing 15)
Fixing shadow acne solves this problem but is introduced later in the book (listing 43)
Oof; good catch -- thanks.
See related issue #875 .