From 50ec54831de88926ca13c9a72d89006ceda6c355 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 1 Jun 2023 19:49:23 -0500 Subject: DRTVWR-559 Revert skies to be very close to release and disable tone mapping when probe ambiance is zero. Hack for desaturating legacy materials has been removed for performance and quality reasons. Adds a new setting for auto adjusting legacy skies. This is the PBR "opt out" button. If disabled, legacy skies will disable tonemapping, automatic probe ambiance, and HDR/exposure. If enabled, legacy skies will behave as if probe ambiance and HDR scale are 1.0, and ambient will be cut in half. HDR scale will act as a sky brightener, but will automatically adjust dynamic exposure so the sky will be properly exposed. If you want relatively even exposure all the time, set HDR Scale to 1.0. If you want a high range of exposures between indoor/dark areas and outdoor/bright areas, increase HDR Scale. Also tuned up SSAO (thanks Rye!). Reviewed with Brad. --- .../class1/deferred/postDeferredGammaCorrect.glsl | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 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 a32296369c..53e4f02314 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -102,16 +102,12 @@ vec3 toneMap(vec3 color) { #ifndef NO_POST float exp_scale = texture(exposureMap, vec2(0.5,0.5)).r; - + color *= exposure * exp_scale; color = toneMapACES_Hill(color); -#else - color *= 0.6; #endif - color = linear_to_srgb(color); - return color; } @@ -158,10 +154,10 @@ float noise(vec2 x) { vec3 legacyGamma(vec3 color) { - color = 1. - clamp(color, vec3(0.), vec3(1.)); - color = 1. - pow(color, vec3(gamma)); // s/b inverted already CPU-side + vec3 c = 1. - clamp(color, vec3(0.), vec3(1.)); + c = 1. - pow(c, vec3(gamma)); // s/b inverted already CPU-side - return color; + return c; } void main() @@ -169,12 +165,14 @@ void main() //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) vec4 diff = texture(diffuseRect, vary_fragcoord); - diff.rgb = toneMap(diff.rgb); - #ifdef LEGACY_GAMMA -#ifndef NO_POST + diff.rgb = linear_to_srgb(diff.rgb); diff.rgb = legacyGamma(diff.rgb); +#else +#ifndef NO_POST + diff.rgb = toneMap(diff.rgb); #endif + diff.rgb = linear_to_srgb(diff.rgb); #endif vec2 tc = vary_fragcoord.xy*screen_res*4.0; -- cgit v1.2.3