提交 93500971 编写于 作者: M Matt Pharr

Consistently handle out-of-range rotated theta_o in HairBxDF

上级 84260843
......@@ -424,6 +424,9 @@ pstd::optional<BSDFSample> HairBxDF::Sample_f(Vector3f wo, Float uc, Point2f u,
cosThetap_o = cosTheta_o;
}
// Handle out-of-range $\cos \thetao$ from scale adjustment
cosThetap_o = std::abs(cosThetap_o);
// Sample $M_p$ to compute $\thetai$
Float cosTheta = 1 + v[p] * std::log(std::max<Float>(u[0], 1e-5) +
(1 - u[0]) * FastExp(-2 / v[p]));
......@@ -473,6 +476,9 @@ pstd::optional<BSDFSample> HairBxDF::Sample_f(Vector3f wo, Float uc, Point2f u,
// Handle out-of-range $\cos \thetao$ from scale adjustment
cosThetap_o = std::abs(cosThetap_o);
// Handle out-of-range $\cos \thetao$ from scale adjustment
cosThetap_o = std::abs(cosThetap_o);
pdf += Mp(cosTheta_i, cosThetap_o, sinTheta_i, sinThetap_o, v[p]) * apPDF[p] *
Np(dphi, p, s, gamma_o, gamma_t);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册