diff --git a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh index e0d4be97c5f..079d6e67f43 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh +++ b/source/blender/draw/engines/eevee_next/eevee_shader_shared.hh @@ -1275,7 +1275,7 @@ float4 utility_tx_sample_lut(sampler2DArray util_tx, float cos_theta, float roug { /* LUTs are parameterized by `sqrt(1.0 - cos_theta)` for more precision near grazing incidence. */ - vec2 coords = vec2(roughness, sqrt(saturate(1.0 - cos_theta))); + vec2 coords = vec2(roughness, sqrt(clamp(1.0 - cos_theta, 0.0, 1.0))); return utility_tx_sample_lut(util_tx, coords, layer); }