diff options
author | Graham Linden <graham@lindenlab.com> | 2019-01-31 09:56:37 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-01-31 09:56:37 -0800 |
commit | 767fb53aeb1ac92a141586b1c0b5d1e5d327b281 (patch) | |
tree | 969fe889ad0eed03676030e7a9a13965b077d20a /indra/newview/app_settings/shaders/class1 | |
parent | 695490d41b5be60570806ec0179b0334d032a531 (diff) |
9996 partial fix (works for non-ALM rendering only)
Use a new edge water shader to allow forcing frag depth to avoid z-fighting at back edge of water edge pieces.
This will not work for ALM because forcing the depth breaks the use of the depth to backproject gbuffer position which breaks lighting calcs.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r-- | indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | 5 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class1/environment/waterF.glsl | 5 |
2 files changed, 2 insertions, 8 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index df7b8f3f92..40d4c24d34 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -169,11 +169,6 @@ void main() vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); -#if defined(WATER_EDGE) - // force frag depth which doesn't z-fight - gl_FragDepth = 0.99999f; -#endif - 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 diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 415d0b9db4..f228deb938 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -157,9 +157,8 @@ void main() color.rgb = scaleSoftClip(color.rgb); color.a = spec * sunAngle2; -#if defined(WATER_EDGE) - // force frag depth to fix z-fighting at back edge of water edge pieces - gl_FragDepth = 0.99999; +#if WATER_EDGE + gl_FragDepth = 0.9999847f; #endif frag_color = color; |