summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-02-11 09:36:01 -0800
committerGraham Linden <graham@lindenlab.com>2019-02-11 09:36:01 -0800
commitaafa561215b7b69a72d00ed709d6411f6438474d (patch)
treea9063b0bd31c0c1932b3193b1164f32e561c4975 /indra/newview/app_settings/shaders/class1/deferred
parent3e0c9087cd6b26a64831f99bf9be05daa1dec510 (diff)
SL-10500
Replace clamp on height in atmospherics calcs on fragment shader path. Fix colorspace conversions in material shaders in forward rendering mode. Fix deferred shaders not setting the sun_up_factor uniform and getting moonlight instead of sunlight.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl6
2 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 09bb6c5bb8..c8f4d7c570 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -42,6 +42,9 @@ vec3 scaleSoftClipFrag(vec3 l);
void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit, out vec3 amblit, out vec3 additive, out vec3 atten);
+vec3 srgb_to_linear(vec3 cs);
+vec3 linear_to_srgb(vec3 cs);
+
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
#ifdef DEFINE_GL_FRAGCOLOR
@@ -199,7 +202,7 @@ void main()
#endif
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
- vec3 gamma_diff = diffcol.rgb;
+ vec3 gamma_diff = linear_to_srgb(diffcol.rgb);
#endif
#if HAS_SPECULAR_MAP
@@ -332,6 +335,7 @@ void main()
}
col = atmosFragLighting(col, additive, atten);
+ col = scaleSoftClipFrag(col);
vec3 npos = normalize(-pos.xyz);
@@ -352,7 +356,8 @@ void main()
glare = min(glare, 1.0);
float al = max(diffcol.a,glare)*vertex_color.a;
- col = scaleSoftClipFrag(col);
+ //convert to gamma space for display on screen
+ col.rgb = linear_to_srgb(col.rgb);
#ifdef WATER_FOG
vec4 temp = applyWaterFogView(pos, vec4(col.rgb, al));
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
index cbc19bbba3..058e939ec8 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl
@@ -44,8 +44,8 @@ vec3 linear_to_srgb(vec3 cl);
void main()
{
- vec4 diff = texture2DRect(diffuseRect, vary_fragcoord);
- diff.rgb = linear_to_srgb(diff.rgb);
- frag_color = diff;
+ vec4 diff = texture2DRect(diffuseRect, vary_fragcoord);
+ diff.rgb = linear_to_srgb(diff.rgb);
+ frag_color = diff;
}