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.19k forks source link

i have some problems about SpecularTransmission::Sample_f #114

Closed zq317157782 closed 7 years ago

zq317157782 commented 7 years ago

Sorry for my poor English first>_< Here are my questions: Q1: Is wi the incident ray here? Is normal(0,0,1) point to outside of the surface? if question Q1's answers are all YES,I have Q2~ Q2:here is the code to decide whether the incident ray is entering the object or exiting the object: bool entering = CosTheta(wo) > 0; my question is :why CosTheta(wo) > 0equals incident ray is entering the object ?for my understood,when CosTheta(wo) > 0, it means wo is in the same side of n,so wi is in the other side(inside object),so i think wi is exiting the object,not entering**.

if question Q1's answers is No, Could you please give me some answers or advice. I'd really appreciate that. Thank you.

zq317157782 commented 7 years ago

Therefore, if the z component of the ωo direction is greater than zero, the incident ray is coming from outside of the object. For my understood, it means ωo direction equals incident ray here. But I always think "wi" as incident ray. >_<

zq317157782 commented 7 years ago

I think I understood it now , here uses wo as incident ray is just for compute wi's direction,finally refraction is computed with wi as incident ray >_<