Ver Fonte

Shadows Fixed issue where the new stabilization code was making black bandings when no object was in a split.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10519 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
rem..om há 12 anos atrás
pai
commit
74a91559aa
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      engine/src/core/com/jme3/shadow/ShadowUtil.java

+ 3 - 2
engine/src/core/com/jme3/shadow/ShadowUtil.java

@@ -473,7 +473,8 @@ public class ShadowUtil {
         //from Practical Cascaded Shadow maps adapted to PSSM
         //scale stabilization
         float halfTextureSize = shadowMapSize * 0.5f;
-        if (halfTextureSize != 0) {
+
+        if (halfTextureSize != 0 && scaleX >0 && scaleY>0) {
             float scaleQuantizer = 0.1f;            
             scaleX = 1.0f / FastMath.ceil(1.0f / scaleX * scaleQuantizer) * scaleQuantizer;
             scaleY = 1.0f / FastMath.ceil(1.0f / scaleY * scaleQuantizer) * scaleQuantizer;
@@ -486,7 +487,7 @@ public class ShadowUtil {
         //Shadow map stabilization approximation from shaderX 7
         //from Practical Cascaded Shadow maps adapted to PSSM
         //offset stabilization
-        if (halfTextureSize != 0) {
+        if (halfTextureSize != 0  && scaleX >0 && scaleY>0) {
             offsetX = FastMath.ceil(offsetX * halfTextureSize) / halfTextureSize;
             offsetY = FastMath.ceil(offsetY * halfTextureSize) / halfTextureSize;
         }