Fix T38615: cycles rendering beckmann/GGX refraction wrong with IOR equal to 1.

This commit is contained in:
Brecht Van Lommel 2014-02-12 22:50:31 +01:00
parent f462e8a9c8
commit 8547d17739
Notes: blender-bot 2023-02-14 11:12:10 +01:00
Referenced by issue #38615, Blender Cycles Render results looking different at the BMW MikePan Benchmark File.
Referenced by issue #38615, Blender Cycles Render results looking different at the BMW MikePan Benchmark File.
1 changed files with 2 additions and 2 deletions

View File

@ -219,7 +219,7 @@ ccl_device int bsdf_microfacet_ggx_sample(const ShaderClosure *sc, float3 Ng, fl
*domega_in_dy = dTdy;
#endif
if (m_ag <= 1e-4f) {
if (m_ag <= 1e-4f || fabsf(m_eta - 1.0f) < 1e-4f) {
// some high number for MIS
*pdf = 1e6f;
*eval = make_float3(1e6f, 1e6f, 1e6f);
@ -450,7 +450,7 @@ ccl_device int bsdf_microfacet_beckmann_sample(const ShaderClosure *sc, float3 N
*domega_in_dx = dTdx;
*domega_in_dy = dTdy;
#endif
if (m_ab <= 1e-4f) {
if (m_ab <= 1e-4f || fabsf(m_eta - 1.0f) < 1e-4f) {
// some high number for MIS
*pdf = 1e6f;
*eval = make_float3(1e6f, 1e6f, 1e6f);