Clement Espeute 2 anni fa
parent
commit
320f2b6251
55 ha cambiato i file con 804 aggiunte e 1040 eliminazioni
  1. 9 16
      hide/view/Graph.hx
  2. 13 13
      hide/view/shadereditor/Box.hx
  3. 29 34
      hide/view/shadereditor/ShaderEditor.hx
  4. 20 20
      hrt/shgraph/Operation.hx
  5. 0 152
      hrt/shgraph/ParseFieldsMacro.hx
  6. 7 19
      hrt/shgraph/ShaderGraph.hx
  7. 15 34
      hrt/shgraph/ShaderNode.hx
  8. 16 18
      hrt/shgraph/ShaderOutput.hx
  9. 8 13
      hrt/shgraph/nodes/Abs.hx
  10. 8 13
      hrt/shgraph/nodes/Acos.hx
  11. 0 4
      hrt/shgraph/nodes/Add.hx
  12. 8 13
      hrt/shgraph/nodes/Asin.hx
  13. 8 14
      hrt/shgraph/nodes/Atan.hx
  14. 8 14
      hrt/shgraph/nodes/Ceil.hx
  15. 12 12
      hrt/shgraph/nodes/Clamp.hx
  16. 3 3
      hrt/shgraph/nodes/Color.hx
  17. 4 4
      hrt/shgraph/nodes/Combine.hx
  18. 2 2
      hrt/shgraph/nodes/CombineAlpha.hx
  19. 56 56
      hrt/shgraph/nodes/Cond.hx
  20. 10 10
      hrt/shgraph/nodes/Cos.hx
  21. 15 15
      hrt/shgraph/nodes/Cross.hx
  22. 3 3
      hrt/shgraph/nodes/Divide.hx
  23. 8 8
      hrt/shgraph/nodes/Dot.hx
  24. 11 11
      hrt/shgraph/nodes/Exp.hx
  25. 38 38
      hrt/shgraph/nodes/FloatConst.hx
  26. 10 10
      hrt/shgraph/nodes/Floor.hx
  27. 10 10
      hrt/shgraph/nodes/Fract.hx
  28. 43 43
      hrt/shgraph/nodes/IfCondition.hx
  29. 10 10
      hrt/shgraph/nodes/Length.hx
  30. 11 11
      hrt/shgraph/nodes/Log.hx
  31. 13 13
      hrt/shgraph/nodes/Max.hx
  32. 13 13
      hrt/shgraph/nodes/Maximum.hx
  33. 13 13
      hrt/shgraph/nodes/Min.hx
  34. 13 13
      hrt/shgraph/nodes/Minimum.hx
  35. 16 16
      hrt/shgraph/nodes/Mix.hx
  36. 11 11
      hrt/shgraph/nodes/Mod.hx
  37. 3 3
      hrt/shgraph/nodes/Multiply.hx
  38. 10 10
      hrt/shgraph/nodes/Normalize.hx
  39. 11 11
      hrt/shgraph/nodes/Pow.hx
  40. 149 149
      hrt/shgraph/nodes/Preview.hx
  41. 11 11
      hrt/shgraph/nodes/Sampler.hx
  42. 10 10
      hrt/shgraph/nodes/Saturate.hx
  43. 10 10
      hrt/shgraph/nodes/Sin.hx
  44. 16 16
      hrt/shgraph/nodes/SmoothStep.hx
  45. 9 9
      hrt/shgraph/nodes/Split.hx
  46. 10 10
      hrt/shgraph/nodes/Sqrt.hx
  47. 15 15
      hrt/shgraph/nodes/Step.hx
  48. 5 5
      hrt/shgraph/nodes/StripAlpha.hx
  49. 0 8
      hrt/shgraph/nodes/SubGraph.hx
  50. 3 3
      hrt/shgraph/nodes/Subtract.hx
  51. 10 10
      hrt/shgraph/nodes/Tan.hx
  52. 25 25
      hrt/shgraph/nodes/Text.hx
  53. 13 13
      hrt/shgraph/nodes/UVScroll.hx
  54. 10 10
      hrt/shgraph/nodes/UnpackNormal.hx
  55. 10 10
      hrt/shgraph/nodes/UvToScreen.hx

+ 9 - 16
hide/view/Graph.hx

@@ -262,21 +262,15 @@ class Graph extends FileView {
 		});
 		listOfBoxes.push(box);
 
