mirror of
https://github.com/Relintai/material-maker.git
synced 2024-11-13 06:27:18 +01:00
Added capsule and cylinder
This commit is contained in:
parent
b7fb257d4c
commit
78891affae
File diff suppressed because it is too large
Load Diff
50
addons/material_maker/nodes/sdf3d_capsule.mmg
Normal file
50
addons/material_maker/nodes/sdf3d_capsule.mmg
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "sdf3d_capsule",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"l": 0.25,
|
||||
"r": 0.1,
|
||||
"sx": 0.25,
|
||||
"sy": 0.25,
|
||||
"sz": 0.5
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec3 $(name_uv)_p = $uv;\n$(name_uv)_p.y -= clamp($(name_uv)_p.y, -0.5*$l, 0.5*$l);\n",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
|
||||
],
|
||||
"instance": "",
|
||||
"name": "Capsule",
|
||||
"outputs": [
|
||||
{
|
||||
"sdf3d": "length($(name_uv)_p)-$r",
|
||||
"type": "sdf3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0.5,
|
||||
"label": "Length",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "l",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"default": 0.2,
|
||||
"label": "Radius",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "r",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
50
addons/material_maker/nodes/sdf3d_cylinder.mmg
Normal file
50
addons/material_maker/nodes/sdf3d_cylinder.mmg
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "sdf3d_cylinder",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"l": 0.25,
|
||||
"r": 0.1,
|
||||
"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": [
|
||||
{
|
||||
"default": 0.5,
|
||||
"label": "Length",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "l",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"default": 0.2,
|
||||
"label": "Radius",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "r",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
Loading…
Reference in New Issue
Block a user