Fix #117611: Cycles NaN in microfacet BSDF with IOR 1.0

Pull Request: https://projects.blender.org/blender/blender/pulls/117622
This commit is contained in:
Alaska 2024-01-29 15:26:36 +01:00 committed by Brecht Van Lommel
parent 0e824c5f8d
commit 7aca9a1ebb
1 changed files with 1 additions and 1 deletions

View File

@ -538,7 +538,7 @@ ccl_device Spectrum bsdf_microfacet_eval(ccl_private const ShaderClosure *sc,
/* TODO: check if the refraction configuration is valid. See `btdf_ggx()` in
* `eevee_bxdf_lib.glsl`. */
float3 H = is_transmission ? -(bsdf->ior * wo + wi) : (wi + wo);
const float inv_len_H = 1.0f / len(H);
const float inv_len_H = safe_divide(1.0f, len(H));
H *= inv_len_H;
/* Compute Fresnel coefficients. */