Closed zq317157782 closed 5 years ago
Actually, there are many places that floating point become NaN(e.g. division by zero) or Inf (e.g. log/exp) in PBRT's hair bsdf implementation.
We have to add nan/inf/zero check in many places in our own hair BSDF module based on PBRT-v3.
Hi syoyo. I haven't read the original paper,so I can't ensure these behaviors(NaN/INF/zero) are correct in mathematics based on this hair bsdf model,I think I should cost some time to read this paper.Thanks for comment!
In hair.h/cpp I found that when
beta_m
eq zero,the set of roughness variancev[pMax]
's elements are alse all zero,andbeta_m
eq zero is a valid param. But I also found in functionMp
has code:Float a = cosThetaI * cosThetaO / v; Float b = sinThetaI * sinThetaO / v;
thatv
maybe a zero.I think this will cause a nan problem maybe.