From 3f03b607181a8c55907439734f236ae9a80f8470 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sun, 24 Oct 2021 12:02:38 -0700 Subject: [PATCH] Fudge irradiance map lookup to avoid precision issues --- drivers/gles3/shaders/scene.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index 7a82e7ee796..1271db61c36 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1938,7 +1938,7 @@ FRAGMENT_SHADER_CODE norm = normalize((radiance_inverse_xform * vec4(norm, 0.0)).xyz); norm.xy /= 1.0 + abs(norm.z); norm.xy = norm.xy * vec2(0.5, 0.25) + vec2(0.5, 0.25); - if (norm.z > 0.0) { + if (norm.z > 0.0001) { norm.y = 0.5 - norm.y + 0.5; }