Browse Source

[shgraph] Fixed cond and ifCondition missing defaults

Clément Espeute 1 year ago
parent
commit
e22d3d5a1c
2 changed files with 4 additions and 4 deletions
  1. 2 2
      hrt/shgraph/nodes/Cond.hx
  2. 2 2
      hrt/shgraph/nodes/IfCondition.hx

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

@@ -17,8 +17,8 @@ class Cond extends ShaderNode {
 	override function getInputs() {
 		static var inputs : Array<ShaderNode.InputInfo> =
 			[
-				{name: "a", type: SgFloat(1)},
-				{name: "b", type: SgFloat(1)},
+				{name: "a", type: SgFloat(1), def: Const(0.0)},
+				{name: "b", type: SgFloat(1), def: Const(0.0)},
 			];
 		return inputs;
 	}

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

@@ -17,8 +17,8 @@ class IfCondition extends ShaderNode {
 		static var inputs : Array<ShaderNode.InputInfo> =
 		[
 			{name: "condition", type: SgBool},
-			{name: "true", type: SgGeneric(0, ConstraintFloat)},
-			{name: "false", type: SgGeneric(0, ConstraintFloat)},
+			{name: "true", type: SgGeneric(0, ConstraintFloat), def: Const(1.0)},
+			{name: "false", type: SgGeneric(0, ConstraintFloat), def: Const(0.0)},
 		];
 		return inputs;
 	}