raytracing.github.io icon indicating copy to clipboard operation
raytracing.github.io copied to clipboard

Infinite loop in book 1, simple diffusion material

Open genmeblog opened this issue 3 years ago • 2 comments

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)

genmeblog avatar Apr 27 '22 21:04 genmeblog

Fixing shadow acne solves this problem but is introduced later in the book (listing 43)

genmeblog avatar Apr 27 '22 21:04 genmeblog

Oof; good catch -- thanks.

hollasch avatar Apr 27 '22 22:04 hollasch

See related issue #875 .

hollasch avatar May 11 '23 04:05 hollasch