From 74a91559aab938d7e6ec2c846dea80be579f5868 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sun, 7 Apr 2013 10:04:46 +0000 Subject: [PATCH] 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 --- engine/src/core/com/jme3/shadow/ShadowUtil.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/src/core/com/jme3/shadow/ShadowUtil.java b/engine/src/core/com/jme3/shadow/ShadowUtil.java index ed34bee1a..eb6e3812b 100644 --- a/engine/src/core/com/jme3/shadow/ShadowUtil.java +++ b/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; }