material-maker/addons/material_maker/nodes/sdf3d_cylinder.mmg

52 lines
846 B
Plaintext
Raw Normal View History

2019-12-18 23:18:28 +01:00
{
"name": "sdf3d_cylinder",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
2019-12-29 18:12:35 +01:00
"l": 0.4,
"r": 0.2,
2019-12-18 23:18:28 +01:00
"sx": 0.25,
"sy": 0.25,
"sz": 0.5
},
"shader_model": {
"code": "vec2 $(name_uv)_d = abs(vec2(length($uv.xz),$uv.y)) - vec2($r,$l);\n",
"global": "",
"inputs": [
],
"instance": "",
"name": "Cylinder",
"outputs": [
{
"sdf3d": "min(max($(name_uv)_d.x,$(name_uv)_d.y),0.0) + length(max($(name_uv)_d,0.0))",
"type": "sdf3d"
}
],
"parameters": [
{
2019-12-29 18:12:35 +01:00
"control": "Rect1.y",
2019-12-18 23:18:28 +01:00
"default": 0.5,
"label": "Length",
"max": 1,
"min": 0,
"name": "l",
"step": 0.01,
"type": "float"
},
{
2019-12-29 18:12:35 +01:00
"control": "Rect1.x",
2019-12-18 23:18:28 +01:00
"default": 0.2,
"label": "Radius",
"max": 1,
"min": 0,
"name": "r",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}