Lubos Lenco před 4 roky
rodič
revize
873aa67957
2 změnil soubory, kde provedl 173 přidání a 173 odebrání
  1. 2 2
      Sources/arm/shader/MaterialParser.hx
  2. 171 171
      Sources/arm/shader/NodesMaterial.hx

+ 2 - 2
Sources/arm/shader/MaterialParser.hx

@@ -677,9 +677,9 @@ class MaterialParser {
 			else return out_col;
 		}
 		else if (node.type == "QUANTIZE") {
-			var amount = parse_value_input(node.inputs[0]);
+			var strength = parse_value_input(node.inputs[0]);
 			var col = parse_vector_input(node.inputs[1]);
-			return '(floor(100*$amount*$col)/(100*$amount))';
+			return '(floor(100.0 * $strength * $col) / (100.0 * $strength))';
 		}
 		else if (node.type == "VALTORGB") { // ColorRamp
 			var fac = parse_value_input(node.inputs[0]);

+ 171 - 171
Sources/arm/shader/NodesMaterial.hx

@@ -1498,55 +1498,6 @@ class NodesMaterial {
 			}
 		],
 		[ // Color
-			{
-				id: 0,
-				name: _tr("Warp"),
-				type: "DIRECT_WARP", // extension
-				x: 0,
-				y: 0,
-				color: 0xff448c6d,
-				inputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Color"),
-						type: "RGBA",
-						color: 0xffc7c729,
-						default_value: f32([0.8, 0.8, 0.8, 1.0])
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Angle"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0,
-						min: 0.0,
-						max: 360.0
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Mask"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.5,
-						min: 0.0,
-						max: 1.0
-					}
-				],
-				outputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Color"),
-						type: "RGBA",
-						color: 0xffc7c729,
-						default_value: f32([0.8, 0.8, 0.8, 1.0])
-					}
-				],
-				buttons: []
-			},
 			{
 				id: 0,
 				name: _tr("Blur"),
@@ -1834,7 +1785,7 @@ class NodesMaterial {
 					{
 						id: 0,
 						node_id: 0,
-						name: _tr("Amount"),
+						name: _tr("Stength"),
 						type: "VALUE",
 						color: 0xffa1a1a1,
 						default_value: 0.1,
@@ -1861,6 +1812,55 @@ class NodesMaterial {
 					}
 				],
 				buttons: []
+			},
+			{
+				id: 0,
+				name: _tr("Warp"),
+				type: "DIRECT_WARP", // extension
+				x: 0,
+				y: 0,
+				color: 0xff448c6d,
+				inputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Color"),
+						type: "RGBA",
+						color: 0xffc7c729,
+						default_value: f32([0.8, 0.8, 0.8, 1.0])
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Angle"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0,
+						min: 0.0,
+						max: 360.0
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Mask"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.5,
+						min: 0.0,
+						max: 1.0
+					}
+				],
+				outputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Color"),
+						type: "RGBA",
+						color: 0xffc7c729,
+						default_value: f32([0.8, 0.8, 0.8, 1.0])
+					}
+				],
+				buttons: []
 			}
 		],
 		[ // Vector
@@ -2104,6 +2104,59 @@ class NodesMaterial {
 			}
 		],
 		[ // Converter
+			{
+				id: 0,
+				name: _tr("Clamp"),
+				type: "CLAMP",
+				x: 0,
+				y: 0,
+				color: 0xff62676d,
+				inputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Value"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.5
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Min"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Max"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 1.0
+					}
+				],
+				outputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Value"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0
+					}
+				],
+				buttons: [
+					{
+						name: _tr("operation"),
+						type: "ENUM",
+						data: [_tr("Min Max"), _tr("Range")],
+						default_value: 0,
+						output: 0
+					}
+				]
+			},
 			{
 				id: 0,
 				name: _tr("Color Ramp"),
@@ -2285,6 +2338,74 @@ class NodesMaterial {
 				],
 				buttons: []
 			},
+			{
+				id: 0,
+				name: _tr("Map Range"),
+				type: "MAPRANGE",
+				x: 0,
+				y: 0,
+				color: 0xff62676d,
+				inputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Value"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.5
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("From Min"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("From Max"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 1.0
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("To Min"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0
+					},
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("To Max"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 1.0
+					}
+				],
+				outputs: [
+					{
+						id: 0,
+						node_id: 0,
+						name: _tr("Value"),
+						type: "VALUE",
+						color: 0xffa1a1a1,
+						default_value: 0.0
+					}
+				],
+				buttons: [
+					{
+						name: _tr("use_clamp"),
+						type: "BOOL",
+						default_value: false,
+						output: 0
+					}
+				]
+			},
 			{
 				id: 0,
 				name: _tr("Math"),
@@ -2552,127 +2673,6 @@ class NodesMaterial {
 						output: 0
 					}
 				]
-			},
-			{
-				id: 0,
-				name: _tr("Clamp"),
-				type: "CLAMP",
-				x: 0,
-				y: 0,
-				color: 0xff62676d,
-				inputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Value"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.5
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Min"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Max"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 1.0
-					}
-				],
-				outputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Value"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0
-					}
-				],
-				buttons: [
-					{
-						name: _tr("operation"),
-						type: "ENUM",
-						data: [_tr("Min Max"), _tr("Range")],
-						default_value: 0,
-						output: 0
-					}
-				]
-			},
-			{
-				id: 0,
-				name: _tr("Map Range"),
-				type: "MAPRANGE",
-				x: 0,
-				y: 0,
-				color: 0xff62676d,
-				inputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Value"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.5
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("From Min"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("From Max"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 1.0
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("To Min"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0
-					},
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("To Max"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 1.0
-					}
-				],
-				outputs: [
-					{
-						id: 0,
-						node_id: 0,
-						name: _tr("Value"),
-						type: "VALUE",
-						color: 0xffa1a1a1,
-						default_value: 0.0
-					}
-				],
-				buttons: [
-					{
-						name: _tr("use_clamp"),
-						type: "BOOL",
-						default_value: false,
-						output: 0
-					}
-				]
 			}
 		],
 		[ // Input