summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-04-11 15:09:58 -0500
committerGitHub <noreply@github.com>2023-04-11 15:09:58 -0500
commit2b2154f0217758b27b544d066024d922ba234d51 (patch)
treefafed45d3e9cc21b04e2babf6bf19d1a476fc88a /indra/newview/app_settings/shaders/class3
parent474739226433a74cdca05a949586139a9c9c0bbd (diff)
SL-19564 Rebalance exposure and sky. Hack legacy diffuse map saturation and brightness to allow ACES Hill all the time.
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl2
5 files changed, 19 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
index 23ba95949a..5a2924afe5 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiPointLightF.glsl
@@ -58,6 +58,7 @@ vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensi
vec2 getScreenXY(vec4 clip);
vec2 getScreenCoord(vec4 clip);
vec3 srgb_to_linear(vec3 c);
+vec3 legacy_adjust(vec3 c);
// Util
vec3 hue_to_rgb(float hue);
@@ -131,6 +132,7 @@ void main()
}
else
{
+ diffuse.rgb = legacy_adjust(diffuse.rgb);
diffuse = srgb_to_linear(diffuse);
spec.rgb = srgb_to_linear(spec.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index 30b7895157..33e5b2346c 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -83,6 +83,7 @@ vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n);
vec2 getScreenXY(vec4 clip);
vec2 getScreenCoord(vec4 clip);
vec3 srgb_to_linear(vec3 cs);
+vec3 legacy_adjust(vec3 c);
vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 getPosition(vec2 pos_screen);
@@ -182,7 +183,7 @@ void main()
}
else
{
-
+ diffuse = legacy_adjust(diffuse);
diffuse = srgb_to_linear(diffuse);
spec.rgb = srgb_to_linear(spec.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
index 30b96ce8dc..471e5e7fd3 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/pointLightF.glsl
@@ -63,6 +63,7 @@ vec4 getPosition(vec2 pos_screen);
vec2 getScreenXY(vec4 clip);
vec2 getScreenCoord(vec4 clip);
vec3 srgb_to_linear(vec3 c);
+vec3 legacy_adjust(vec3 c);
float getDepth(vec2 tc);
vec3 pbrPunctual(vec3 diffuseColor, vec3 specularColor,
@@ -121,7 +122,7 @@ void main()
{
discard;
}
-
+ diffuse = legacy_adjust(diffuse);
diffuse = srgb_to_linear(diffuse);
spec.rgb = srgb_to_linear(spec.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index e1206cc844..8f5bd6141a 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -83,9 +83,12 @@ float getDepth(vec2 pos_screen);
vec3 linear_to_srgb(vec3 c);
vec3 srgb_to_linear(vec3 c);
+vec3 legacy_adjust(vec3 c);
uniform vec4 waterPlane;
+uniform int cube_snapshot;
+
#ifdef WATER_FOG
vec4 applyWaterFogViewLinear(vec3 pos, vec4 color);
#endif
@@ -207,12 +210,18 @@ void main()
else if (!GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_ATMOS))
{
//should only be true of WL sky, just port over base color value
- color = srgb_to_linear(texture2D(emissiveRect, tc).rgb);
- color *= sun_up_factor * sky_hdr_scale + 1.0;
+ color = texture2D(emissiveRect, tc).rgb;
+ color = srgb_to_linear(color);
+ if (sun_up_factor > 0)
+ {
+ color *= sky_hdr_scale + 1.0;
+ }
}
else
{
// legacy shaders are still writng sRGB to gbuffer
+ baseColor.rgb = legacy_adjust(baseColor.rgb);
+
baseColor.rgb = srgb_to_linear(baseColor.rgb);
spec.rgb = srgb_to_linear(spec.rgb);
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index 33ea2129cf..3d06bb27a5 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -91,6 +91,7 @@ vec3 getProjectedLightSpecularColor(vec3 pos, vec3 n);
vec2 getScreenXY(vec4 clip_point);
vec2 getScreenCoord(vec4 clip_point);
vec3 srgb_to_linear(vec3 c);
+vec3 legacy_adjust(vec3 c);
vec4 texture2DLodSpecular(vec2 tc, float lod);
vec4 getPosition(vec2 pos_screen);
@@ -189,6 +190,7 @@ void main()
}
else
{
+ diffuse = legacy_adjust(diffuse);
diffuse = srgb_to_linear(diffuse);
spec.rgb = srgb_to_linear(spec.rgb);