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.
In chapter 14.2.2 Sampling Shapes, the second overload of Shape::Pdf returns 0 if wi does not intersect with the shape, which conceptually make sense. However, when Sphere::Pdf overrides this method, its implementation never returns 0 if the second (general sphere PDF) path is chosen, even if wi points away from the sphere. Is this a missed case in the code, or am I misunderstanding something here?
Thank you so much for the great book!
In chapter 14.2.2 Sampling Shapes, the second overload of
Shape::Pdf
returns0
ifwi
does not intersect with the shape, which conceptually make sense. However, whenSphere::Pdf
overrides this method, its implementation never returns0
if the second (general sphere PDF) path is chosen, even ifwi
points away from the sphere. Is this a missed case in the code, or am I misunderstanding something here?