summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred
diff options
context:
space:
mode:
authorRunitai Linden <davep@lindenlab.com>2020-03-05 16:28:06 -0600
committerRunitai Linden <davep@lindenlab.com>2020-03-05 16:28:06 -0600
commit7c7d71269f5b47397d14bbe44e341e4ac1d96889 (patch)
treeea9ff1c27a6e067d225929b2f28d637db32d20bf /indra/newview/app_settings/shaders/class3/deferred
parent90ad38db065877be16371e7814a39618135a30ab (diff)
WIP - Windlight sun lighting should happen in sRGB space, not linear space. This keeps ambient from getting overblown and better matches environment lighting with ALM on/off.
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl2
3 files changed, 7 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
index 52de7ceaad..9d62b9d180 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/multiSpotLightF.glsl
@@ -183,7 +183,7 @@ void main()
vec3 col = vec3(0,0,0);
- vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
+ vec3 diff_tex = srgb_to_linear(texture2DRect(diffuseRect, frag.xy).rgb);
vec4 spec = texture2DRect(specularRect, frag.xy);
@@ -285,6 +285,7 @@ void main()
col = scaleDownLight(col);
+ //output linear space color as gamma correction happens down stream
frag_color.rgb = col;
frag_color.a = 0.0;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 978c25b86a..7ed9e7b4fc 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -94,7 +94,8 @@ void main()
float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
- vec4 diffuse = texture2DRect(diffuseRect, tc); // linear
+ vec4 diffuse = texture2DRect(diffuseRect, tc); // sRGB
+ diffuse.rgb = srgb_to_linear(diffuse.rgb);
vec3 col;
float bloom = 0.0;
@@ -169,7 +170,8 @@ void main()
bloom = fogged.a;
#endif
}
-
+
+ //output linear since gamma correction happens down stream
frag_color.rgb = col;
frag_color.a = bloom;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
index bccd819a43..56b0f4e5ce 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/spotLightF.glsl
@@ -182,7 +182,7 @@ void main()
vec3 col = vec3(0,0,0);
- vec3 diff_tex = texture2DRect(diffuseRect, frag.xy).rgb;
+ vec3 diff_tex = srgb_to_linear(texture2DRect(diffuseRect, frag.xy).rgb);
vec4 spec = texture2DRect(specularRect, frag.xy);