From 5d5cb7a08344915a11bb43954212444fec073e7c Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 20 Oct 2010 14:37:24 -0500 Subject: Fix for broken shadows on rigged attachments when attachment penetrates shadow frustum near clip plane. --- .../app_settings/shaders/class1/deferred/attachmentShadowV.glsl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl index 1626e21cd8..5ae41cb730 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl @@ -1,5 +1,5 @@ /** - * @file diffuseSkinnedV.glsl + * @file attachmentShadowV.glsl * * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. * $License$ @@ -21,5 +21,7 @@ void main() gl_FrontColor = gl_Color; - gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0); + vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0); + p.z = max(p.z, -p.w+0.01); + gl_Position = p; } -- cgit v1.2.3