|
@@ -5,20 +5,20 @@ class Glow extends Blur {
|
|
public var color : Int;
|
|
public var color : Int;
|
|
public var alpha : Float;
|
|
public var alpha : Float;
|
|
public var knockout : Bool;
|
|
public var knockout : Bool;
|
|
- public var smooth : Bool;
|
|
|
|
|
|
+ public var smoothColor : Bool;
|
|
|
|
|
|
- public function new( color : Int = 0xFFFFFF, alpha = 1., quality = 1, passes = 1, sigma = 1., smooth = false ) {
|
|
|
|
|
|
+ public function new( color : Int = 0xFFFFFF, alpha = 1., quality = 1, passes = 1, sigma = 1., smoothColor = false ) {
|
|
super(quality, passes, sigma);
|
|
super(quality, passes, sigma);
|
|
this.color = color;
|
|
this.color = color;
|
|
this.alpha = alpha;
|
|
this.alpha = alpha;
|
|
- this.smooth = smooth;
|
|
|
|
|
|
+ this.smoothColor = smoothColor;
|
|
pass.shader.hasFixedColor = true;
|
|
pass.shader.hasFixedColor = true;
|
|
}
|
|
}
|
|
|
|
|
|
override function draw( ctx : RenderContext, t : h2d.Tile ) {
|
|
override function draw( ctx : RenderContext, t : h2d.Tile ) {
|
|
pass.shader.fixedColor.setColor(color);
|
|
pass.shader.fixedColor.setColor(color);
|
|
pass.shader.fixedColor.w = alpha;
|
|
pass.shader.fixedColor.w = alpha;
|
|
- pass.shader.smoothFixedColor = smooth;
|
|
|
|
|
|
+ pass.shader.smoothFixedColor = smoothColor;
|
|
var save = ctx.textures.allocTarget("glowSave", ctx, t.width, t.height, false);
|
|
var save = ctx.textures.allocTarget("glowSave", ctx, t.width, t.height, false);
|
|
h3d.pass.Copy.run(t.getTexture(), save, None);
|
|
h3d.pass.Copy.run(t.getTexture(), save, None);
|
|
pass.apply(t.getTexture(), ctx.textures.allocTarget("glowTmp", ctx, t.width, t.height, false));
|
|
pass.apply(t.getTexture(), ctx.textures.allocTarget("glowTmp", ctx, t.width, t.height, false));
|