summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/environment
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/environment
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/environment')
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/srgbF.glsl13
1 files changed, 13 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
index 7111a822c8..31b02377da 100644
--- a/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/srgbF.glsl
@@ -113,18 +113,31 @@ vec3 inv_toneMapACES_Hill(vec3 color)
return color;
}
+// adjust legacy colors to back out tonemapping and exposure
+// NOTE: obsolete now that setting probe ambiance to zero removes tonemapping and exposure, but keeping for a minute
+// while that change goes through testing - davep 6/1/2023
+#define LEGACY_ADJUST 0
+
vec3 legacy_adjust(vec3 c)
{
+#if LEGACY_ADJUST
vec3 desat = rgb2hsv(c.rgb);
desat.g *= 1.0-(1.0-desat.b)*0.5;
desat.b += (1.0-desat.b)*0.1f;
desat.rgb = hsv2rgb(desat);
return desat;
+#else
+ return c;
+#endif
}
vec3 legacy_adjust_fullbright(vec3 c)
{
+#if LEGACY_ADJUST
float exp_scale = clamp(texture(exposureMap, vec2(0.5, 0.5)).r, 0.01, 10.0);
return c / exp_scale * 1.34; //magic 1.34 arrived at by binary search for a value that reproduces midpoint grey consistenty
+#else
+ return c;
+#endif
}