2019-11-06 08:30:36 +01:00
{
"name": "sdline",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
2019-12-27 22:30:49 +01:00
"ax": 0.224,
"ay": 0.2672,
"bx": -0.272,
"by": -0.2344,
2019-11-06 08:30:36 +01:00
"cx": 0,
"cy": 0,
"h": 0.2,
"r": 0.3,
"w": 0.3
},
"shader_model": {
"code": "",
"global": "float sdLine( in vec2 p, in vec2 a, in vec2 b ) {\n vec2 pa = p-a, ba = b-a;\n float h = clamp( dot(pa,ba)/dot(ba,ba), 0.0, 1.0 );\n return length( pa - ba*h );\n}\n",
"inputs": [
],
"instance": "",
"name": "sdLine",
"outputs": [
{
2019-12-27 22:30:49 +01:00
"sdf2d": "sdLine($uv, vec2($ax+0.5, $ay+0.5), vec2($bx+0.5, $by+0.5))",
2019-12-15 12:41:00 +01:00
"type": "sdf2d"
2019-11-06 08:30:36 +01:00
}
],
"parameters": [
{
2019-12-27 22:30:49 +01:00
"control": "P1.x",
2019-11-06 08:30:36 +01:00
"default": 0,
"label": "A X",
"max": 1,
2019-12-27 22:30:49 +01:00
"min": -1,
2019-11-06 08:30:36 +01:00
"name": "ax",
"step": 0.01,
"type": "float"
},
{
2019-12-27 22:30:49 +01:00
"control": "P1.y",
2019-11-06 08:30:36 +01:00
"default": 0,
"label": "A Y",
"max": 1,
2019-12-27 22:30:49 +01:00
"min": -1,
2019-11-06 08:30:36 +01:00
"name": "ay",
"step": 0.01,
"type": "float"
},
{
2019-12-27 22:30:49 +01:00
"control": "P2.x",
2019-11-06 08:30:36 +01:00
"default": 1,
"label": "B X",
"max": 1,
2019-12-27 22:30:49 +01:00
"min": -1,
2019-11-06 08:30:36 +01:00
"name": "bx",
"step": 0.01,
"type": "float"
},
{
2019-12-27 22:30:49 +01:00
"control": "P2.y",
2019-11-06 08:30:36 +01:00
"default": 1,
"label": "B Y",
"max": 1,
2019-12-27 22:30:49 +01:00
"min": -1,
2019-11-06 08:30:36 +01:00
"name": "by",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}