{
	"generic_size": 1,
	"name": "sdsmoothboolean",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"k1": 0.15,
		"op1": 0
	},
	"seed_int": 0,
	"shader_model": {
		"code": [
			"float $(name_uv)_b = $b($uv);",
			"",
			"#for",
			"$(name_uv)_b = sdSmooth$op#($s#($uv), $(name_uv)_b, $k#);",
			"#end"
		],
		"global": [
			"float sdSmoothUnion( float d1, float d2, float k ) {",
			"\tfloat h = clamp( 0.5 + 0.5*(d2-d1)/k, 0.0, 1.0 );",
			"\treturn mix( d2, d1, h ) - k*h*(1.0-h); }",
			"",
			"float sdSmoothSubtraction( float d1, float d2, float k ) {",
			"\tfloat h = clamp( 0.5 - 0.5*(d2+d1)/k, 0.0, 1.0 );",
			"\treturn mix( d2, -d1, h ) + k*h*(1.0-h); }",
			"",
			"float sdSmoothIntersection( float d1, float d2, float k ) {",
			"\tfloat h = clamp( 0.5 - 0.5*(d2-d1)/k, 0.0, 1.0 );",
			"\treturn mix( d2, d1, h ) + k*h*(1.0-h); }",
			""
		],
		"inputs": [
			{
				"default": "0.0",
				"label": "",
				"longdesc": "The first shape, defined as a signed distance function",
				"name": "b",
				"shortdesc": "Base Shape",
				"type": "sdf2d"
			},
			{
				"default": "0.0",
				"label": "",
				"longdesc": "The subsequent shape, defined as a signed distance function",
				"name": "s#",
				"shortdesc": "Shape#",
				"type": "sdf2d"
			}
		],
		"instance": "",
		"longdesc": "Performs smooth boolean operations (union, intersection or difference) between two or more shapes",
		"name": "sdSmoothBoolean",
		"outputs": [
			{
				"longdesc": "The shape generated by the boolean operation(s)",
				"sdf2d": "$(name_uv)_b",
				"shortdesc": "Output",
				"type": "sdf2d"
			}
		],
		"parameters": [
			{
				"default": 0,
				"label": "2:",
				"longdesc": "The operation performed by this node",
				"name": "op#",
				"shortdesc": "Operation#",
				"type": "enum",
				"values": [
					{
						"name": "Union",
						"value": "Union"
					},
					{
						"name": "Subtraction",
						"value": "Subtraction"
					},
					{
						"name": "Intersection",
						"value": "Intersection"
					}
				]
			},
			{
				"control": "None",
				"default": 0,
				"label": "2:",
				"longdesc": "The smoothness of the boolean operation",
				"max": 1,
				"min": 0,
				"name": "k#",
				"shortdesc": "Smoothness#",
				"step": 0.01,
				"type": "float"
			}
		],
		"shortdesc": "sdSmoothBoolean"
	},
	"type": "shader"
}