Ver Fonte

Adding sign shader graph node.

clementlandrin há 1 ano atrás
pai
commit
c3066c4491
1 ficheiros alterados com 18 adições e 0 exclusões
  1. 18 0
      hrt/shgraph/nodes/Sign.hx

+ 18 - 0
hrt/shgraph/nodes/Sign.hx

@@ -0,0 +1,18 @@
+package hrt.shgraph.nodes;
+
+using hxsl.Ast;
+
+@name("Sign")
+@description("Returns 1.0 if a[i] is positive, -1.0 otherwise")
+@width(80)
+@group("Math")
+class Sign extends ShaderNodeHxsl {
+
+	static var SRC = {
+		@sginput(0.0) var a : Dynamic;
+		@sgoutput var output : Dynamic;
+		function fragment() {
+			output = sign(a);
+		}
+	};
+}