summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
diff options
context:
space:
mode:
authorGraham Linden <graham@lindenlab.com>2019-01-30 10:38:41 -0800
committerGraham Linden <graham@lindenlab.com>2019-01-30 10:38:41 -0800
commitbd25688867d824a3c21ffce93d689bb30e4ba803 (patch)
tree7e6cfed929e76b25d8ca8f69e9b45b5f1a442f08 /indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
parent12cd42221e16b8bbcd0ad115e0436b075d47d485 (diff)
SL-9996
Force frag depth in water shaders to avoid z-fighting at back edge of water edge pieces.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/waterF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterF.glsl5
1 files changed, 4 insertions, 1 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index ceadb9fb67..d9ae37fbfa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -167,7 +167,10 @@ void main()
color.a = spec * sunAngle2;
vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz);
-
+
+ // force frag depth which doesn't z-fight
+ gl_FragDepth = 0.99999f;
+
frag_data[0] = vec4(color.rgb, color); // diffuse
frag_data[1] = vec4(0); // speccolor, spec
frag_data[2] = vec4(encode_normal(screenspacewavef.xyz*0.5+0.5), 0.05, 0);// normalxy, 0, 0