Browse Source

fixed border should be applied after blur

Nicolas Cannasse 4 năm trước cách đây
mục cha
commit
97390c5c04
1 tập tin đã thay đổi với 10 bổ sung2 xóa
  1. 10 2
      h3d/pass/DirShadowMap.hx

+ 10 - 2
h3d/pass/DirShadowMap.hx

@@ -249,7 +249,9 @@ class DirShadowMap extends Shadows {
 		ctx.engine.clear(0xFFFFFF, 1);
 		super.draw(passes, sort);
 
-		if( border != null )
+		var doBlur = blur.radius > 0 && (mode != Mixed || !ctx.computingStatic);
+
+		if( border != null && !doBlur )
 			border.render();
 
 		ctx.engine.popTarget();
@@ -264,8 +266,14 @@ class DirShadowMap extends Shadows {
 			texture = merge;
 		}
 
-		if( blur.radius > 0 && (mode != Mixed || !ctx.computingStatic) )
+		if( doBlur ) {
 			blur.apply(ctx, texture);
+			if( border != null ) {
+				ctx.engine.pushTarget(texture);
+				border.render();
+				ctx.engine.popTarget();
+			}
+		}
 
 		syncShader(texture);
 	}