Skip to content

Commit

Permalink
fixed border should be applied after blur
Browse files Browse the repository at this point in the history
  • Loading branch information
ncannasse committed Apr 13, 2021
1 parent 5d57ac5 commit 97390c5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions h3d/pass/DirShadowMap.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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);
}
Expand Down

0 comments on commit 97390c5

Please sign in to comment.