summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-06-01 19:49:23 -0500
committerGitHub <noreply@github.com>2023-06-01 19:49:23 -0500
commit50ec54831de88926ca13c9a72d89006ceda6c355 (patch)
tree7f1efd2a8555fc419af29eaf0a47b4828df0d22b /indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
parent8d20d61b4d305b985de4837bb0ed3ddaedb208d1 (diff)
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.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl20
1 files changed, 9 insertions, 11 deletions
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;