diff options
author | Rider Linden <rider@lindenlab.com> | 2019-01-22 09:24:25 -0800 |
---|---|---|
committer | Rider Linden <rider@lindenlab.com> | 2019-01-22 09:24:25 -0800 |
commit | 3aed2a4b64bb4bca325d6709607bf8d446bd0ba4 (patch) | |
tree | c22b01949cb93092e46d3345ca1e539828694dbe /indra | |
parent | f42ac5b94e384c789de0b2c4e865b087589a940e (diff) | |
parent | 296dbb9fd08c3c6e25c4f174159b77d470456a8f (diff) |
Merge
Diffstat (limited to 'indra')
30 files changed, 79 insertions, 59 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl index 3f90600ace..0fa0edfd67 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl @@ -41,7 +41,7 @@ void main() vec4 p = projection_matrix * vec4(pos, 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) p.z = max(p.z, -p.w+0.01); gl_Position = p; #else diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 8e46425ea8..50020a50d8 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -41,7 +41,7 @@ void main() { frag_color = vec4(1,1,1,1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); #endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl index bde1ad4e9f..91b25613e0 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec3 normal; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -53,7 +53,7 @@ void main() norm = normalize(norm); pos = projection_matrix * pos; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl index fa6926b007..d93baa03c6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl @@ -55,7 +55,7 @@ uniform vec3 sun_dir; uniform float sun_size; uniform float far_z; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -114,7 +114,7 @@ void main() frag_color = vec4(alpha1, alpha1, alpha1, 1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); #endif diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowV.glsl index cb27b2c2c5..effb070f93 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -49,7 +49,7 @@ void main() pos = modelview_projection_matrix * pre_pos; target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); #else diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendF.glsl index 12bc690553..44f2a73e1f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -49,7 +49,7 @@ void main() frag_color = vec4(alpha, alpha, alpha, 1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(pos_zd2/pos_w+0.5, 0.0); #endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendV.glsl index 11411a605c..f45c343066 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaBlendV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -52,7 +52,7 @@ void main() pos_w = pos.w; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index ae1b19a35c..1791d3e315 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -62,7 +62,7 @@ void main() frag_color = vec4(1,1,1,1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(pos_zd2/pos_w+0.5, 0.0); #endif } diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl index 11411a605c..f45c343066 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -52,7 +52,7 @@ void main() pos_w = pos.w; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl index ef153dfc5b..0e74d2eb8a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowCubeV.glsl @@ -27,7 +27,7 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -40,7 +40,7 @@ void main() vec3 p = position*box_size+box_center; vec4 pos = modelview_projection_matrix*vec4(p.xyz, 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index 242aef821d..22d42d38c1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -31,7 +31,7 @@ out vec4 frag_color; #define frag_color gl_FragColor #endif -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -39,7 +39,7 @@ void main() { frag_color = vec4(1,1,1,1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); #endif diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl index cc77a4cea0..41a89fb8b4 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -27,7 +27,7 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -36,7 +36,7 @@ void main() //transform vertex vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl index fa6926b007..d93baa03c6 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl @@ -55,7 +55,7 @@ uniform vec3 sun_dir; uniform float sun_size; uniform float far_z; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -114,7 +114,7 @@ void main() frag_color = vec4(alpha1, alpha1, alpha1, 1); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); #endif diff --git a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowV.glsl b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowV.glsl index 52164e7b80..1c2fbaf25d 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -48,7 +48,7 @@ void main() pos = modelview_projection_matrix * pre_pos; target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); #else diff --git a/indra/newview/app_settings/shaders/class3/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class3/deferred/attachmentShadowV.glsl index 3be9cb3de8..1a655e6467 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/attachmentShadowV.glsl @@ -42,10 +42,8 @@ void main() pos = (mat*vec4(position.xyz, 1.0)); pos = projection_matrix * vec4(pos.xyz, 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos.z = max(pos.z, -pos.w+0.01); - gl_Position = pos; -#else - gl_Position = pos; #endif + gl_Position = pos; } diff --git a/indra/newview/app_settings/shaders/class3/deferred/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class3/deferred/avatarShadowF.glsl index f4e5a61e36..48eefc7a73 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/avatarShadowF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -45,7 +45,7 @@ void main() { frag_color = computeMoments(length(pos), 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); #endif } diff --git a/indra/newview/app_settings/shaders/class3/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class3/deferred/avatarShadowV.glsl index 96ca2fd707..164b355f20 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/avatarShadowV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/avatarShadowV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec3 normal; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -56,7 +56,7 @@ void main() pos = projection_matrix * pos; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); #else diff --git a/indra/newview/app_settings/shaders/class3/deferred/cloudShadowV.glsl b/indra/newview/app_settings/shaders/class3/deferred/cloudShadowV.glsl index cb27b2c2c5..effb070f93 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/cloudShadowV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/cloudShadowV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -49,7 +49,7 @@ void main() pos = modelview_projection_matrix * pre_pos; target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); #else diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendF.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendF.glsl index 01599d81c4..345c07a354 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -52,7 +52,7 @@ void main() frag_color = computeMoments(length(pos), float a); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(pos_zd2/pos_w+0.5, 0.0); #endif } diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendV.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendV.glsl index 3fb2bafca4..af1461c297 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaBlendV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -51,7 +51,7 @@ void main() pos_w = pos.w; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskF.glsl index d6ed5b6bb0..50f1ffd626 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -67,7 +67,7 @@ void main() frag_color = computeMoments(length(pos.xyz), alpha); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(pos_zd2/pos_w+0.5, 0.0); #endif diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskV.glsl index bc7fe003f2..6a646f5e9e 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowAlphaMaskV.glsl @@ -31,7 +31,7 @@ ATTRIBUTE vec3 position; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -51,7 +51,7 @@ void main() target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowCubeV.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowCubeV.glsl index 923de09ada..db8c75fb8a 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowCubeV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowCubeV.glsl @@ -27,7 +27,7 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING vec4 post_pos; #endif @@ -40,7 +40,7 @@ void main() vec3 p = position*box_size+box_center; vec4 pos = modelview_projection_matrix*vec4(p.xyz, 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) post_pos = pos; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowF.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowF.glsl index 5a6c8728c0..3350267130 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowF.glsl @@ -33,7 +33,7 @@ out vec4 frag_color; uniform sampler2D diffuseMap; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif diff --git a/indra/newview/app_settings/shaders/class3/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class3/deferred/shadowV.glsl index 9a5edaf091..6577fe0ecf 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/shadowV.glsl @@ -30,7 +30,7 @@ uniform mat4 texture_matrix0; ATTRIBUTE vec3 position; ATTRIBUTE vec2 texcoord0; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) VARYING float pos_zd2; #endif @@ -50,7 +50,7 @@ void main() target_pos_x = 0.5 * (shadow_target_width - 1.0) * pos.x; -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) pos_zd2 = pos.z * 0.5; gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); diff --git a/indra/newview/app_settings/shaders/class3/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class3/deferred/treeShadowF.glsl index 693af31bf2..41673d1669 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/treeShadowF.glsl @@ -51,7 +51,7 @@ void main() frag_color = computeMoments(length(pos), 1.0); -#if !DEPTH_CLAMP +#if !defined(DEPTH_CLAMP) gl_FragDepth = max(pos.z/pos.w*0.5+0.5, 0.0); #endif diff --git a/indra/newview/llpanelenvironment.cpp b/indra/newview/llpanelenvironment.cpp index c2827e451f..ec6352c88d 100644 --- a/indra/newview/llpanelenvironment.cpp +++ b/indra/newview/llpanelenvironment.cpp @@ -172,8 +172,10 @@ BOOL LLPanelEnvironmentInfo::postBuild() getChild<LLUICtrl>(SLD_DAYLENGTH)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayLengthChanged(value.asReal()); }); getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); + getChild<LLSliderCtrl>(SLD_DAYLENGTH)->setSliderEditorCommitCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); getChild<LLUICtrl>(SLD_DAYOFFSET)->setCommitCallback([this](LLUICtrl *, const LLSD &value) { onSldDayOffsetChanged(value.asReal()); }); getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); + getChild<LLSliderCtrl>(SLD_DAYOFFSET)->setSliderEditorCommitCallback([this](LLUICtrl *, const LLSD &) { onDayLenOffsetMouseUp(); }); getChild<LLMultiSliderCtrl>(SLD_ALTITUDES)->setCommitCallback([this](LLUICtrl *cntrl, const LLSD &value) { onAltSliderCallback(cntrl, value); }); getChild<LLMultiSliderCtrl>(SLD_ALTITUDES)->setSliderMouseUpCallback([this](LLUICtrl *, const LLSD &) { onAltSliderMouseUp(); }); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 000d67a4e2..1686aeea4f 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -2142,7 +2142,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; - gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + if (gGLManager.mHasDepthClamp) + { + gDeferredShadowProgram.addPermutation("DEPTH_CLAMP", "1"); + } success = gDeferredShadowProgram.createShader(NULL, NULL); llassert(success); } @@ -2155,7 +2158,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowCubeProgram.mShaderFiles.clear(); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowCubeV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowCubeProgram.mShaderFiles.push_back(make_pair("deferred/shadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + if (gGLManager.mHasDepthClamp) + { + gDeferredShadowCubeProgram.addPermutation("DEPTH_CLAMP", "1"); + } gDeferredShadowCubeProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowCubeProgram.createShader(NULL, NULL); llassert(success); @@ -2170,7 +2176,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredShadowAlphaMaskProgram.mShaderFiles.clear(); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredShadowAlphaMaskProgram.mShaderFiles.push_back(make_pair("deferred/shadowAlphaMaskF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + if (gGLManager.mHasDepthClamp) + { + gDeferredShadowAlphaMaskProgram.addPermutation("DEPTH_CLAMP", "1"); + } gDeferredShadowAlphaMaskProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredShadowAlphaMaskProgram.createShader(NULL, NULL); llassert(success); @@ -2185,7 +2194,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAvatarShadowProgram.mShaderFiles.clear(); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAvatarShadowProgram.mShaderFiles.push_back(make_pair("deferred/avatarShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + if (gGLManager.mHasDepthClamp) + { + gDeferredAvatarShadowProgram.addPermutation("DEPTH_CLAMP", "1"); + } gDeferredAvatarShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAvatarShadowProgram.createShader(NULL, NULL); llassert(success); @@ -2200,7 +2212,10 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredAttachmentShadowProgram.mShaderFiles.clear(); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredAttachmentShadowProgram.mShaderFiles.push_back(make_pair("deferred/attachmentShadowF.glsl", GL_FRAGMENT_SHADER_ARB)); - gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", gGLManager.mHasDepthClamp ? "1" : "0"); + if (gGLManager.mHasDepthClamp) + { + gDeferredAttachmentShadowProgram.addPermutation("DEPTH_CLAMP", "1"); + } gDeferredAttachmentShadowProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED]; success = gDeferredAttachmentShadowProgram.createShader(NULL, NULL); llassert(success); @@ -3862,6 +3877,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() success = gWLCloudProgram.createShader(NULL, NULL); } + /* unused outside of ALM at the moment and failing to link on OSX for reasons only Timmy knows. if (success) { gWLCloudShadowProgram.mName = "Windlight Cloud Shadow Program"; @@ -3874,7 +3890,7 @@ BOOL LLViewerShaderMgr::loadShadersWindLight() gWLCloudShadowProgram.mShaderLevel = mShaderLevel[SHADER_WINDLIGHT]; gWLCloudShadowProgram.mShaderGroup = LLGLSLShader::SG_SKY; success = gWLCloudShadowProgram.createShader(NULL, NULL); - } + }*/ if (success) { diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 5d9c4d64cb..9d8f98688f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -349,6 +349,7 @@ bool LLPipeline::sMemAllocationThrottled = false; S32 LLPipeline::sVisibleLightCount = 0; F32 LLPipeline::sMinRenderSize = 0.f; bool LLPipeline::sRenderingHUDs; +F32 LLPipeline::sDistortionWaterClipPlaneMargin = 1.0001f; // EventHost API LLPipeline listener. static LLPipelineListener sPipelineListener; @@ -9649,8 +9650,10 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) if (LLPipeline::sUnderWaterRender || LLDrawPoolWater::sNeedsReflectionUpdate) { - //clip out geometry on the same side of water as the camera - LLPlane plane(pnorm, water_height); + //clip out geometry on the same side of water as the camera w/ enough margin to not include the water geo itself, + // but not so much as to clip out parts of avatars that should be seen under the water in the distortion map + + LLPlane plane(pnorm, -water_height * LLPipeline::sDistortionWaterClipPlaneMargin); LLGLUserClipPlane clip_plane(plane, mReflectionModelView, projection); static LLCullResult result; diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index c76b91266e..5be6b73cc4 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -594,6 +594,7 @@ public: static S32 sVisibleLightCount; static F32 sMinRenderSize; static bool sRenderingHUDs; + static F32 sDistortionWaterClipPlaneMargin; static LLTrace::EventStatHandle<S64> sStatBatchSize; |