summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-05-06 11:18:31 -0700
committerGraham Linden <graham@lindenlab.com>2019-05-06 11:18:31 -0700
commitac080210a8cd2f64c040f980708ccce2c5464874 (patch)
tree6d71cf764c0cce2e1b1273b0d2398c74c11a11b4 /indra/newview
parent161d9993a59b4484777f7115a3ffd1b8e32ff7c4 (diff)
Make underwater shader output linear (refracted image was in wrong colorspace).
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl3
1 files changed, 3 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl
index e95a688e1f..641c6fbd36 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl
@@ -58,6 +58,7 @@ VARYING vec4 refCoord;
VARYING vec4 littleWave;
VARYING vec4 view;
+vec3 srgb_to_linear(vec3 c);
vec2 encode_normal(vec3 n);
vec4 applyWaterFog(vec4 color, vec3 viewVec)
@@ -112,6 +113,8 @@ void main()
vec4 fb = texture2D(screenTex, distort);
+ fb.rgb = srgb_to_linear(fb.rgb);
+
frag_data[0] = vec4(fb.rgb, 1.0); // diffuse
frag_data[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
frag_data[2] = vec4(encode_normal(wavef), 0.0, 0.0); // normalxyz, displace