-		for (inputKey in box.getInstance().getInputInfoKeys()) {
-			var inputInfo = box.getInstance().getInputInfo(inputKey);
-
-			if (inputInfo == null) {
-				trace(inputKey);
-			}
-
+		for (inputName => inputVar in box.getInstance().getInputs2()) {
 			var defaultValue = null;
-			if (inputInfo.hasProperty) {
-				defaultValue = Reflect.field(box.getInstance(), 'prop_${inputKey}');
+			/*if (inputInfo.hasProperty) {
+				defaultValue = Reflect.field(box.getInstance(), 'prop_${inputName => inputVar}');
 				if (defaultValue == null) {
 					defaultValue = "0";
 				}
-			}
-			var grNode = box.addInput(editor, inputInfo.name, defaultValue, inputInfo.type);
+			}*/
+			var grNode = box.addInput(editor, inputName, defaultValue, inputVar.type);
 			if (defaultValue != null) {
 				var fieldEditInput = grNode.find("input");
 				fieldEditInput.on("change", function(ev) {
@@ -284,13 +278,13 @@ class Graph extends FileView {
 					if (Math.isNaN(tmpValue) ) {
 						fieldEditInput.addClass("error");
 					} else {
-						Reflect.setField(box.getInstance(), 'prop_${inputKey}', tmpValue);
+						Reflect.setField(box.getInstance(), 'prop_${inputName}', tmpValue);
 						fieldEditInput.val(tmpValue);
 						fieldEditInput.removeClass("error");
 					}
 				});
 			}
-			grNode.find(".node").attr("field", inputKey);
+			grNode.find(".node").attr("field", inputName);
 			grNode.on("mousedown", function(e : js.jquery.Event) {
 				e.stopPropagation();
 				var node = grNode.find(".node");
@@ -384,11 +378,10 @@ class Graph extends FileView {
 	function setAvailableInputNodes(boxOutput : Box, field : String) {
 		var type = boxOutput.getInstance().getOutputs2()[field].type;
 		var sType : SType;
-		sType = ShaderType.getSType(type);
 
 		for (box in listOfBoxes) {
 			for (input in box.inputs) {
-				if (box.getInstance().checkTypeAndCompatibilyInput(input.attr("field"), sType)) {
+				if (box.getInstance().checkTypeAndCompatibilyInput(input.attr("field"), type)) {
 					input.addClass("nodeMatch");
 				}
 			}
@@ -401,7 +394,7 @@ class Graph extends FileView {
 				var outputField = output.attr("field");
 				var type = box.getInstance().getOutputs2()[outputField].type;
 				var sType = ShaderType.getSType(type);
-				if (boxInput.getInstance().checkTypeAndCompatibilyInput(field, sType)) {
+				if (boxInput.getInstance().checkTypeAndCompatibilyInput(field, type)) {
 					output.addClass("nodeMatch");
 				}
 			}

+ 13 - 13
hide/view/shadereditor/Box.hx

@@ -89,28 +89,28 @@ class Box {
 		//editor.line(element, width/2, HEADER_HEIGHT, width/2, 0, {display: "none"}).addClass("nodes-separator");
 	}
 
-	public function addInput(editor : SVG, name : String, valueDefault : String = null, type : hrt.shgraph.ShaderType.SType) {
+	public function addInput(editor : SVG, name : String, valueDefault : String = null, type : hxsl.Ast.Type) {
 		var node = editor.group(element).addClass("input-node-group");
 		var nodeHeight = HEADER_HEIGHT + NODE_MARGIN * (inputs.length+1) + NODE_RADIUS * inputs.length;
 		var style = {fill : ""}
 		switch (type) {
-			case Bool:
+			case TBool:
 				style.fill = boolColor;
-			case Number:
-				style.fill = numberColor;
-			case Float:
+			case TFloat:
 				style.fill = floatColor;
-			case Vec2:
-				style.fill = vec2Color;
-			case Vec3:
-				style.fill = vec3Color;
-			case Vec4:
-				style.fill = vec4Color;
-			case Sampler:
+			case TVec(size, _):
+				switch (size) {
+					case 2:
+						style.fill = vec2Color;
+					case 3:
+						style.fill = vec3Color;
+					case 4:
+						style.fill = vec4Color;
+				}
+			case TSampler2D:
 				style.fill = samplerColor;
 			default:
 				style.fill = defaultColor;
-
 		}
 		var nodeCircle = editor.circle(node, 0, nodeHeight, NODE_RADIUS, style).addClass("node input-node");
 

+ 29 - 34
hide/view/shadereditor/ShaderEditor.hx

@@ -465,13 +465,13 @@ class ShaderEditor extends hide.view.Graph {
 		updateMatrix();
 
 		for (node in shaderGraph.getNodes()) {
-			var shaderPreview = Std.downcast(node.instance, hrt.shgraph.nodes.Preview);
+			/*var shaderPreview = Std.downcast(node.instance, hrt.shgraph.nodes.Preview);
 			if (shaderPreview != null) {
 				shaderPreview.config = config;
 				shaderPreview.shaderGraph = shaderGraph;
 				addBox(new Point(node.x, node.y), std.Type.getClass(node.instance), shaderPreview);
 				continue;
-			}
+			}*/
 			var paramNode = Std.downcast(node.instance, ShaderParam);
 			if (paramNode != null) {
 				var paramShader = shaderGraph.getParameter(paramNode.parameterId);
@@ -518,38 +518,33 @@ class ShaderEditor extends hide.view.Graph {
 	}
 
 	function generateEdgesFromBox(box : Box) {
-		for (outputName => outputVar in box.getInstance().getOutputs2()) {
-			for (b in listOfBoxes) {
-				for (key in b.getInstance().getInputsKey()) {
-					var input = b.getInstance().getInput(key);
-					if (input != null && input.node.id == box.getId() && input.keyOutput == outputName) {
-						var nodeFrom = box.getElement().find('[field=${outputName}]');
-						var nodeTo = b.getElement().find('[field=${key}]');
-						edgeStyle.stroke = nodeFrom.css("fill");
-						createEdgeInEditorGraph({from: box, nodeFrom: nodeFrom, to : b, nodeTo: nodeTo, elt : createCurve(nodeFrom, nodeTo) });
-					}
+
+		for (b in listOfBoxes) {
+			for (inputName => connection in b.getInstance().inputs2) {
+				if (connection.from.id == box.getId()) {
+					var nodeFrom = box.getElement().find('[field=${connection.fromName}]');
+					var nodeTo = b.getElement().find('[field=${inputName}]');
+					edgeStyle.stroke = nodeFrom.css("fill");
+					createEdgeInEditorGraph({from: box, nodeFrom: nodeFrom, to : b, nodeTo: nodeTo, elt : createCurve(nodeFrom, nodeTo) });
 				}
-			}
 
+			}
 		}
 	}
 
 	function generateEdgesToBox(box : Box) {
-		for (key in box.getInstance().getInputsKey()) {
-			var input = box.getInstance().getInput(key);
-			if (input != null) {
-				var fromBox : Box = null;
-				for (boxFrom in listOfBoxes) {
-					if (boxFrom.getId() == input.node.id) {
-						fromBox = boxFrom;
-						break;
-					}
+		for (inputName => connection in box.getInstance().inputs2) {
+			var fromBox : Box = null;
+			for (boxFrom in listOfBoxes) {
+				if (boxFrom.getId() == connection.from.id) {
+					fromBox = boxFrom;
+					break;
 				}
-				var nodeFrom = fromBox.getElement().find('[field=${input.getKey()}]');
-				var nodeTo = box.getElement().find('[field=${key}]');
-				edgeStyle.stroke = nodeFrom.css("fill");
-				createEdgeInEditorGraph({from: fromBox, nodeFrom: nodeFrom, to : box, nodeTo: nodeTo, elt : createCurve(nodeFrom, nodeTo) });
 			}
+			var nodeFrom = fromBox.getElement().find('[field=${connection.fromName}]');
+			var nodeTo = box.getElement().find('[field=${inputName}]');
+			edgeStyle.stroke = nodeFrom.css("fill");
+			createEdgeInEditorGraph({from: fromBox, nodeFrom: nodeFrom, to : box, nodeTo: nodeTo, elt : createCurve(nodeFrom, nodeTo) });
 		}
 	}
 
@@ -963,10 +958,10 @@ class ShaderEditor extends hide.view.Graph {
 		var param = shaderGraph.getParameter(id);
 		setParamValueByName(currentShader, param.name, param.defaultValue);
 		for (b in listOfBoxes) {
-			var previewBox = Std.downcast(b.getInstance(), hrt.shgraph.nodes.Preview);
+			/*var previewBox = Std.downcast(b.getInstance(), hrt.shgraph.nodes.Preview);
 			if (previewBox != null) {
 				previewBox.setParamValueByName(param.variable.name, param.defaultValue);
-			}
+			}*/
 		}
 	}
 
@@ -987,12 +982,12 @@ class ShaderEditor extends hide.view.Graph {
 	function initSpecifics(node : Null<ShaderNode>) {
 		if( node == null )
 			return;
-		var shaderPreview = Std.downcast(node, hrt.shgraph.nodes.Preview);
+		/*var shaderPreview = Std.downcast(node, hrt.shgraph.nodes.Preview);
 		if (shaderPreview != null) {
 			shaderPreview.config = config;
 			shaderPreview.shaderGraph = shaderGraph;
 			return;
-		}
+		}*/
 		var subGraphNode = Std.downcast(node, hrt.shgraph.nodes.SubGraph);
 		if (subGraphNode != null) {
 			subGraphNode.loadGraphShader();
@@ -1558,19 +1553,19 @@ class ShaderEditor extends hide.view.Graph {
 
 	override function updatePosition(box : Box) {
 		var previewBox = Std.downcast(box.getInstance(), hrt.shgraph.nodes.Preview);
-		if (previewBox != null){
+		/*if (previewBox != null){
 			previewBox.onMove(gX(box.getX()), gY(box.getY()), transformMatrix[0]);
-		}
+		}*/
 		shaderGraph.setPosition(box.getId(), box.getX(), box.getY());
 	}
 
 	override function updateMatrix() {
 		super.updateMatrix();
 		for (b in listOfBoxes) {
-			var previewBox = Std.downcast(b.getInstance(), hrt.shgraph.nodes.Preview);
+			/*var previewBox = Std.downcast(b.getInstance(), hrt.shgraph.nodes.Preview);
 			if (previewBox != null){
 				previewBox.onMove(gX(b.getX()), gY(b.getY()), transformMatrix[0]);
-			}
+			}*/
 		}
 	}
 

+ 20 - 20
hrt/shgraph/Operation.hx

@@ -4,26 +4,26 @@ using hxsl.Ast;
 
 class Operation extends ShaderNodeHxsl {
 
-	@input("A", true) var a = SType.Number;
-	@input("B", true) var b = SType.Number;
-
-
-	var operation : Binop;
-
-	public function new(operation : Binop) {
-		this.operation = operation;
-	}
-
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty() && b != null && !b.isEmpty())
-			addOutput("output", a.getVar(b.getType()).t);
-		else if (a != null && !a.isEmpty() )
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// @input("A", true) var a = SType.Number;
+	// @input("B", true) var b = SType.Number;
+
+
+	// var operation : Binop;
+
+	// public function new(operation : Binop) {
+	// 	this.operation = operation;
+	// }
+
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty() && b != null && !b.isEmpty())
+	// 		addOutput("output", a.getVar(b.getType()).t);
+	// 	else if (a != null && !a.isEmpty() )
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 	// override public function build(key : String) : TExpr {
 

+ 0 - 152
hrt/shgraph/ParseFieldsMacro.hx

@@ -1,152 +0,0 @@
-package hrt.shgraph;
-
-import haxe.macro.Context;
-import haxe.macro.Expr;
-using haxe.macro.Tools;
-
-class ParseFieldsMacro {
-
-#if macro
-
-	public static function build() : Array<Field> {
-		var fields = Context.getBuildFields();
-
-		var mapInputs = new Array<Expr>();
-		var inputsList = new Array<String>();
-		var hasInputs = false;
-		var mapOutputs = new Array<Expr>();
-		var outputsList = new Array<String>();
-		var hasOutputs = false;
-
-		for ( f in fields ) {
-			if( f.meta == null ) continue;
-			switch (f.kind) {
-				case FVar(t, e):
-					var saveMeta = f.meta;
-					for (m in saveMeta) {
-						if (m.name == "input") {
-							hasInputs = true;
-							var sel = f.name;
-							var get_sel = "get_" + sel;
-							var propSel = "prop_" + sel;
-							var hasProperty = false;
-							var isRequired = true;
-							var nameInput = "input";
-							if (m.params.length >= 1) {
-								switch(m.params[0].expr) {
-									case EConst(CString(s)):
-										if (s.length > 0)
-											nameInput = s;
-									default:
-								}
-							}
-							if (m.params.length >= 2) {
-								switch(m.params[1].expr) {
-									case EConst(CIdent(b)):
-										if (b == "true") {
-											hasProperty = true;
-											fields.push({
-												name: propSel,
-												access: [Access.APrivate],
-												kind: FieldType.FVar(macro:Float),
-												pos: Context.currentPos(),
-												meta: [{name: "prop", params: [{expr: EConst(CString("macro")), pos: Context.currentPos() }], pos: Context.currentPos()}]
-											});
-										}
-									default:
-								}
-							}
-							if (m.params.length >= 3) {
-								switch(m.params[2].expr) {
-									case EConst(CIdent(b)):
-										if (b == "false") {
-											isRequired = false;
-										}
-									default:
-								}
-							}
-							if (hasProperty) {
-								var sfields = macro class {
-									inline function $get_sel() : NodeVar {
-										var input = getInput($v{sel});
-										if (input == null)
-											return new NodeVar(new hrt.shgraph.nodes.FloatConst($i{propSel}), "output");
-										else
-											return getInput($v{sel});
-									}
-								};
-								for( field in sfields.fields )
-									fields.push(field);
-							} else {
-								var sfields = macro class {
-									inline function $get_sel() : NodeVar return getInput($v{sel});
-								};
-								for( field in sfields.fields )
-									fields.push(field);
-							}
-							if (e == null)
-								Context.error('Input ${sel} has not affectation', f.pos);
-
-							var enumValue = ["ShaderType", "SType", e.toString().split(".").pop()];
-							mapInputs.push(macro $v{sel} => { name : $v{nameInput}, type : ${enumValue.toFieldExpr()}, hasProperty: $v{hasProperty}, isRequired : $v{isRequired} });
-							f.kind = FProp("get", "null", TPath({ pack: ["hrt", "shgraph"], name: "NodeVar" }));
-							f.meta = saveMeta;
-							inputsList.push(f.name);
-
-							break;
-						} else if (m.name == "output") {
-
-							break;
-						}
-					}
-				default:
-			}
-		}
-		if (hasInputs) {
-			fields.push({
-				name: "inputsInfo",
-				access: [Access.APrivate],
-				kind: FieldType.FVar(macro:Map<String, ShaderNode.InputInfo>, macro $a{mapInputs}),
-				pos: Context.currentPos(),
-			});
-			var sfields = macro class {
-				override public function getInputInfo(key : String) : ShaderNode.InputInfo return inputsInfo.get(key);
-				override public function getInputInfoKeys() : Array<String> return $v{inputsList};
-			};
-			for( field in sfields.fields )
-				fields.push(field);
-		}
-		if (hasOutputs) {
-			/*fields.push({
-				name: "outputsInfo",
-				access: [Access.APrivate],
-				kind: FieldType.FVar(macro:Map<String, ShaderNode.OutputInfo>, macro $a{mapOutputs}),
-				pos: Context.currentPos(),
-			});*/
-			/*var sfields = macro class {
-				override public function getOutputInfo(key : String) : ShaderNode.OutputInfo return outputsInfo.get(key);
-				override public function getOutputInfoKeys() : Array<String> return $v{outputsList};
-			};
-			for( field in sfields.fields )
-				fields.push(field);*/
-		}
-
-		var thisClass = Context.getLocalClass();
-		var cl = thisClass.get();
-		var clPath = cl.pack.copy();
-		clPath.push(cl.name);
-
-		#if editor
-		fields.push({
-			name: "_",
-			access: [Access.AStatic],
-			kind: FieldType.FVar(macro:Bool, macro ShaderNode.register($v{cl.name}, ${clPath.toFieldExpr()})),
-			pos: Context.currentPos(),
-		});
-		#end
-
-		return fields;
-	}
-
-#end
-}

+ 7 - 19
hrt/shgraph/ShaderGraph.hx

@@ -140,16 +140,9 @@ class ShaderGraph {
 		if (!output.instance.getOutputs2().exists(edge.nameOutput)) {
 			return false;
 		}
-		node.instance.setInput(edge.nameInput, new NodeVar(output.instance, edge.nameOutput));
-		output.outputs.push(node);
-
-		// pas du tout envie de mourrir
-
-		var toGen = node.instance.getShaderDef();
-		var toName = toGen.inVars[node.instance.getInputInfoKeys().indexOf(edge.nameInput)].name;
 
 		var connection : Connection = {from: output, fromName: edge.nameOutput};
-		node.instance.inputs2.set(toName, connection);
+		node.instance.inputs2.set(edge.nameInput, connection);
 
 		#if editor
 		if (hasCycle()){
@@ -182,13 +175,9 @@ class ShaderGraph {
 
 	public function removeEdge(idNode, nameInput, update = true) {
 		var node = this.nodes.get(idNode);
-		this.nodes.get(node.instance.getInput(nameInput).node.id).outputs.remove(node);
-		node.instance.setInput(nameInput, null);
-
-		var toGen = node.instance.getShaderDef();
-		var toName = toGen.inVars[node.instance.getInputInfoKeys().indexOf(nameInput)].name;
+		this.nodes.get(node.instance.inputs2[nameInput].from.id).outputs.remove(node);
 
-		node.instance.inputs2.remove(toName);
+		node.instance.inputs2.remove(nameInput);
 		if (update) {
 			updateOutputs(node);
 		}
@@ -546,8 +535,8 @@ class ShaderGraph {
 			var node = queue[currentIndex];
 			currentIndex++;
 
-			for (input in node.instance.getInputs()) {
-				var nodeInput = nodes.get(input.node.id);
+			for (connection in node.instance.inputs2) {
+				var nodeInput = connection.from;
 				nodeInput.indegree -= 1;
 				if (nodeInput.indegree == 0) {
 					queue.push(nodeInput);
@@ -616,9 +605,8 @@ class ShaderGraph {
 	public function save() {
 		var edgesJson : Array<Edge> = [];
 		for (n in nodes) {
-			for (k in n.instance.getInputsKey()) {
-				var output =  n.instance.getInput(k);
-				edgesJson.push({ idOutput: output.node.id, nameOutput: output.keyOutput, idInput: n.id, nameInput: k });
+			for (inputName => connection in n.instance.inputs2) {
+				edgesJson.push({ idOutput: connection.from.id, nameOutput: connection.fromName, idInput: n.id, nameInput: inputName });
 			}
 		}
 		var json = haxe.Json.stringify({

+ 15 - 34
hrt/shgraph/ShaderNode.hx

@@ -5,7 +5,6 @@ using hxsl.Ast;
 typedef InputInfo = { name : String, type : ShaderType.SType, hasProperty : Bool, isRequired : Bool, ?ids : Array<Int>, ?index : Int };
 typedef OutputInfo = { name : String, type : ShaderType.SType, ?id : Int };
 
-@:autoBuild(hrt.shgraph.ParseFieldsMacro.build())
 @:keepSub
 class ShaderNode {
 
@@ -43,32 +42,19 @@ class ShaderNode {
 		return map;
 	}
 
-
-	public function setId(id : Int) {
-		this.id = id;
-	}
-
-	public function setInput(key : String, s : NodeVar) {
-		if (s == null)
-				inputs.remove(key);
-		else
-			inputs.set(key, s);
-	}
-
-	public function getInput(key : String) : NodeVar {
-		return inputs.get(key);
-	}
-
-	public function getInputsKey() {
-		return [for (k in inputs.keys()) k ];
+	// TODO(ces) : caching
+	public function getInputs2() : Map<String, TVar> {
+		var def = getShaderDef();
+		var map : Map<String, TVar> = [];
+		for (tvar in def.inVars) {
+			map.set(tvar.name, tvar);
+		}
+		return map;
 	}
 
-	public function getInputs() {
-		return [for (k in inputs.keys()) inputs.get(k) ];
-	}
 
-	public function hasInputs() {
-		return inputs.keys().hasNext();
+	public function setId(id : Int) {
+		this.id = id;
 	}
 
 
@@ -117,25 +103,20 @@ class ShaderNode {
 		throw "Build function not implemented";
 	}
 
-	public function checkTypeAndCompatibilyInput(key : String, type : ShaderType.SType) : Bool {
-		var infoKey = getInputInfo(key).type;
+	public function checkTypeAndCompatibilyInput(key : String, type : hxsl.Ast.Type) : Bool {
+		/*var infoKey = getInputs2()[key].type;
 		if (infoKey != null && !(ShaderType.checkConversion(type, infoKey))) {
 			return false;
 		}
-		return checkValidityInput(key, type);
+		return checkValidityInput(key, type);*/
+		return true;
 	}
 
-	public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
+	public function checkValidityInput(key : String, type : hxsl.Ast.Type) : Bool {
 		return true;
 	}
 
-	public function getInputInfoKeys() : Array<String> {
-		return [];
-	}
 
-	public function getInputInfo(key : String) : InputInfo {
-		return null;
-	}
 
 	// public function getOutputInfoKeys() : Array<String> {
 	// 	return [];

+ 16 - 18
hrt/shgraph/ShaderOutput.hx

@@ -8,8 +8,6 @@ using hxsl.Ast;
 @color("#A90707")
 class ShaderOutput extends ShaderNode {
 
-	@input("input") var input = SType.Variant;
-
 	@prop("Variable") public var variable : TVar;
 
 	var components = [X, Y, Z, W];
@@ -28,22 +26,22 @@ class ShaderOutput extends ShaderNode {
 		return {expr: finalExpr, inVars: [inVar], outVars:[], externVars: [inVar, output], inits: []};
 	}
 
-	override public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
-		return ShaderType.checkConversion(type, ShaderType.getSType(variable.type));
-	}
-
-	override public function build(key : String) : TExpr {
-		return {
-				p : null,
-				t : TVoid,
-				e : TBinop(OpAssign, {
-					e: TVar(variable),
-					p: null,
-					t: variable.type
-				}, input.getVar(variable.type))
-			};
-
-	}
+	/*override public function checkValidityInput(key : String, type : hxsl.Ast.Type) : Bool {
+		return ShaderType.checkConversion(type, variable.type);
+	}*/
+
+	// override public function build(key : String) : TExpr {
+	// 	return {
+	// 			p : null,
+	// 			t : TVoid,
+	// 			e : TBinop(OpAssign, {
+	// 				e: TVar(variable),
+	// 				p: null,
+	// 				t: variable.type
+	// 			}, input.getVar(variable.type))
+	// 		};
+
+	// }
 
 	static var availableOutputs = [
 		{

+ 8 - 13
hrt/shgraph/nodes/Abs.hx

@@ -6,19 +6,14 @@ using hxsl.Ast;
 @description("The output is the result of |A|")
 @width(80)
 @group("Math")
-class Abs extends ShaderFunction {
+class Abs extends ShaderNodeHxsl {
 
-	@input("A") var a = SType.Number;
-
-	public function new() {
-		super(Abs);
-	}
-
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	static var SRC = {
+		@sginput var a : Vec4;
+		@sgoutput var output : Vec4;
+		function fragment() {
+			output = abs(a);
+		}
+	};
 
 }

+ 8 - 13
hrt/shgraph/nodes/Acos.hx

@@ -6,19 +6,14 @@ using hxsl.Ast;
 @description("The output is the arc cosinus of A")
 @width(80)
 @group("Math")
-class Acos extends ShaderFunction {
+class Acos extends ShaderNodeHxsl {
 
-	@input("A") var a = SType.Float;
-
-	public function new() {
-		super(Acos);
-	}
-
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	static var SRC = {
+		@sginput var a : Vec4;
+		@sgoutput var output : Vec4;
+		function fragment() {
+			output = acos(a);
+		}
+	};
 
 }

+ 0 - 4
hrt/shgraph/nodes/Add.hx

@@ -8,10 +8,6 @@ using hxsl.Ast;
 @group("Operation")
 class Add extends Operation {
 
-	public function new() {
-		super(OpAdd);
-	}
-
 	static var SRC = {
 		@sginput var a : Vec4;
 		@sginput var b : Vec4;

+ 8 - 13
hrt/shgraph/nodes/Asin.hx

@@ -6,19 +6,14 @@ using hxsl.Ast;
 @description("The output is the arc sinus of A")
 @width(80)
 @group("Math")
-class Asin extends ShaderFunction {
+class Asin extends ShaderNodeHxsl {
 
-	@input("A") var a = SType.Float;
-
-	public function new() {
-		super(Asin);
-	}
-
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	static var SRC = {
+		@sginput var a : Vec4;
+		@sgoutput var output : Vec4;
+		function fragment() {
+			output = asin(a);
+		}
+	};
 
 }

+ 8 - 14
hrt/shgraph/nodes/Atan.hx

@@ -6,19 +6,13 @@ using hxsl.Ast;
 @description("The output is the arc tangent of A")
 @width(80)
 @group("Math")
-class Atan extends ShaderFunction {
-
-	@input("A") var a = SType.Float;
-
-	public function new() {
-		super(Atan);
-	}
-
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+class Atan extends ShaderNodeHxsl {
 
+	static var SRC = {
+		@sginput var a : Vec4;
+		@sgoutput var output : Vec4;
+		function fragment() {
+			output = atan(a);
+		}
+	};
 }

+ 8 - 14
hrt/shgraph/nodes/Ceil.hx

@@ -6,19 +6,13 @@ using hxsl.Ast;
 @description("The nearest integer greater than or equal to X")
 @width(80)
 @group("Math")
-class Ceil extends ShaderFunction {
-
-	@input("x") var x = SType.Number;
-
-	public function new() {
-		super(Ceil);
-	}
-
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+class Ceil extends ShaderNodeHxsl {
 
+	static var SRC = {
+		@sginput var a : Vec4;
+		@sgoutput var output : Vec4;
+		function fragment() {
+			output = ceil(a);
+		}
+	};
 }

+ 12 - 12
hrt/shgraph/nodes/Clamp.hx

@@ -8,18 +8,18 @@ using hxsl.Ast;
 @group("Math")
 class Clamp extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
-	@input("Min", true) var min = SType.Number;
-	@input("Max", true) var max = SType.Number;
+// 	@input("X") var x = SType.Number;
+// 	@input("Min", true) var min = SType.Number;
+// 	@input("Max", true) var max = SType.Number;
 
-	public function new() {
-		super(Clamp);
-	}
+// 	public function new() {
+// 		super(Clamp);
+// 	}
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+// 	override public function computeOutputs() {
+// 		if (x != null && !x.isEmpty())
+// 			addOutput("output", x.getType());
+// 		else
+// 			removeOutput("output");
+// 	}
 }

+ 3 - 3
hrt/shgraph/nodes/Color.hx

@@ -14,9 +14,9 @@ class Color extends ShaderConst {
 	@prop() var b : Float = 0;
 	@prop() var a : Float = 1;
 
-	override public function computeOutputs() {
-		addOutput("output", TVec(4, VFloat));
-	}
+	// override public function computeOutputs() {
+	// 	addOutput("output", TVec(4, VFloat));
+	// }
 
 	// override public function getOutputTExpr(key : String) : TExpr {
 	// 	return {

+ 4 - 4
hrt/shgraph/nodes/Combine.hx

@@ -10,10 +10,10 @@ using hxsl.Ast;
 @group("Channel")
 class Combine extends ShaderNode {
 
-	@input("R", false, false) var r = SType.Float;
-	@input("G", false, false) var g = SType.Float;
-	@input("B", false, false) var b = SType.Float;
-	@input("A", false, false) var a = SType.Float;
+	// @input("R", false, false) var r = SType.Float;
+	// @input("G", false, false) var g = SType.Float;
+	// @input("B", false, false) var b = SType.Float;
+	// @input("A", false, false) var a = SType.Float;
 
 
 	var components = [X, Y, Z, W];

+ 2 - 2
hrt/shgraph/nodes/CombineAlpha.hx

@@ -10,8 +10,8 @@ using hxsl.Ast;
 @group("Channel")
 class CombineAlpha extends ShaderNode {
 
-	@input("RGB") var rgb = SType.Vec3;
-	@input("A", true) var a = SType.Float;
+	// @input("RGB") var rgb = SType.Vec3;
+	// @input("A", true) var a = SType.Float;
 
 
 	// override public function computeOutputs() {

+ 56 - 56
hrt/shgraph/nodes/Cond.hx

@@ -7,22 +7,22 @@ using hxsl.Ast;
 @group("Condition")
 class Cond extends ShaderNode {
 
-	@input("Left") var leftVar = SType.Number;
-	@input("Right") var rightVar = SType.Number;
+	// @input("Left") var leftVar = SType.Number;
+	// @input("Right") var rightVar = SType.Number;
 
 
-	@prop() var condition : Binop;
+	// @prop() var condition : Binop;
 
-	override public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
+	// override public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
 
-		if (key == "leftVar" && rightVar != null && !rightVar.isEmpty())
-			return ShaderType.checkCompatibilities(type, ShaderType.getSType(rightVar.getType()));
+	// 	if (key == "leftVar" && rightVar != null && !rightVar.isEmpty())
+	// 		return ShaderType.checkCompatibilities(type, ShaderType.getSType(rightVar.getType()));
 
-		if (key == "rightVar" && leftVar != null && !leftVar.isEmpty())
-			return ShaderType.checkCompatibilities(type, ShaderType.getSType(leftVar.getType()));
+	// 	if (key == "rightVar" && leftVar != null && !leftVar.isEmpty())
+	// 		return ShaderType.checkCompatibilities(type, ShaderType.getSType(leftVar.getType()));
 
-		return true;
-	}
+	// 	return true;
+	// }
 
 	// override public function computeOutputs() {
 	// 	if (leftVar != null && !leftVar.isEmpty() && rightVar != null && !rightVar.isEmpty()) {
@@ -55,51 +55,51 @@ class Cond extends ShaderNode {
 	// 		};
 	// }
 
-	var availableConditions = [OpEq, OpNotEq, OpGt, OpGte, OpLt, OpLte, OpAnd, OpOr];
-	var conditionStrings 	= ["==", "!=",    ">",  ">=",  "<",  "<=",  "AND", "OR"];
-
-	override public function loadProperties(props : Dynamic) {
-		this.condition = std.Type.createEnum(Binop, Reflect.field(props, "Condition"));
-	}
-
-	override public function saveProperties() : Dynamic {
-		if (this.condition == null)
-			this.condition = availableConditions[0];
-		var properties = {
-			condition: this.condition.getName()
-		};
-
-		return properties;
-	}
-
-	#if editor
-	override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
-		var elements = super.getPropertiesHTML(width);
-		var element = new hide.Element('<div style="width: ${width * 0.8}px; height: 40px"></div>');
-		element.append('<span>Condition</span>');
-		element.append(new hide.Element('<select id="condition"></select>'));
-
-		if (this.condition == null) {
-			this.condition = availableConditions[0];
-		}
-		var input = element.children("select");
-		var indexOption = 0;
-		for (c in conditionStrings) {
-			input.append(new hide.Element('<option value="${indexOption}">${c}</option>'));
-			if (this.condition == availableConditions[indexOption]) {
-				input.val(indexOption);
-			}
-			indexOption++;
-		}
-		input.on("change", function(e) {
-			var value = input.val();
-			this.condition = availableConditions[value];
-		});
-
-		elements.push(element);
-
-		return elements;
-	}
-	#end
+	// var availableConditions = [OpEq, OpNotEq, OpGt, OpGte, OpLt, OpLte, OpAnd, OpOr];
+	// var conditionStrings 	= ["==", "!=",    ">",  ">=",  "<",  "<=",  "AND", "OR"];
+
+	// override public function loadProperties(props : Dynamic) {
+	// 	this.condition = std.Type.createEnum(Binop, Reflect.field(props, "Condition"));
+	// }
+
+	// override public function saveProperties() : Dynamic {
+	// 	if (this.condition == null)
+	// 		this.condition = availableConditions[0];
+	// 	var properties = {
+	// 		condition: this.condition.getName()
+	// 	};
+
+	// 	return properties;
+	// }
+
+	// #if editor
+	// override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
+	// 	var elements = super.getPropertiesHTML(width);
+	// 	var element = new hide.Element('<div style="width: ${width * 0.8}px; height: 40px"></div>');
+	// 	element.append('<span>Condition</span>');
+	// 	element.append(new hide.Element('<select id="condition"></select>'));
+
+	// 	if (this.condition == null) {
+	// 		this.condition = availableConditions[0];
+	// 	}
+	// 	var input = element.children("select");
+	// 	var indexOption = 0;
+	// 	for (c in conditionStrings) {
+	// 		input.append(new hide.Element('<option value="${indexOption}">${c}</option>'));
+	// 		if (this.condition == availableConditions[indexOption]) {
+	// 			input.val(indexOption);
+	// 		}
+	// 		indexOption++;
+	// 	}
+	// 	input.on("change", function(e) {
+	// 		var value = input.val();
+	// 		this.condition = availableConditions[value];
+	// 	});
+
+	// 	elements.push(element);
+
+	// 	return elements;
+	// }
+	// #end
 
 }

+ 10 - 10
hrt/shgraph/nodes/Cos.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Cos extends ShaderFunction {
 
-	@input("A") var a = SType.Float;
+	// @input("A") var a = SType.Float;
 
-	public function new() {
-		super(Cos);
-	}
+	// public function new() {
+	// 	super(Cos);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 15 - 15
hrt/shgraph/nodes/Cross.hx

@@ -8,21 +8,21 @@ using hxsl.Ast;
 @group("Math")
 class Cross extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Cross);
-	}
+	// public function new() {
+	// 	super(Cross);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty() && b != null && !b.isEmpty())
-			addOutput("output", a.getVar(b.getType()).t);
-		else if (a != null && !a.isEmpty() )
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty() && b != null && !b.isEmpty())
+	// 		addOutput("output", a.getVar(b.getType()).t);
+	// 	else if (a != null && !a.isEmpty() )
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 }

+ 3 - 3
hrt/shgraph/nodes/Divide.hx

@@ -8,8 +8,8 @@ using hxsl.Ast;
 @group("Operation")
 class Divide extends Operation {
 
-	public function new() {
-		super(OpDiv);
-	}
+	// public function new() {
+	// 	super(OpDiv);
+	// }
 
 }

+ 8 - 8
hrt/shgraph/nodes/Dot.hx

@@ -8,14 +8,14 @@ using hxsl.Ast;
 @group("Math")
 class Dot extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Dot);
-	}
+	// public function new() {
+	// 	super(Dot);
+	// }
 
-	override public function computeOutputs() {
-		addOutput("output", TFloat);
-	}
+	// override public function computeOutputs() {
+	// 	addOutput("output", TFloat);
+	// }
 }

+ 11 - 11
hrt/shgraph/nodes/Exp.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Exp extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
-	@input("P", true) var p = SType.Number;
+	// @input("X") var x = SType.Number;
+	// @input("P", true) var p = SType.Number;
 
-	public function new() {
-		super(Exp);
-	}
+	// public function new() {
+	// 	super(Exp);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 }

+ 38 - 38
hrt/shgraph/nodes/FloatConst.hx

@@ -10,12 +10,12 @@ using hxsl.Ast;
 class FloatConst extends ShaderConst {
 
 
-	@prop() var value : Float = 0.;
+	// @prop() var value : Float = 0.;
 
-	public function new(?value : Float) {
-		if (value != null)
-			this.value = value;
-	}
+	// public function new(?value : Float) {
+	// 	if (value != null)
+	// 		this.value = value;
+	// }
 
 	// override public function getOutputTExpr(key : String) : TExpr {
 	// 	return {
@@ -25,38 +25,38 @@ class FloatConst extends ShaderConst {
 	// 			};
 	// }
 
-	override public function build(key : String) : TExpr {
-		return null;
-	}
-
-	#if editor
-	override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
-		var elements = super.getPropertiesHTML(width);
-		var element = new hide.Element('<div style="width: 75px; height: 30px"></div>');
-		element.append(new hide.Element('<input type="text" id="value" style="width: ${width*0.5}px" value="${value}" />'));
-
-		var input = element.children("input");
-		input.on("keydown", function(e) {
-			e.stopPropagation();
-		});
-		input.on("mousedown", function(e) {
-			e.stopPropagation();
-		});
-		input.on("change", function(e) {
-			var tmpValue = Std.parseFloat(input.val());
-			if (Math.isNaN(tmpValue) ) {
-				input.addClass("error");
-			} else {
-				this.value = tmpValue;
-				input.val(tmpValue);
-				input.removeClass("error");
-			}
-		});
-
-		elements.push(element);
-
-		return elements;
-	}
-	#end
+	// override public function build(key : String) : TExpr {
+	// 	return null;
+	// }
+
+	// #if editor
+	// override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
+	// 	var elements = super.getPropertiesHTML(width);
+	// 	var element = new hide.Element('<div style="width: 75px; height: 30px"></div>');
+	// 	element.append(new hide.Element('<input type="text" id="value" style="width: ${width*0.5}px" value="${value}" />'));
+
+	// 	var input = element.children("input");
+	// 	input.on("keydown", function(e) {
+	// 		e.stopPropagation();
+	// 	});
+	// 	input.on("mousedown", function(e) {
+	// 		e.stopPropagation();
+	// 	});
+	// 	input.on("change", function(e) {
+	// 		var tmpValue = Std.parseFloat(input.val());
+	// 		if (Math.isNaN(tmpValue) ) {
+	// 			input.addClass("error");
+	// 		} else {
+	// 			this.value = tmpValue;
+	// 			input.val(tmpValue);
+	// 			input.removeClass("error");
+	// 		}
+	// 	});
+
+	// 	elements.push(element);
+
+	// 	return elements;
+	// }
+	// #end
 
 }

+ 10 - 10
hrt/shgraph/nodes/Floor.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Floor extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
+	// @input("X") var x = SType.Number;
 
-	public function new() {
-		super(Floor);
-	}
+	// public function new() {
+	// 	super(Floor);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 10 - 10
hrt/shgraph/nodes/Fract.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Fract extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
+	// @input("X") var x = SType.Number;
 
-	public function new() {
-		super(Fract);
-	}
+	// public function new() {
+	// 	super(Fract);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 43 - 43
hrt/shgraph/nodes/IfCondition.hx

@@ -7,49 +7,49 @@ using hxsl.Ast;
 @group("Condition")
 class IfCondition extends ShaderNode {
 
-	@input("Condition") var condition = SType.Bool;
-	@input("True") var trueVar = SType.Variant;
-	@input("False") var falseVar = SType.Variant;
-
-
-	override public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
-
-		if (key == "trueVar" && falseVar != null && !falseVar.isEmpty())
-			return ShaderType.checkCompatibilities(type, ShaderType.getSType(falseVar.getType()));
-
-		if (key == "falseVar" && trueVar != null && !trueVar.isEmpty())
-			return ShaderType.checkCompatibilities(type, ShaderType.getSType(trueVar.getType()));
-
-		return true;
-	}
-
-	override public function computeOutputs() {
-		if (trueVar != null && !trueVar.isEmpty() && falseVar != null && !falseVar.isEmpty())
-			addOutput("output", trueVar.getVar(falseVar.getType()).t);
-		else if (trueVar != null && !trueVar.isEmpty())
-			addOutput("output", trueVar.getType());
-		else if (falseVar != null && !falseVar.isEmpty())
-			addOutput("output", falseVar.getType());
-		else
-			removeOutput("output");
-	}
-
-	// override public function build(key : String) : TExpr {
-	// 	return {
-	// 		p : null,
-	// 		t: output.type,
-	// 		e : TBinop(OpAssign, {
-	// 				e: TVar(output),
-	// 				p: null,
-	// 				t: output.type
-	// 			}, {
-	// 			e: TIf( condition.getVar(),
-	// 					trueVar.getVar(falseVar.getType()),
-	// 					falseVar.getVar(trueVar.getType())),
-	// 			p: null,
-	// 			t: output.type
-	// 		})
-	// 	};
+	// @input("Condition") var condition = SType.Bool;
+	// @input("True") var trueVar = SType.Variant;
+	// @input("False") var falseVar = SType.Variant;
+
+
+	// override public function checkValidityInput(key : String, type : ShaderType.SType) : Bool {
+
+	// 	if (key == "trueVar" && falseVar != null && !falseVar.isEmpty())
+	// 		return ShaderType.checkCompatibilities(type, ShaderType.getSType(falseVar.getType()));
+
+	// 	if (key == "falseVar" && trueVar != null && !trueVar.isEmpty())
+	// 		return ShaderType.checkCompatibilities(type, ShaderType.getSType(trueVar.getType()));
+
+	// 	return true;
+	// }
+
+	// override public function computeOutputs() {
+	// 	if (trueVar != null && !trueVar.isEmpty() && falseVar != null && !falseVar.isEmpty())
+	// 		addOutput("output", trueVar.getVar(falseVar.getType()).t);
+	// 	else if (trueVar != null && !trueVar.isEmpty())
+	// 		addOutput("output", trueVar.getType());
+	// 	else if (falseVar != null && !falseVar.isEmpty())
+	// 		addOutput("output", falseVar.getType());
+	// 	else
+	// 		removeOutput("output");
 	// }
 
+	// // override public function build(key : String) : TExpr {
+	// // 	return {
+	// // 		p : null,
+	// // 		t: output.type,
+	// // 		e : TBinop(OpAssign, {
+	// // 				e: TVar(output),
+	// // 				p: null,
+	// // 				t: output.type
+	// // 			}, {
+	// // 			e: TIf( condition.getVar(),
+	// // 					trueVar.getVar(falseVar.getType()),
+	// // 					falseVar.getVar(trueVar.getType())),
+	// // 			p: null,
+	// // 			t: output.type
+	// // 		})
+	// // 	};
+	// // }
+
 }

+ 10 - 10
hrt/shgraph/nodes/Length.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Length extends ShaderFunction {
 
-	@input("A") var a = SType.Vec2;
+	// @input("A") var a = SType.Vec2;
 
-	public function new() {
-		super(Length);
-	}
+	// public function new() {
+	// 	super(Length);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", TFloat);
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", TFloat);
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 11 - 11
hrt/shgraph/nodes/Log.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Log extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
-	@input("P", true) var p = SType.Number;
+	// @input("X") var x = SType.Number;
+	// @input("P", true) var p = SType.Number;
 
-	public function new() {
-		super(Log);
-	}
+	// public function new() {
+	// 	super(Log);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 }

+ 13 - 13
hrt/shgraph/nodes/Max.hx

@@ -8,21 +8,21 @@ using hxsl.Ast;
 @group("Math")
 class Max extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Max);
-	}
+	// public function new() {
+	// 	super(Max);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 
 }

+ 13 - 13
hrt/shgraph/nodes/Maximum.hx

@@ -8,21 +8,21 @@ using hxsl.Ast;
 @group("Math")
 class Maximum extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Max);
-	}
+	// public function new() {
+	// 	super(Max);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 
 }

+ 13 - 13
hrt/shgraph/nodes/Min.hx

@@ -8,20 +8,20 @@ using hxsl.Ast;
 @group("Math")
 class Min extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Min);
-	}
+	// public function new() {
+	// 	super(Min);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 13 - 13
hrt/shgraph/nodes/Minimum.hx

@@ -8,20 +8,20 @@ using hxsl.Ast;
 @group("Math")
 class Minimum extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
-	@input("B") var b = SType.Number;
+	// @input("A") var a = SType.Number;
+	// @input("B") var b = SType.Number;
 
-	public function new() {
-		super(Min);
-	}
+	// public function new() {
+	// 	super(Min);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else if (b != null && !b.isEmpty())
-			addOutput("output", b.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else if (b != null && !b.isEmpty())
+	// 		addOutput("output", b.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 16 - 16
hrt/shgraph/nodes/Mix.hx

@@ -8,23 +8,23 @@ using hxsl.Ast;
 @group("Math")
 class Mix extends ShaderFunction {
 
-	@input("A") var x = SType.Number;
-	@input("B") var y = SType.Number;
-	@input("Mix") var a = SType.Number;
+	// @input("A") var x = SType.Number;
+	// @input("B") var y = SType.Number;
+	// @input("Mix") var a = SType.Number;
 
-	public function new() {
-		super(Mix);
-	}
+	// public function new() {
+	// 	super(Mix);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty() && y != null && !y.isEmpty())
-			addOutput("output", x.getVar(y.getType()).t);
-		else if (x != null && !x.isEmpty() )
-			addOutput("output", x.getType());
-		else if (y != null && !y.isEmpty())
-			addOutput("output", y.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty() && y != null && !y.isEmpty())
+	// 		addOutput("output", x.getVar(y.getType()).t);
+	// 	else if (x != null && !x.isEmpty() )
+	// 		addOutput("output", x.getType());
+	// 	else if (y != null && !y.isEmpty())
+	// 		addOutput("output", y.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 11 - 11
hrt/shgraph/nodes/Mod.hx

@@ -8,18 +8,18 @@ using hxsl.Ast;
 @group("Math")
 class Mod extends ShaderFunction {
 
-	@input("X") var x = SType.Variant;
-	@input("Mod", true) var mod = SType.Float;
+	// @input("X") var x = SType.Variant;
+	// @input("Mod", true) var mod = SType.Float;
 
-	public function new() {
-		super(Mod);
-	}
+	// public function new() {
+	// 	super(Mod);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 3 - 3
hrt/shgraph/nodes/Multiply.hx

@@ -8,9 +8,9 @@ using hxsl.Ast;
 @group("Operation")
 class Multiply extends Operation {
 
-	public function new() {
-		super(OpMult);
-	}
+	// public function new() {
+	// 	super(OpMult);
+	// }
 
 	static var SRC = {
 		@sginput var a : Vec4;

+ 10 - 10
hrt/shgraph/nodes/Normalize.hx

@@ -8,16 +8,16 @@ using hxsl.Ast;
 @group("Math")
 class Normalize extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
+	// @input("X") var x = SType.Number;
 
-	public function new() {
-		super(Normalize);
-	}
+	// public function new() {
+	// 	super(Normalize);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 }

+ 11 - 11
hrt/shgraph/nodes/Pow.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Pow extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
-	@input("P", true) var p = SType.Number;
+	// @input("X") var x = SType.Number;
+	// @input("P", true) var p = SType.Number;
 
-	public function new() {
-		super(Pow);
-	}
+	// public function new() {
+	// 	super(Pow);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 }

+ 149 - 149
hrt/shgraph/nodes/Preview.hx

@@ -11,153 +11,153 @@ using hxsl.Ast;
 @noheader()
 class Preview extends ShaderNode {
 
-	@input("Input") var input = SType.Vec4;
-
-	public var variable : TVar;
-
-	override public function build(key : String) : TExpr {
-
-		return {
-				p : null,
-				t : TVoid,
-				e : TBinop(OpAssign, {
-					e: TVar(variable),
-					p: null,
-					t: variable.type
-				}, input.getVar(variable.type))
-			};
-
-	}
-
-	#if editor
-	public var shaderGraph : ShaderGraph;
-	var nodePreview : js.jquery.JQuery;
-	var cube : Mesh;
-	var scene : hide.comp.Scene;
-	var currentShaderPreview : hxsl.DynamicShader;
-	var currentShaderDef : hrt.prefab.ContextShared.ShaderDef;
-	public var config : hide.Config;
-
-	override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
-		var elements = super.getPropertiesHTML(width);
-		for (c in ShaderNode.availableVariables) {
-			if (c.name == "pixelColor") {
-				this.variable = c;
-			}
-		}
-
-		if (this.variable == null) {
-			throw ShaderException.t("The preview is not available", this.id);
-		}
-		var element = new hide.Element('<div style="width: 100px; height: 100px"><div class="preview-parent" top="-10px" ><div class="node-preview" style="height: 100px" ></div></div></div>');
-		nodePreview = element.find(".node-preview");
-		scene = new hide.comp.Scene(config, null, nodePreview);
-
-		scene.onReady = function() {
-			var prim = new h3d.prim.Cube();
-			prim.addUVs();
-			prim.addNormals();
-			cube = new Mesh(prim, scene.s3d);
-			scene.s3d.camera.pos = new h3d.Vector(0.5, 3.4, 0.5);
-			scene.s3d.camera.target = new h3d.Vector(0.5, 0.5, 0.5);
-			var light = new h3d.scene.pbr.DirLight(scene.s3d.camera.target.sub(scene.s3d.camera.pos), scene.s3d);
-			light.setPosition(scene.s3d.camera.pos.x, scene.s3d.camera.pos.y, scene.s3d.camera.pos.z);
-			scene.s3d.camera.zoom = 1;
-			scene.init();
-			onMove();
-			computeOutputs();
-		};
-
-		elements.push(element);
-		return elements;
-	}
-
-	public function onMove(?x : Float, ?y : Float, zoom : Float = 1.) {
-		// var top : Float;
-		// var left : Float;
-		// var parent = nodePreview.parent();
-		// if (x != null && y != null) {
-		// 	left = x;
-		// 	top = y;
-		// } else {
-		// 	var offsetWindow = nodePreview.closest(".heaps-scene").offset();
-		// 	var offset = nodePreview.closest("foreignObject").offset();
-		// 	if (offsetWindow == null || offset == null) return;
-		// 	top = offset.top - offsetWindow.top - 32;
-		// 	left = offset.left - offsetWindow.left;
-		// }
-		// nodePreview.closest(".prop-group").attr("transform", 'translate(0, -5)');
-		nodePreview.closest(".properties-group").children().first().css("fill", "#000");
-		// parent.css("top", top/zoom + 17);
-		// parent.css("left", left/zoom);
-		// parent.css("zoom", zoom);
-	}
-
-	function onResize() {
-		if( cube == null ) return;
-
-	}
-
-	override public function computeOutputs() {
-		if (currentShaderPreview != null) {
-			for (m in cube.getMaterials()) {
-				m.mainPass.removeShader(currentShaderPreview);
-			}
-			currentShaderPreview = null;
-		}
-
-		if (scene == null || input == null || input.isEmpty()) return;
-
-		if (@:privateAccess scene.window == null)
-			return;
-		scene.setCurrent();
-
-		var shader : hxsl.DynamicShader = null;
-		try {
-			var shaderGraphDef = shaderGraph.compile2(/*this*/);
-			shader = new hxsl.DynamicShader(shaderGraphDef.shader);
-			for (init in shaderGraphDef.inits) {
-				setParamValue(init.variable, init.value, shader);
-			}
-			for (m in cube.getMaterials()) {
-				m.mainPass.addShader(shader);
-			}
-			currentShaderPreview = shader;
-			currentShaderDef = shaderGraphDef;
-		} catch(e : Dynamic) {
-			if (shader != null) {
-				for (m in cube.getMaterials()) {
-					m.mainPass.removeShader(shader);
-				}
-			}
-		}
-	}
-
-	public function setParamValueByName(varName : String, value : Dynamic) {
-		if (currentShaderDef == null) return;
-		for (init in currentShaderDef.inits) {
-			if (init.variable.name == varName) {
-				setParamValue(init.variable, value, currentShaderPreview);
-				return;
-			}
-		}
-	}
-
-	public function setParamValue(variable : TVar, value : Dynamic, shader : hxsl.DynamicShader) {
-		scene.setCurrent();
-		try {
-			switch (variable.type) {
-				case TSampler2D:
-					shader.setParamValue(variable, scene.loadTexture("", value));
-				case TVec(size, _):
-					shader.setParamValue(variable, h3d.Vector.fromArray(value));
-				default:
-					shader.setParamValue(variable, value);
-			}
-		} catch (e : Dynamic) {
-			// variable not used
-		}
-	}
-
-	#end
+	// @input("Input") var input = SType.Vec4;
+
+	// public var variable : TVar;
+
+	// override public function build(key : String) : TExpr {
+
+	// 	return {
+	// 			p : null,
+	// 			t : TVoid,
+	// 			e : TBinop(OpAssign, {
+	// 				e: TVar(variable),
+	// 				p: null,
+	// 				t: variable.type
+	// 			}, input.getVar(variable.type))
+	// 		};
+
+	// }
+
+	// #if editor
+	// public var shaderGraph : ShaderGraph;
+	// var nodePreview : js.jquery.JQuery;
+	// var cube : Mesh;
+	// var scene : hide.comp.Scene;
+	// var currentShaderPreview : hxsl.DynamicShader;
+	// var currentShaderDef : hrt.prefab.ContextShared.ShaderDef;
+	// public var config : hide.Config;
+
+	// override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
+	// 	var elements = super.getPropertiesHTML(width);
+	// 	for (c in ShaderNode.availableVariables) {
+	// 		if (c.name == "pixelColor") {
+	// 			this.variable = c;
+	// 		}
+	// 	}
+
+	// 	if (this.variable == null) {
+	// 		throw ShaderException.t("The preview is not available", this.id);
+	// 	}
+	// 	var element = new hide.Element('<div style="width: 100px; height: 100px"><div class="preview-parent" top="-10px" ><div class="node-preview" style="height: 100px" ></div></div></div>');
+	// 	nodePreview = element.find(".node-preview");
+	// 	scene = new hide.comp.Scene(config, null, nodePreview);
+
+	// 	scene.onReady = function() {
+	// 		var prim = new h3d.prim.Cube();
+	// 		prim.addUVs();
+	// 		prim.addNormals();
+	// 		cube = new Mesh(prim, scene.s3d);
+	// 		scene.s3d.camera.pos = new h3d.Vector(0.5, 3.4, 0.5);
+	// 		scene.s3d.camera.target = new h3d.Vector(0.5, 0.5, 0.5);
+	// 		var light = new h3d.scene.pbr.DirLight(scene.s3d.camera.target.sub(scene.s3d.camera.pos), scene.s3d);
+	// 		light.setPosition(scene.s3d.camera.pos.x, scene.s3d.camera.pos.y, scene.s3d.camera.pos.z);
+	// 		scene.s3d.camera.zoom = 1;
+	// 		scene.init();
+	// 		onMove();
+	// 		computeOutputs();
+	// 	};
+
+	// 	elements.push(element);
+	// 	return elements;
+	// }
+
+	// public function onMove(?x : Float, ?y : Float, zoom : Float = 1.) {
+	// 	// var top : Float;
+	// 	// var left : Float;
+	// 	// var parent = nodePreview.parent();
+	// 	// if (x != null && y != null) {
+	// 	// 	left = x;
+	// 	// 	top = y;
+	// 	// } else {
+	// 	// 	var offsetWindow = nodePreview.closest(".heaps-scene").offset();
+	// 	// 	var offset = nodePreview.closest("foreignObject").offset();
+	// 	// 	if (offsetWindow == null || offset == null) return;
+	// 	// 	top = offset.top - offsetWindow.top - 32;
+	// 	// 	left = offset.left - offsetWindow.left;
+	// 	// }
+	// 	// nodePreview.closest(".prop-group").attr("transform", 'translate(0, -5)');
+	// 	nodePreview.closest(".properties-group").children().first().css("fill", "#000");
+	// 	// parent.css("top", top/zoom + 17);
+	// 	// parent.css("left", left/zoom);
+	// 	// parent.css("zoom", zoom);
+	// }
+
+	// function onResize() {
+	// 	if( cube == null ) return;
+
+	// }
+
+	// override public function computeOutputs() {
+	// 	if (currentShaderPreview != null) {
+	// 		for (m in cube.getMaterials()) {
+	// 			m.mainPass.removeShader(currentShaderPreview);
+	// 		}
+	// 		currentShaderPreview = null;
+	// 	}
+
+	// 	if (scene == null || input == null || input.isEmpty()) return;
+
+	// 	if (@:privateAccess scene.window == null)
+	// 		return;
+	// 	scene.setCurrent();
+
+	// 	var shader : hxsl.DynamicShader = null;
+	// 	try {
+	// 		var shaderGraphDef = shaderGraph.compile2(/*this*/);
+	// 		shader = new hxsl.DynamicShader(shaderGraphDef.shader);
+	// 		for (init in shaderGraphDef.inits) {
+	// 			setParamValue(init.variable, init.value, shader);
+	// 		}
+	// 		for (m in cube.getMaterials()) {
+	// 			m.mainPass.addShader(shader);
+	// 		}
+	// 		currentShaderPreview = shader;
+	// 		currentShaderDef = shaderGraphDef;
+	// 	} catch(e : Dynamic) {
+	// 		if (shader != null) {
+	// 			for (m in cube.getMaterials()) {
+	// 				m.mainPass.removeShader(shader);
+	// 			}
+	// 		}
+	// 	}
+	// }
+
+	// public function setParamValueByName(varName : String, value : Dynamic) {
+	// 	if (currentShaderDef == null) return;
+	// 	for (init in currentShaderDef.inits) {
+	// 		if (init.variable.name == varName) {
+	// 			setParamValue(init.variable, value, currentShaderPreview);
+	// 			return;
+	// 		}
+	// 	}
+	// }
+
+	// public function setParamValue(variable : TVar, value : Dynamic, shader : hxsl.DynamicShader) {
+	// 	scene.setCurrent();
+	// 	try {
+	// 		switch (variable.type) {
+	// 			case TSampler2D:
+	// 				shader.setParamValue(variable, scene.loadTexture("", value));
+	// 			case TVec(size, _):
+	// 				shader.setParamValue(variable, h3d.Vector.fromArray(value));
+	// 			default:
+	// 				shader.setParamValue(variable, value);
+	// 		}
+	// 	} catch (e : Dynamic) {
+	// 		// variable not used
+	// 	}
+	// }
+
+	// #end
 }

+ 11 - 11
hrt/shgraph/nodes/Sampler.hx

@@ -7,21 +7,21 @@ using hxsl.Ast;
 @group("Property")
 class Sampler extends ShaderNode {
 
-	@input("Texture") var texture = SType.Sampler;
-	@input("UV") var uv = SType.Vec2;
+	// @input("Texture") var texture = SType.Sampler;
+	// @input("UV") var uv = SType.Vec2;
 
 
 
-	var components = [X, Y, Z, W];
-	var componentsString = ["r", "g", "b", "a"];
+	// var components = [X, Y, Z, W];
+	// var componentsString = ["r", "g", "b", "a"];
 
-	override public function computeOutputs() {
-		addOutput("rgba", TVec(4, VFloat));
-		addOutput("r", TFloat);
-		addOutput("g", TFloat);
-		addOutput("b", TFloat);
-		addOutput("a", TFloat);
-	}
+	// override public function computeOutputs() {
+	// 	addOutput("rgba", TVec(4, VFloat));
+	// 	addOutput("r", TFloat);
+	// 	addOutput("g", TFloat);
+	// 	addOutput("b", TFloat);
+	// 	addOutput("a", TFloat);
+	// }
 
 	// override public function build(key : String) : TExpr {
 	// 	if (key == "rgba") {

+ 10 - 10
hrt/shgraph/nodes/Saturate.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Saturate extends ShaderFunction {
 
-	@input("X") var x = SType.Number;
+	// @input("X") var x = SType.Number;
 
-	public function new() {
-		super(Saturate);
-	}
+	// public function new() {
+	// 	super(Saturate);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty())
-			addOutput("output", x.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty())
+	// 		addOutput("output", x.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 10 - 10
hrt/shgraph/nodes/Sin.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Sin extends ShaderFunction {
 
-	@input("A") var a = SType.Float;
+	// @input("A") var a = SType.Float;
 
-	public function new() {
-		super(Sin);
-	}
+	// public function new() {
+	// 	super(Sin);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 16 - 16
hrt/shgraph/nodes/SmoothStep.hx

@@ -8,23 +8,23 @@ using hxsl.Ast;
 @group("Math")
 class SmoothStep extends ShaderFunction {
 
-	@input("A") var x = SType.Number;
-	@input("B") var y = SType.Number;
-	@input("Mix") var a = SType.Number;
+	// @input("A") var x = SType.Number;
+	// @input("B") var y = SType.Number;
+	// @input("Mix") var a = SType.Number;
 
-	public function new() {
-		super(Smoothstep);
-	}
+	// public function new() {
+	// 	super(Smoothstep);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty() && y != null && !y.isEmpty())
-			addOutput("output", x.getVar(y.getType()).t);
-		else if (x != null && !x.isEmpty() )
-			addOutput("output", x.getType());
-		else if (y != null && !y.isEmpty())
-			addOutput("output", y.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty() && y != null && !y.isEmpty())
+	// 		addOutput("output", x.getVar(y.getType()).t);
+	// 	else if (x != null && !x.isEmpty() )
+	// 		addOutput("output", x.getType());
+	// 	else if (y != null && !y.isEmpty())
+	// 		addOutput("output", y.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 9 - 9
hrt/shgraph/nodes/Split.hx

@@ -7,18 +7,18 @@ using hxsl.Ast;
 @group("Channel")
 class Split extends ShaderNode {
 
-	@input("RGBA") var input = SType.Vec4;
+	// @input("RGBA") var input = SType.Vec4;
 
 
-	var components = [X, Y, Z, W];
-	var componentsString = ["r", "g", "b", "a"];
+	// var components = [X, Y, Z, W];
+	// var componentsString = ["r", "g", "b", "a"];
 
-	override public function computeOutputs() {
-		addOutput("r", TFloat);
-		addOutput("g", TFloat);
-		addOutput("b", TFloat);
-		addOutput("a", TFloat);
-	}
+	// override public function computeOutputs() {
+	// 	addOutput("r", TFloat);
+	// 	addOutput("g", TFloat);
+	// 	addOutput("b", TFloat);
+	// 	addOutput("a", TFloat);
+	// }
 
 	// override public function build(key : String) : TExpr {
 	// 	var compIdx = componentsString.indexOf(key);

+ 10 - 10
hrt/shgraph/nodes/Sqrt.hx

@@ -9,17 +9,17 @@ using hxsl.Ast;
 @:keep
 class Sqrt extends ShaderFunction {
 
-	@input("A") var a = SType.Number;
+	// @input("A") var a = SType.Number;
 
-	public function new() {
-		super(Sqrt);
-	}
+	// public function new() {
+	// 	super(Sqrt);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 15 - 15
hrt/shgraph/nodes/Step.hx

@@ -8,22 +8,22 @@ using hxsl.Ast;
 @group("Math")
 class Step extends ShaderFunction {
 
-	@input("Edge") var edge = SType.Number;
-	@input("A") var x = SType.Number;
+	// @input("Edge") var edge = SType.Number;
+	// @input("A") var x = SType.Number;
 
-	public function new() {
-		super(Step);
-	}
+	// public function new() {
+	// 	super(Step);
+	// }
 
-	override public function computeOutputs() {
-		if (x != null && !x.isEmpty() && edge != null && !edge.isEmpty())
-			addOutput("output", edge.getVar(x.getType()).t);
-		else if (x != null && !x.isEmpty() )
-			addOutput("output", x.getType());
-		else if (edge != null && !edge.isEmpty())
-			addOutput("output", edge.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (x != null && !x.isEmpty() && edge != null && !edge.isEmpty())
+	// 		addOutput("output", edge.getVar(x.getType()).t);
+	// 	else if (x != null && !x.isEmpty() )
+	// 		addOutput("output", x.getType());
+	// 	else if (edge != null && !edge.isEmpty())
+	// 		addOutput("output", edge.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 5 - 5
hrt/shgraph/nodes/StripAlpha.hx

@@ -7,14 +7,14 @@ using hxsl.Ast;
 @group("Channel")
 class StripAlpha extends ShaderNode {
 
-	@input("RGBA") var input = SType.Vec4;
+	// @input("RGBA") var input = SType.Vec4;
 
 
 
-	override public function computeOutputs() {
-		addOutput("rgb", TVec(3, VFloat));
-		addOutput("a", TFloat);
-	}
+	// override public function computeOutputs() {
+	// 	addOutput("rgb", TVec(3, VFloat));
+	// 	addOutput("a", TFloat);
+	// }
 
 	// override public function build(key : String) : TExpr {
     //     if( key == "a" ) {

+ 0 - 8
hrt/shgraph/nodes/SubGraph.hx

@@ -129,14 +129,6 @@ class SubGraph extends ShaderNode {
 		}
 	}
 
-	override public function getInputInfo(key : String) : ShaderNode.InputInfo {
-		return inputsInfo.get(key);
-	}
-
-	override public function getInputInfoKeys() : Array<String> {
-		return inputInfoKeys;
-	}
-
 	// override public function getOutputInfo(key : String) : ShaderNode.OutputInfo {
 	// 	return outputsInfo.get(key);
 	// }

+ 3 - 3
hrt/shgraph/nodes/Subtract.hx

@@ -8,8 +8,8 @@ using hxsl.Ast;
 @group("Operation")
 class Subtract extends Operation {
 
-	public function new() {
-		super(OpSub);
-	}
+	// public function new() {
+	// 	super(OpSub);
+	// }
 
 }

+ 10 - 10
hrt/shgraph/nodes/Tan.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class Tan extends ShaderFunction {
 
-	@input("A") var a = SType.Float;
+	// @input("A") var a = SType.Float;
 
-	public function new() {
-		super(Tan);
-	}
+	// public function new() {
+	// 	super(Tan);
+	// }
 
-	override public function computeOutputs() {
-		if (a != null && !a.isEmpty())
-			addOutput("output", a.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (a != null && !a.isEmpty())
+	// 		addOutput("output", a.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 25 - 25
hrt/shgraph/nodes/Text.hx

@@ -10,30 +10,30 @@ using hxsl.Ast;
 @noheader()
 class Text extends ShaderNode {
 
-	@prop() var text : String = "";
-
-	override public function build(key : String) : TExpr {
-		return null;
-	}
-
-	#if editor
-	override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
-		var elements = super.getPropertiesHTML(width);
-		var element = new hide.Element('<div style="width: ${width-35}px; height: 35px"></div>');
-		element.append(new hide.Element('<input type="text" id="value" style="width: ${width-35}px; height: 22px; font-size: 16px;" placeholder="Name" value="${this.text}" />'));
-
-		var input = element.children("input");
-		input.on("keydown", function(e) {
-			e.stopPropagation();
-		});
-		input.on("change", function(e) {
-			this.text = input.val();
-		});
-
-		elements.push(element);
-
-		return elements;
-	}
-	#end
+	// @prop() var text : String = "";
+
+	// override public function build(key : String) : TExpr {
+	// 	return null;
+	// }
+
+	// #if editor
+	// override public function getPropertiesHTML(width : Float) : Array<hide.Element> {
+	// 	var elements = super.getPropertiesHTML(width);
+	// 	var element = new hide.Element('<div style="width: ${width-35}px; height: 35px"></div>');
+	// 	element.append(new hide.Element('<input type="text" id="value" style="width: ${width-35}px; height: 22px; font-size: 16px;" placeholder="Name" value="${this.text}" />'));
+
+	// 	var input = element.children("input");
+	// 	input.on("keydown", function(e) {
+	// 		e.stopPropagation();
+	// 	});
+	// 	input.on("change", function(e) {
+	// 		this.text = input.val();
+	// 	});
+
+	// 	elements.push(element);
+
+	// 	return elements;
+	// }
+	// #end
 
 }

+ 13 - 13
hrt/shgraph/nodes/UVScroll.hx

@@ -7,23 +7,23 @@ using hxsl.Ast;
 @group("Specials")
 class UVScroll extends ShaderNode {
 
-	@input("UV") var uv = SType.Vec2;
-	@input("USpeed", true) var uSpeed = SType.Number;
-	@input("VSpeed", true) var vSpeed = SType.Number;
+	// @input("UV") var uv = SType.Vec2;
+	// @input("USpeed", true) var uSpeed = SType.Number;
+	// @input("VSpeed", true) var vSpeed = SType.Number;
 
 
-	var operation : Binop;
+	// var operation : Binop;
 
-	public function new(operation : Binop) {
-		this.operation = operation;
-	}
+	// public function new(operation : Binop) {
+	// 	this.operation = operation;
+	// }
 
-	override public function computeOutputs() {
-		if (uv != null && !uv.isEmpty())
-			addOutput("output", uv.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (uv != null && !uv.isEmpty())
+	// 		addOutput("output", uv.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 	// override public function build(key : String) : TExpr {
 

+ 10 - 10
hrt/shgraph/nodes/UnpackNormal.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Channel")
 class UnpackNormal extends ShaderFunction {
 
-	@input("normal") var normal = SType.Vec4;
+	// @input("normal") var normal = SType.Vec4;
 
-	public function new() {
-		super(UnpackNormal);
-	}
+	// public function new() {
+	// 	super(UnpackNormal);
+	// }
 
-	override public function computeOutputs() {
-		if (normal != null && !normal.isEmpty())
-			addOutput("output", TVec(3, VFloat));
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (normal != null && !normal.isEmpty())
+	// 		addOutput("output", TVec(3, VFloat));
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }

+ 10 - 10
hrt/shgraph/nodes/UvToScreen.hx

@@ -8,17 +8,17 @@ using hxsl.Ast;
 @group("Math")
 class UvToScreen extends ShaderFunction {
 
-	@input("UV") var uv = SType.Vec2;
+	// @input("UV") var uv = SType.Vec2;
 
-	public function new() {
-		super(UvToScreen);
-	}
+	// public function new() {
+	// 	super(UvToScreen);
+	// }
 
-	override public function computeOutputs() {
-		if (uv != null && !uv.isEmpty())
-			addOutput("output", uv.getType());
-		else
-			removeOutput("output");
-	}
+	// override public function computeOutputs() {
+	// 	if (uv != null && !uv.isEmpty())
+	// 		addOutput("output", uv.getType());
+	// 	else
+	// 		removeOutput("output");
+	// }
 
 }