2019-11-06 08:30:36 +01:00
|
|
|
{
|
|
|
|
"name": "sdbox",
|
|
|
|
"node_position": {
|
|
|
|
"x": 0,
|
|
|
|
"y": 0
|
|
|
|
},
|
|
|
|
"parameters": {
|
|
|
|
"cx": 0,
|
|
|
|
"cy": 0,
|
|
|
|
"h": 0.2,
|
|
|
|
"r": 0.3,
|
|
|
|
"w": 0.3
|
|
|
|
},
|
|
|
|
"shader_model": {
|
2019-12-15 12:41:00 +01:00
|
|
|
"code": "vec2 $(name_uv)_d = abs($uv-0.5*vec2($cx+1.0, $cy+1.0))-vec2($w, $h);\n",
|
|
|
|
"global": "",
|
2019-11-06 08:30:36 +01:00
|
|
|
"inputs": [
|
|
|
|
|
|
|
|
],
|
|
|
|
"instance": "",
|
|
|
|
"name": "sdBox",
|
|
|
|
"outputs": [
|
|
|
|
{
|
2019-12-15 12:41:00 +01:00
|
|
|
"sdf2d": "length(max($(name_uv)_d,vec2(0)))+min(max($(name_uv)_d.x,$(name_uv)_d.y),0.0)",
|
|
|
|
"type": "sdf2d"
|
2019-11-06 08:30:36 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"default": 0.5,
|
|
|
|
"label": "Width",
|
|
|
|
"max": 1,
|
|
|
|
"min": 0,
|
|
|
|
"name": "w",
|
|
|
|
"step": 0.01,
|
|
|
|
"type": "float"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default": 1,
|
|
|
|
"label": "Height",
|
|
|
|
"max": 1,
|
|
|
|
"min": 0,
|
|
|
|
"name": "h",
|
|
|
|
"step": 0.01,
|
|
|
|
"type": "float"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default": 0,
|
|
|
|
"label": "Center X",
|
|
|
|
"max": 1,
|
|
|
|
"min": -1,
|
|
|
|
"name": "cx",
|
|
|
|
"step": 0.01,
|
|
|
|
"type": "float"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default": 0,
|
|
|
|
"label": "Center Y",
|
|
|
|
"max": 1,
|
|
|
|
"min": -1,
|
|
|
|
"name": "cy",
|
|
|
|
"step": 0.01,
|
|
|
|
"type": "float"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "shader"
|
|
|
|
}
|