From a5b8b48ea101c4706753b4b2f0f7defebd3a7c07 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Fri, 26 Oct 2012 16:20:31 +0000 Subject: [PATCH] fixed an isue in shadow shaders where shadows outside of the shadowZExtend were dark instead of light. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9905 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/core-data/Common/MatDefs/Shadow/PostShadowFilter.frag | 2 ++ .../src/core-data/Common/MatDefs/Shadow/PostShadowFilter15.frag | 2 ++ engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.frag | 2 ++ .../src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag | 2 ++ 4 files changed, 8 insertions(+) diff --git a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter.frag b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter.frag index a11d73d5b..ec43349fe 100644 --- a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter.frag +++ b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter.frag @@ -59,6 +59,8 @@ void main(){ }else if( shadowPosition < m_Splits.w){ shadowBorderScale = 0.125; shadow = GETSHADOW(m_ShadowMap3, projCoord3); + }else{ + shadow = 1.0; } shadow= shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity); diff --git a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter15.frag b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter15.frag index 00832ae90..782f66934 100644 --- a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter15.frag +++ b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowFilter15.frag @@ -59,6 +59,8 @@ float shadow = 0.0; }else if( shadowPosition < m_Splits.w){ shadowBorderScale = 0.125; shadow = GETSHADOW(m_ShadowMap3, projCoord3); + }else{ + shadow = 1.0; } shadow= shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity); diff --git a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.frag b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.frag index 27e768d71..7329bcb35 100644 --- a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.frag +++ b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM.frag @@ -42,6 +42,8 @@ void main(){ }else if( shadowPosition < m_Splits.w){ shadowBorderScale = 0.125; shadow = GETSHADOW(m_ShadowMap3, projCoord3); + }else{ + shadow = 1.0; } shadow = shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity); diff --git a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag index c2c256078..0c13287f1 100644 --- a/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag +++ b/engine/src/core-data/Common/MatDefs/Shadow/PostShadowPSSM15.frag @@ -44,6 +44,8 @@ void main(){ }else if( shadowPosition < m_Splits.w){ shadowBorderScale = 0.125; shadow = GETSHADOW(m_ShadowMap3, projCoord3); + }else{ + shadow = 1.0; } shadow= shadow * m_ShadowIntensity + (1.0 - m_ShadowIntensity);