{
	"name": "sdstar",
	"node_position": {
		"x": 0,
		"y": 0
	},
	"parameters": {
		"cx": 0,
		"cy": 0,
		"ir": 0.5,
		"n": 6,
		"r": 0.45,
		"rot": 0
	},
	"seed_int": 0,
	"shader_model": {
		"code": "",
		"global": [
			"// The MIT License, Copyright © 2019 Inigo Quilez",
			"// https://www.shadertoy.com/view/3tSGDy",
			"",
			"float sdStar(vec2 p, float r, int n, float m) {",
			"\tfloat an = 3.141593/float(n);",
			"\tfloat en = 3.141593/m;",
			"\tvec2  acs = vec2(cos(an),sin(an));",
			"\tvec2  ecs = vec2(cos(en),sin(en));",
			"\tfloat bn = mod(atan(p.x,p.y),2.0*an) - an;",
			"\tp = length(p)*vec2(cos(bn),abs(sin(bn)));",
			"\tp -= r*acs;",
			"\tp += ecs*clamp( -dot(p,ecs), 0.0, r*acs.y/ecs.y);",
			"\treturn length(p)*sign(p.x);",
			"}",
			""
		],
		"includes": [
			"sdrotate",
			"sdcirclerepeat"
		],
		"inputs": [

		],
		"instance": "",
		"longdesc": "A star described as a signed distance function",
		"name": "sdStar",
		"outputs": [
			{
				"longdesc": "The star as a signed distance function",
				"sdf2d": "sdStar(sdf2d_rotate($uv-vec2($cx, $cy), $rot*0.01745329251-1.57079632679)-vec2(0.5), $r, int($n), $n+(1.0-$n)*$ir)",
				"shortdesc": "Output",
				"type": "sdf2d"
			}
		],
		"parameters": [
			{
				"control": "None",
				"default": 6,
				"label": "Points",
				"longdesc": "The number of points of the star",
				"max": 12,
				"min": 3,
				"name": "n",
				"shortdesc": "N",
				"step": 1,
				"type": "float"
			},
			{
				"control": "Radius1.r",
				"default": 0.45,
				"label": "Radius",
				"longdesc": "The radius of the star",
				"max": 1,
				"min": 0,
				"name": "r",
				"shortdesc": "Radius",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "None",
				"default": 0.5,
				"label": "Pointiness",
				"longdesc": "The pointiness of the star",
				"max": 1,
				"min": 0,
				"name": "ir",
				"shortdesc": "Pointiness",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "Radius1.a",
				"default": 0,
				"label": "Rotation",
				"longdesc": "The rotation of the star",
				"max": 180,
				"min": -180,
				"name": "rot",
				"shortdesc": "Rotation",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "P1.x",
				"default": 0,
				"label": "Center X",
				"longdesc": "The position of the center on the X axis",
				"max": 0.5,
				"min": -0.5,
				"name": "cx",
				"shortdesc": "Center.x",
				"step": 0.01,
				"type": "float"
			},
			{
				"control": "P1.y",
				"default": 0,
				"label": "Center Y",
				"longdesc": "The position of the center on the Y axis",
				"max": 0.5,
				"min": -0.5,
				"name": "cy",
				"shortdesc": "Center.y",
				"step": 0.01,
				"type": "float"
			}
		],
		"shortdesc": "sdStar"
	},
	"type": "shader"
}