diff options
Diffstat (limited to 'indra')
27 files changed, 71 insertions, 57 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/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) { |