{
	"name": "sdline2",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"ax": -0.3,
		"ay": -0.3,
		"bx": 0.3,
		"by": 0.3,
		"r": 0.1
	},
	"seed_int": 0,
	"shader_model": {
		"code": "vec2 $(name_uv)_sdl = sdLine($uv, vec2($ax+0.5, $ay+0.5), vec2($bx+0.5, $by+0.5));",
		"global": [
			"vec2 sdLine(vec2 p, vec2 a, vec2 b) {",
			"\tvec2 pa = p-a, ba = b-a;",
			"\tfloat h = clamp(dot(pa,ba)/dot(ba,ba), 0.0, 1.0);",
			"\treturn vec2(length(pa-ba*h), h);",
			"}",
			""
		],
		"inputs": [
			{
				"default": "1.0",
				"label": "",
				"longdesc": "A profile for the shape, generated (for example) by a Tonality node.",
				"name": "profile",
				"shortdesc": "Profile",
				"type": "f"
			}
		],
		"instance": "",
		"longdesc": "A line or a capsule shape described as a signed distance function",
		"name": "sdLine",
		"outputs": [
			{
				"longdesc": "The shape as signed distance function",
				"sdf2d": "$(name_uv)_sdl.x-$r*$profile(vec2($(name_uv)_sdl.y, 0.5))",
				"shortdesc": "Output",
				"type": "sdf2d"
			}
		],
		"parameters": [
			{
				"control": "P1.x",
				"default": 0,
				"label": "A X",
				"longdesc": "The position on the X axis of the first point of the line",
				"max": 1,
				"min": -1,
				"name": "ax",
				"shortdesc": "A.x",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "P1.y",
				"default": 0,
				"label": "A Y",
				"longdesc": "The position on the Y axis of the first point of the line",
				"max": 1,
				"min": -1,
				"name": "ay",
				"shortdesc": "A.y",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "P2.x",
				"default": 1,
				"label": "B X",
				"longdesc": "The position on the X axis of the second point of the line",
				"max": 1,
				"min": -1,
				"name": "bx",
				"shortdesc": "B.x",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "P2.y",
				"default": 1,
				"label": "B Y",
				"longdesc": "The position on the Y axis of the second point of the line",
				"max": 1,
				"min": -1,
				"name": "by",
				"shortdesc": "B.y",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "Radius1.r",
				"default": 0,
				"label": "Width",
				"longdesc": "The width of the capsule shape around the line",
				"max": 1,
				"min": 0,
				"name": "r",
				"shortdesc": "Width",
				"step": 0.01,
				"type": "float"
			}
		],
		"shortdesc": "sdLine"
	},
	"type": "shader"
}