浏览代码

[shgraph] Fixed cond and ifCondition missing defaults

Clément Espeute 1 年之前
父节点
当前提交
e22d3d5a1c
共有 2 个文件被更改,包括 4 次插入4 次删除
  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;
 	}