diff options
Diffstat (limited to 'indra/newview')
10 files changed, 7 insertions, 66 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl index c2372fcbc0..26d23aec79 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaMaskShadowF.glsl @@ -57,8 +57,4 @@ void main() } frag_color = vec4(1,1,1,1); - -#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/attachmentAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl index d0a049d372..57fd620cae 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentAlphaShadowF.glsl @@ -60,9 +60,4 @@ void main() } frag_color = vec4(1,1,1,1); - -#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/avatarAlphaMaskShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl index f231213ac8..407ee39fbb 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaMaskShadowF.glsl @@ -58,8 +58,4 @@ void main() } frag_color = vec4(1,1,1,1); - -#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/avatarAlphaShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl index 0e66c722b6..cfebc7bc66 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaShadowF.glsl @@ -60,9 +60,4 @@ void main() } frag_color = vec4(1,1,1,1); - -#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/avatarShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl index 50020a50d8..57c4bafd79 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl @@ -40,9 +40,5 @@ VARYING vec4 post_pos; void main() { frag_color = vec4(1,1,1,1); - -#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/shadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl index 06ebeb8281..68e9addc1b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskF.glsl @@ -69,8 +69,4 @@ void main() #endif frag_color = vec4(1,1,1,1); - -#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/shadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl index 1ea96918bb..406a7ef3b3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl @@ -25,20 +25,9 @@ /*[EXTRA_CODE_HERE]*/ -#ifdef DEFINE_GL_FRAGCOLOR out vec4 frag_color; -#else -#define frag_color gl_FragColor -#endif - -VARYING vec4 post_pos; void main() { frag_color = vec4(1,1,1,1); - -#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 72bd0f0f34..e83cda89ef 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl @@ -25,21 +25,9 @@ uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec3 position; - -VARYING vec4 post_pos; +in vec3 position; void main() { - //transform vertex - vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0); - - post_pos = pos; - -#if !defined(DEPTH_CLAMP) - gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w); -#else - gl_Position = pos; -#endif - + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl index e34d75ba1d..802179a401 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowF.glsl @@ -49,5 +49,4 @@ void main() frag_color = vec4(1,1,1,1); - gl_FragDepth = max(post_pos.z/post_pos.w*0.5+0.5, 0.0); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 6ac059df91..5f90fae25f 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -9470,7 +9470,9 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLGLEnable cull(GL_CULL_FACE); //enable depth clamping if available - //LLGLEnable depth_clamp(GL_DEPTH_CLAMP); + LLGLEnable depth_clamp(GL_DEPTH_CLAMP); + + LLGLDepthTest depth_test(GL_TRUE, GL_TRUE, GL_LESS); if (use_shader) { @@ -9513,15 +9515,8 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera for (int j = 0; j < 2; ++j) // 0 -- static, 1 -- rigged { bool rigged = j == 1; - if (!use_shader) - { //occlusion program is general purpose depth-only no-textures - gOcclusionProgram.bind(rigged); - } - else - { - gDeferredShadowProgram.bind(rigged); - LLGLSLShader::sCurBoundShaderPtr->uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0); - } + gDeferredShadowProgram.bind(rigged); + LLGLSLShader::sCurBoundShaderPtr->uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0); gGL.diffuseColor4f(1, 1, 1, 1); @@ -9555,10 +9550,6 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera } gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); - if (!use_shader) - { - gOcclusionProgram.unbind(); - } } if (occlude > 1) |