From 505d469e50c9ae0e81ccf892abf5fb1bc40c052c Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 24 Oct 2020 13:11:27 -0700 Subject: [PATCH] Remove extra exposure multiply in FXAA --- drivers/gles3/shaders/tonemap.glsl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl index 7ceaa387e17..3f64be25011 100644 --- a/drivers/gles3/shaders/tonemap.glsl +++ b/drivers/gles3/shaders/tonemap.glsl @@ -300,9 +300,8 @@ vec3 apply_fxaa(vec3 color, float exposure, vec2 uv_interp, vec2 pixel_size) { dir * rcpDirMin)) * pixel_size; - vec3 rgbA = 0.5 * (textureLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz * exposure + textureLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz) * exposure; - vec3 rgbB = rgbA * 0.5 + 0.25 * (textureLod(source, uv_interp + dir * -0.5, 0.0).xyz * exposure + - textureLod(source, uv_interp + dir * 0.5, 0.0).xyz * exposure); + vec3 rgbA = 0.5 * exposure * (textureLod(source, uv_interp + dir * (1.0 / 3.0 - 0.5), 0.0).xyz + textureLod(source, uv_interp + dir * (2.0 / 3.0 - 0.5), 0.0).xyz); + vec3 rgbB = rgbA * 0.5 + 0.25 * exposure * (textureLod(source, uv_interp + dir * -0.5, 0.0).xyz + textureLod(source, uv_interp + dir * 0.5, 0.0).xyz); float lumaB = dot(rgbB, luma); if ((lumaB < lumaMin) || (lumaB > lumaMax)) {