From cbc14782ff7a8e0776e61e3e6196ff0dae2eefc1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 30 Aug 2023 21:19:47 +1000 Subject: [PATCH] Fix mistaken revert of EEVEE fix in recent commit [0] unintentionally reverted [1], correcting. [0]: 3d607be57275dfa6ca1434f762c9f8ae79628aa3 [1]: 068e117a8bf3d1c9d73e521545c96b4c11867100 --- source/blender/draw/engines/eevee_next/eevee_shader_shared.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }