Cycles: Fix multiscattering Oren-Nayar at glancing angles, update tests

This commit is contained in:
Lukas Stockner 2024-06-18 22:57:52 +02:00
parent 963eda1db8
commit 97b06c429f
2 changed files with 5 additions and 1 deletions

@ -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