Cycles: Fix multiscattering Oren-Nayar at glancing angles, update tests
This commit is contained in:
parent
963eda1db8
commit
97b06c429f
@ -24,6 +24,10 @@ static_assert(sizeof(ShaderClosure) >= sizeof(OrenNayarBsdf), "OrenNayarBsdf is
|
||||
|
||||
ccl_device_inline float bsdf_oren_nayar_G(const float cosTheta)
|
||||
{
|
||||
if (cosTheta < 1e-6f) {
|
||||
/* The tan(theta) term starts to act up at low cosTheta, so fall back to Taylor expansion. */
|
||||
return (M_PI_2_F - 2.0f / 3.0f) - cosTheta;
|
||||
}
|
||||
const float sinTheta = sin_from_cos(cosTheta);
|
||||
const float theta = safe_acosf(cosTheta);
|
||||
return sinTheta * (theta - 2.0f / 3.0f - sinTheta * cosTheta) +
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 2b31a6bd1059cd85df2a2cd14b1345d24a3147d3
|
||||
Subproject commit e5964c9b2df4d85d2f50a7d38807e4fa2d02128a
|
Loading…
Reference in New Issue
Block a user