Merge pull request #44711 from clayjohn/GLES3-auto-exposure-fxaa

Properly apply auto exposure with FXAA in GLES3
This commit is contained in:
Rémi Verschelde 2020-12-27 10:54:11 +01:00 committed by GitHub
commit 74512fd876
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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