material-maker/addons/material_maker/nodes/sdf3d_capsule.mmg
2020-04-04 07:16:45 +02:00

70 lines
1.0 KiB
Plaintext

{
"name": "sdf3d_capsule",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"axis": 1,
"l": 0.3,
"r": 0.2
},
"shader_model": {
"code": "vec3 $(name_uv)_p = $uv;\n$(name_uv)_p.$axis -= clamp($(name_uv)_p.$axis, -$l, $l);\n",
"global": "",
"inputs": [
],
"instance": "",
"name": "Capsule",
"outputs": [
{
"sdf3d": "length($(name_uv)_p)-$r",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 1,
"label": "Axis",
"name": "axis",
"type": "enum",
"values": [
{
"name": "X",
"value": "x"
},
{
"name": "Y",
"value": "y"
},
{
"name": "Z",
"value": "z"
}
]
},
{
"control": "Rect1.y",
"default": 0.25,
"label": "Length",
"max": 1,
"min": 0,
"name": "l",
"step": 0.01,
"type": "float"
},
{
"control": "Rect1.x",
"default": 0.2,
"label": "Radius",
"max": 1,
"min": 0,
"name": "r",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}