Comments from sdf3d_angle.mmg.

This commit is contained in:
Relintai 2021-10-12 13:20:15 +02:00
parent 33e8a8adb0
commit e6d4b2b755
2 changed files with 21 additions and 72 deletions

View File

@ -180,6 +180,27 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
#Inputs: #Inputs:
#count, float, min: 1, max: 32, default:5, step:1 #count, float, min: 1, max: 32, default:5, step:1
#----------------------
#sdf3d_angle.mmg (includes sdf3d_rotate.mmg)
#Outputs:
#Shows the angleThe shape generated by the boolean operation
#$(name_uv)_d
#X: $axis = xyz
#Y: $axis = yzx
#Z: $axis = zxy
#vec3 $(name_uv)_uv = $uv.$axis;
#float $(name_uv)_rotated = rotate3d($(name_uv)_uv, vec3(($angle-180.0)*0.01745329251, 0.0, 0.0)).y;
#float $(name_uv)_d1 = max($(name_uv)_uv.y, $(name_uv)_rotated);
#float $(name_uv)_d2 = min($(name_uv)_uv.y, $(name_uv)_rotated);
#float $(name_uv)_d = (mod($angle, 360.0) < 180.0) ? $(name_uv)_d1 : $(name_uv)_d2;
#Inputs:
#axis, enum, default: 0, values: X, Y, Z
#angle, float, min: 0, max: 360, default:180, step:0.1
static func raymarch(uv : Vector2) -> Color: static func raymarch(uv : Vector2) -> Color:
var d : Vector2 = sdf3d_raymarch(uv); var d : Vector2 = sdf3d_raymarch(uv);

View File

@ -1,72 +0,0 @@
{
"name": "sdf3d_angle",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"angle": 135,
"axis": 2
},
"seed": 0,
"seed_locked": false,
"shader_model": {
"code": "vec3 $(name_uv)_uv = $uv.$axis;\nfloat $(name_uv)_rotated = rotate3d($(name_uv)_uv, vec3(($angle-180.0)*0.01745329251, 0.0, 0.0)).y;\nfloat $(name_uv)_d1 = max($(name_uv)_uv.y, $(name_uv)_rotated);\nfloat $(name_uv)_d2 = min($(name_uv)_uv.y, $(name_uv)_rotated);\nfloat $(name_uv)_d = (mod($angle, 360.0) < 180.0) ? $(name_uv)_d1 : $(name_uv)_d2;",
"global": "",
"includes": [
"sdf3d_rotate"
],
"inputs": [
],
"instance": "",
"longdesc": "Generates an angle formed by 2 planes that can be used to cut other shapes",
"name": "Angle",
"outputs": [
{
"longdesc": "Shows the angle",
"sdf3d": "$(name_uv)_d",
"shortdesc": "Output",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "",
"longdesc": "The axis of the angle",
"name": "axis",
"shortdesc": "Axis",
"type": "enum",
"values": [
{
"name": "X",
"value": "xyz"
},
{
"name": "Y",
"value": "yzx"
},
{
"name": "Z",
"value": "zxy"
}
]
},
{
"control": "None",
"default": 180,
"label": "",
"longdesc": "The angle of the shape",
"max": 360,
"min": 0,
"name": "angle",
"shortdesc": "Angle",
"step": 0.1,
"type": "float"
}
],
"shortdesc": "Angle"
},
"type": "shader"
}