From 2b2154f0217758b27b544d066024d922ba234d51 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Tue, 11 Apr 2023 15:09:58 -0500 Subject: SL-19564 Rebalance exposure and sky. Hack legacy diffuse map saturation and brightness to allow ACES Hill all the time. --- .../class1/deferred/postDeferredGammaCorrect.glsl | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl') diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index ae6bdbba95..de766d6bc7 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -105,29 +105,21 @@ vec3 toneMapACES_Hill(vec3 color) uniform float exposure; uniform float gamma; +vec3 legacy_adjust_post(vec3 c); + vec3 toneMap(vec3 color, float gs) { float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; color *= exposure * exp_scale * gs; -#ifdef TONEMAP_ACES_NARKOWICZ - color = toneMapACES_Narkowicz(color); -#endif - -#ifdef TONEMAP_ACES_HILL color = toneMapACES_Hill(color); -#endif -#ifdef TONEMAP_ACES_HILL_EXPOSURE_BOOST - // boost exposure as discussed in https://github.com/mrdoob/three.js/pull/19621 - // this factor is based on the exposure correction of Krzysztof Narkowicz in his - // implemetation of ACES tone mapping - color *= 1.0/0.6; - color = toneMapACES_Hill(color); -#endif + color = linear_to_srgb(color); - return linear_to_srgb(color); + color = legacy_adjust_post(color); + + return color; } //=============================================================== @@ -181,7 +173,7 @@ vec3 legacyGamma(vec3 color) float legacyGammaApprox() { - //TODO -- figure out how to plumb this in as a uniform + //TODO -- figure out how to plumb this in as a uniform float c = 0.5; float gc = 1.0-pow(c, gamma); -- cgit v1.2.3