mmp / pbrt-v2

Source code for the version of pbrt described in the second edition of "Physically Based Rendering"
http://pbrt.org
989 stars 343 forks source link

BRDFToBTDF::Pdf(.) -> why negation instead of "re-hemisphering"? #2

Closed phresnel closed 13 years ago

phresnel commented 14 years ago

Upon implementing a quick hack for leaf-rendering in picogen, I found the BRDF-to-BTDF adapter on top of a diffuse model a dirty, but good candidate. However, I recognized that there's a "discontinuity" at:

reflection.cpp:

float BRDFToBTDF::Pdf(const Vector &wo,
    const Vector &wi) const {
    return brdf->Pdf(wo, -wi);
}

where I would have expected

float BRDFToBTDF::Pdf(const Vector &wo,
    const Vector &wi) const {
    return brdf->Pdf(wo, otherHemisphere(wi));
}

When I think about it, it doesn't seem right. The adapter would convert "near-specular" reflection into near-specular transmission:

      /     <-- out
 - - - - - -
   /        <-- in

The negation in Pdf(.) though would make "in" near-identical to "out", and yield a pdf of [near] zero.

Which would be the reason for negation instead of re-hemisphering in or out, if any?

(sidenote: this ticket would also apply to pbrt-v1)

mmp commented 13 years ago

Good find--thanks! Fixed with commit 04dbb8dfa0394f4725750ae9fb179ed5d0a0fcfe. Sorry for taking so long to take care of this.

Thanks, -matt