{
	"name": "math",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"clamp": false,
		"default_in1": 0,
		"default_in2": 0,
		"op": 0
	},
	"shader_model": {
		"code": "float $(name_uv)_clamp_false = $op;\nfloat $(name_uv)_clamp_true = clamp($(name_uv)_clamp_false, 0.0, 1.0);\n",
		"global": "",
		"inputs": [
			{
				"default": "$default_in1",
				"label": "2:A",
				"longdesc": "The A operand",
				"name": "in1",
				"shortdesc": "A",
				"type": "f"
			},
			{
				"default": "$default_in2",
				"label": "B",
				"longdesc": "The B operand",
				"name": "in2",
				"shortdesc": "B",
				"type": "f"
			}
		],
		"instance": "",
		"longdesc": "Performs a math operation using its inputs or parameter values",
		"name": "Math",
		"outputs": [
			{
				"f": "$(name_uv)_clamp_$clamp",
				"longdesc": "Shows a greyscale image of the result",
				"shortdesc": "Output",
				"type": "f"
			}
		],
		"parameters": [
			{
				"default": 19,
				"label": "",
				"longdesc": "The operation to be performed",
				"name": "op",
				"shortdesc": "Operation",
				"type": "enum",
				"values": [
					{
						"name": "A+B",
						"value": "$in1($uv)+$in2($uv)"
					},
					{
						"name": "A-B",
						"value": "$in1($uv)-$in2($uv)"
					},
					{
						"name": "A*B",
						"value": "$in1($uv)*$in2($uv)"
					},
					{
						"name": "A/B",
						"value": "$in1($uv)/$in2($uv)"
					},
					{
						"name": "log(A)",
						"value": "log($in1($uv))"
					},
					{
						"name": "log2(A)",
						"value": "log2($in1($uv))"
					},
					{
						"name": "pow(A, B)",
						"value": "pow($in1($uv),$in2($uv))"
					},
					{
						"name": "abs(A)",
						"value": "abs($in1($uv))"
					},
					{
						"name": "round(A)",
						"value": "round($in1($uv))"
					},
					{
						"name": "floor(A)",
						"value": "floor($in1($uv))"
					},
					{
						"name": "ceil(A)",
						"value": "ceil($in1($uv))"
					},
					{
						"name": "trunc(A)",
						"value": "trunc($in1($uv))"
					},
					{
						"name": "fract(A)",
						"value": "fract($in1($uv))"
					},
					{
						"name": "min(A, B)",
						"value": "min($in1($uv),$in2($uv))"
					},
					{
						"name": "max(A, B)",
						"value": "max($in1($uv),$in2($uv))"
					},
					{
						"name": "A<B",
						"value": "step($in1($uv),$in2($uv))"
					},
					{
						"name": "cos(A*B)",
						"value": "cos($in1($uv)*$in2($uv))"
					},
					{
						"name": "sin(A*B)",
						"value": "sin($in1($uv)*$in2($uv))"
					},
					{
						"name": "tan(A*B)",
						"value": "tan($in1($uv)*$in2($uv))"
					},
					{
						"name": "sqrt(1-A²)",
						"value": "sqrt(1.0-$in1($uv)*$in1($uv))"
					}
				]
			},
			{
				"control": "None",
				"default": 0,
				"label": "",
				"longdesc": "The default value for A, used if the corresponding input is not connected",
				"max": 1,
				"min": 0,
				"name": "default_in1",
				"shortdesc": "Default A",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0,
				"label": "",
				"longdesc": "The default value for B, used if the corresponding input is not connected",
				"max": 1,
				"min": 0,
				"name": "default_in2",
				"shortdesc": "Default B",
				"step": 0.01,
				"type": "float"
			},
			{
				"default": false,
				"label": "Clamp result",
				"longdesc": "The result is clamped to [0, 1] if this option is checked",
				"name": "clamp",
				"shortdesc": "Clamp",
				"type": "boolean"
			}
		],
		"shortdesc": "Math"
	},
	"type": "shader"
}