Browse Source

Saturate node

Jed 4 years ago
parent
commit
27ad4f9a54
1 changed files with 24 additions and 0 deletions
  1. 24 0
      hrt/shgraph/nodes/Saturate.hx

+ 24 - 0
hrt/shgraph/nodes/Saturate.hx

@@ -0,0 +1,24 @@
+package hrt.shgraph.nodes;
+
+using hxsl.Ast;
+
+@name("Saturate")
+@description("Saturate input A")
+@width(80)
+@group("Math")
+class Saturate extends ShaderFunction {
+
+	@input("A") var a = SType.Float;
+
+	public function new() {
+		super(Saturate);
+	}
+
+	override public function computeOutputs() {
+		if (a != null && !a.isEmpty())
+			addOutput("output", a.getType());
+		else
+			removeOutput("output");
+	}
+
+}