Comments from sdf3d_torus.mmg.

This commit is contained in:
Relintai 2021-10-12 12:16:46 +02:00
parent 95eb126b8f
commit d75ee3dac2
2 changed files with 18 additions and 80 deletions

View File

@ -133,6 +133,24 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
#Inputs:
#axis, enum, default: 1, values: X, Y, Z
#----------------------
#sdf3d_torus.mmg
#Generates a torus as a signed distance function
#Outputs:
#X: $axis = length($uv.yz)-$R,$uv.x
#Y: $axis = length($uv.zx)-$R,$uv.y
#Z: $axis = length($uv.xy)-$R,$uv.z
#vec2 $(name_uv)_q = vec2($axis);\n
#Output (sdf3dc) - Shows the torus
#length($(name_uv)_q)-$r
#Inputs:
#axis, enum, default: 1, values: X, Y, Z
#R, float, min: 0, max: 1, default:0.5, step:0.01
#r, float, min: 0, max: 1, default:0.1, step:0.01
static func raymarch(uv : Vector2) -> Color:

View File

@ -1,80 +0,0 @@
{
"name": "sdf3d_torus",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"R": 0.3,
"axis": 2,
"r": 0.15
},
"shader_model": {
"code": "vec2 $(name_uv)_q = vec2($axis);\n",
"global": "",
"inputs": [
],
"instance": "",
"longdesc": "Generates a torus as a signed distance function",
"name": "Torus",
"outputs": [
{
"longdesc": "Shows the torus",
"sdf3d": "length($(name_uv)_q)-$r",
"shortdesc": "Output",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "Axis",
"longdesc": "The axis of the torus",
"name": "axis",
"shortdesc": "Torus",
"type": "enum",
"values": [
{
"name": "X",
"value": "length($uv.yz)-$R,$uv.x"
},
{
"name": "Y",
"value": "length($uv.zx)-$R,$uv.y"
},
{
"name": "Z",
"value": "length($uv.xy)-$R,$uv.z"
}
]
},
{
"control": "Radius1.r",
"default": 0.5,
"label": "R",
"longdesc": "The major radius of the torus",
"max": 1,
"min": 0,
"name": "R",
"shortdesc": "Radius1",
"step": 0.01,
"type": "float"
},
{
"control": "Radius11.r",
"default": 0.1,
"label": "r",
"longdesc": "The minor radius of the torus",
"max": 0.5,
"min": 0,
"name": "r",
"shortdesc": "Radius2",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Torus"
},
"type": "shader"
}