From 6cefadc233d662863e295517bf9e03029b79fb65 Mon Sep 17 00:00:00 2001 From: clayjohn Date: Sat, 26 Dec 2020 15:23:08 -0800 Subject: [PATCH] Properly apply auto exposure with FXAA in GLES3 --- drivers/gles3/shaders/tonemap.glsl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gles3/shaders/tonemap.glsl b/drivers/gles3/shaders/tonemap.glsl index 5a9d9204531..e2bc8916945 100644 --- a/drivers/gles3/shaders/tonemap.glsl +++ b/drivers/gles3/shaders/tonemap.glsl @@ -327,16 +327,17 @@ void main() { vec3 color = textureLod(source, uv_interp, 0.0f).rgb; // Exposure + float full_exposure = exposure; #ifdef USE_AUTO_EXPOSURE - color /= texelFetch(source_auto_exposure, ivec2(0, 0), 0).r / auto_exposure_grey; + full_exposure /= texelFetch(source_auto_exposure, ivec2(0, 0), 0).r / auto_exposure_grey; #endif - color *= exposure; + color *= full_exposure; #ifdef USE_FXAA // FXAA must be applied before tonemapping. - color = apply_fxaa(color, exposure, uv_interp, pixel_size); + color = apply_fxaa(color, full_exposure, uv_interp, pixel_size); #endif #ifdef USE_DEBANDING