Open Enigmatisms opened 1 year ago
Interesting; that code is correct in the pbrt-v3 source code but seems to be incorrect in the online text. I will look into what happened there. https://github.com/mmp/pbrt-v3/blob/aaa552a4b9cbf9dccb71450f47b268e0ed6370e2/src/core/medium.cpp#L194.
Sorry for any inconvenience.
Thanks. Looking forward to reading more new advanced topics in PBR-book.
In chapter 15.2 - Sampling Volume Scattering, for H-G phase function sampling:
There should be a negative sign in front of
cosTheta
RHS.The code block is not consistent with , and is not consistent with
Float denom = 1 + g * g + 2 * g * cosTheta;
, if no minus sign given,denom
should be1 + g * g - 2 * g * cosTheta
. According to the ray direction convention in PBRT-v3, all 'incident ray' points outwards, thereforecosTheta
RHS should have a minus sign.