mmp / pbrt-v3

Source code for pbrt, the renderer described in the third edition of "Physically Based Rendering: From Theory To Implementation", by Matt Pharr, Wenzel Jakob, and Greg Humphreys.
http://pbrt.org
BSD 2-Clause "Simplified" License
4.88k stars 1.18k forks source link

incorrect self-intersections with cone and paraboloid shapes #44

Open mmp opened 8 years ago

mmp commented 8 years ago

The unit tests for incorrect re-intersections with spawned rays for Cone and Paraboloid fail (currently commented out in src/tests/shapes.cpp). This should be chased down; could be related to a bug in the EFloat class, since those lean heavily on that (vs the other shapes where the re-intersection tests all pass.)

mmp commented 8 years ago

One issue is that the variant of Quadratic() for EFloats computes the discriminant using double precision, completely ignoring the inbound error bounds with the A, B, and C parameters. If instead this is implemented to use EFloats with double-precision values (and then the < 0 test is done with the interval's LowerBound(), results are... interesting.

The good news is that the incorrect self-intersections seem to be fixed; the tops of cones in particular look great. The bad news is that as they go farther from the origin, quadrics start to shrink--for example, for a unit sphere 10000 units from the origin (with the camera right next to it), what looks like the outer 15% or so of the sphere just disappears.

Further investigation is warranted...