|
@@ -2,12 +2,13 @@ package h3d.pass;
|
|
|
|
|
|
@ignore("shader")
|
|
@ignore("shader")
|
|
class Outline extends ScreenFx<h3d.shader.Outline2D> {
|
|
class Outline extends ScreenFx<h3d.shader.Outline2D> {
|
|
- public var size(default, set) : Float;
|
|
|
|
- public var color(default, set) : Int;
|
|
|
|
- public var quality(default, set) : Float;
|
|
|
|
- public var multiplyAlpha(default, set) : Bool;
|
|
|
|
|
|
+ public var size : Float;
|
|
|
|
+ public var color : Int;
|
|
|
|
+ public var alpha : Float = 1.;
|
|
|
|
+ public var quality : Float;
|
|
|
|
+ public var multiplyAlpha : Bool;
|
|
|
|
|
|
- public function new(size = 4.0, color = 0xFF000000, quality = 0.3, multiplyAlpha = true) {
|
|
|
|
|
|
+ public function new(size = 4.0, color = 0x000000, quality = 0.3, multiplyAlpha = true) {
|
|
super(new h3d.shader.Outline2D());
|
|
super(new h3d.shader.Outline2D());
|
|
this.size = size;
|
|
this.size = size;
|
|
this.color = color;
|
|
this.color = color;
|
|
@@ -20,6 +21,7 @@ class Outline extends ScreenFx<h3d.shader.Outline2D> {
|
|
output = src;
|
|
output = src;
|
|
var tmp = ctx.textures.allocTarget(src.name + "OutlineTmp", src.width, src.height, false, src.format);
|
|
var tmp = ctx.textures.allocTarget(src.name + "OutlineTmp", src.width, src.height, false, src.format);
|
|
shader.color.setColor(color);
|
|
shader.color.setColor(color);
|
|
|
|
+ shader.color.a = alpha;
|
|
shader.size.set(size / src.width, size / src.height);
|
|
shader.size.set(size / src.width, size / src.height);
|
|
shader.samples = Std.int(Math.max(quality * 100, 1));
|
|
shader.samples = Std.int(Math.max(quality * 100, 1));
|
|
shader.multiplyAlpha = multiplyAlpha ? 0 : 1;
|
|
shader.multiplyAlpha = multiplyAlpha ? 0 : 1;
|
|
@@ -38,27 +40,4 @@ class Outline extends ScreenFx<h3d.shader.Outline2D> {
|
|
output.depthBuffer = outDepth;
|
|
output.depthBuffer = outDepth;
|
|
}
|
|
}
|
|
|
|
|
|
- function set_size(s) {
|
|
|
|
- if (size == s)
|
|
|
|
- return s;
|
|
|
|
- return size = s;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function set_color(c) {
|
|
|
|
- if (color == c)
|
|
|
|
- return c;
|
|
|
|
- return color = c;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function set_quality(q) {
|
|
|
|
- if (quality == q)
|
|
|
|
- return q;
|
|
|
|
- return quality = q;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- function set_multiplyAlpha(m) {
|
|
|
|
- if (multiplyAlpha == m)
|
|
|
|
- return m;
|
|
|
|
- return multiplyAlpha = m;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|