Comments from the rest of the sdf3d mmg files.

This commit is contained in:
Relintai 2021-10-12 17:54:31 +02:00
parent 666f735379
commit 3ceb7a3236
11 changed files with 214 additions and 587 deletions

View File

@ -214,6 +214,151 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
#color_index, float, min: 0, max: 1, default:0, step:0.01
#in, vec2, default:vec2(100, 0.0), (sdf3d input)
#----------------------
#sdf3d_translate.mmg
#Outputs:
#Output - sdf3dc
#$in($uv-vec3($x, $y, $z))
#Inputs:
#translation, vector3, min: -1, max: 1, default:0, step:0.01
#in, vec2, default:vec2(100, 0.0), (sdf3dc input)
#----------------------
#sdf3d_scale.mmg
#Outputs:
#vec2 $(name_uv)_in = $in(($uv)/$s);
#Output - sdf3dc
#vec2($(name_uv)_in.x*$s, $(name_uv)_in.y)
#Inputs:
#scale_factor, float, min: 0, max: 5, default:1, step:0.01
#in, vec2, default:vec2(100, 0.0), (sdf3dc input)
#----------------------
#sdf3d_rounded.mmg
#Outputs:
#vec2 $(name_uv)_v = $in($uv);
#Output - sdf3dc
#vec2($(name_uv)_v.x-$r, $(name_uv)_v.y)
#Inputs:
#radius, float, min: 0, max: 1, default:0, step:0.01
#in, vec2, default:vec2(100, 0.0), (sdf3dc input)
#----------------------
#sdf3d_revolution.mmg
#Outputs:
#vec2 $(name_uv)_q = vec2(length($uv.xy)-$d+0.5, $uv.z+0.5);
#Output - sdf3dc
#$in($(name_uv)_q)
#Inputs:
#d, float, min: 0, max: 1, default:0.25, step:0.01
#input, float, default:10.0, (sdf2d input)
#----------------------
#sdf3d_smoothboolean.mmg
#Performs a smooth boolean operation (union, intersection or difference) between two shapes
#Outputs:
#Union: $op = union
#Subtraction: $op = subtraction
#Intersection: $op = intersection
#Output - sdf3dc
#sdf3d_smooth_$op($in1($uv), $in2($uv), $k)
#Inputs:
#in1, vec2, default:vec2(100, 0.0), (sdf3d input)
#in2, vec2, default:vec2(100, 0.0), (sdf3d input)
#operation, enum, default: 1, values: Union, Subtraction, Intersection
#smoothness, float, min: 0, max: 1, default:0, step:0.01
#----------------------
#sdf3d_elongation.mmg
#Outputs:
#Output - sdf3dc
#$in($uv-clamp($uv, -abs(vec3($x, $y, $z)), abs(vec3($x, $y, $z))))
#Inputs:
#in, vec2, default:vec2(100, 0.0), (sdf3dc input)
#elongation, vector3, min: 0, max: 1, default:0, step:0.01
#----------------------
#sdf3d_extrusion.mmg
#Outputs:
#vec2 $(name_uv)_w = vec2($in($uv.xz+vec2(0.5)),abs($uv.y)-$d);
#Output - sdf3dc
#min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0))
#Inputs:
#in, sdf2d, default:100, (input)
#length, float, min: 0, max: 1, default:0.25, step:0.01
#----------------------
#sdf3d_morph.mmg
#Outputs:
#Output - sdf3d
#mix($in1($uv), $in2($uv), $amount)
#Inputs:
#in1, vec2, default:vec2(100, 0.0), (sdf3d input)
#in2, vec2, default:vec2(100, 0.0), (sdf3d input)
#amount, float, min: 0, max: 1, default:0.5, step:0.01
#----------------------
#raymarching.mmg (raymarching_preview.mmg)
#Raymarches a 3D object (described as signed distance function with optional color index)
#to render a heightmap, a normal map and a color index map.
#raymarch_$name = sdf3d_raymarch
#vec2 $(name_uv)_d = raymarch_$name($uv);
#Outputs:
#HeightMap - float - The generated height map
#1.0-$(name_uv)_d.x
#NormalMap - rgb - The generated normal map
#vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d.x))
#ColorMap - float - The generated color index map
#$(name_uv)_d.y
#Inputs:
#input, vec2, default:vec2(100, 0.0), (sdf3dc input)
#----------------------
#raymarching_preview.mmg
#Outputs:
#Output (rgb)
#render_$name($uv-vec2(0.5))
#Inputs:
#input, vec2, default:vec2(100, 0.0), (sdf3dc input)
static func raymarch(uv : Vector2) -> Color:
var d : Vector2 = sdf3d_raymarch(uv);
@ -370,6 +515,28 @@ static func sdf3d_torus_z(p : Vector3, R : float, r : float) -> Vector2:
return Vector2(f, 0.0);
#vec2 raymarch_$name(vec2 uv) {
# vec3 ro = vec3(uv-vec2(0.5), 1.0);
# vec3 rd = vec3(0.0, 0.0, -1.0);
# float dO = 0.0;float c = 0.0;
#
# for (int i=0; i < 100; i++) {
# vec3 p = ro + rd*dO;
# vec2 dS = $sdf(p);
# dO += dS.x;
#
# if (dO >= 1.0) {
# break;
# } else if (dS.x < 0.0001) {
# c = dS.y;
# break;
# }
# }
#
# return vec2(dO, c);
#}
static func sdf3d_raymarch(uv : Vector2) -> Vector2:
var ro : Vector3 = Vector3(uv.x - 0.5, uv.y - 0.5, 1.0);
var rd : Vector3 = Vector3(0.0, 0.0, -1.0);
@ -390,6 +557,21 @@ static func sdf3d_raymarch(uv : Vector2) -> Vector2:
return Vector2(dO, c);
#vec3 normal_$name(vec3 p) {
# if (p.z <= 0.0) {
# return vec3(0.0, 0.0, 1.0);
# }
#
# float d = $sdf(p).x;
# float e = .001;
# vec3 n = d - vec3(
# $sdf(p-vec3(e, 0.0, 0.0)).x,
# $sdf(p-vec3(0.0, e, 0.0)).x,
# $sdf(p-vec3(0.0, 0.0, e)).x);
#
# return vec3(-1.0, -1.0, -1.0)*normalize(n);
#}
static func sdf3d_normal(p : Vector3) -> Vector3:
if (p.z <= 0.0):
return Vector3(0.0, 0.0, 1.0);
@ -425,14 +607,29 @@ static func sdf3dc_sub(a : Vector2, b : Vector2) -> Vector2:
static func sdf3dc_inter(a : Vector2, b : Vector2) -> Vector2:
return Vector2(max(a.x, b.x), lerp(a.y, b.y, Commons.step(a.x, b.x)));
#vec2 sdf3d_smooth_union(vec2 d1, vec2 d2, float k) {
# float h = clamp(0.5+0.5*(d2.x-d1.x)/k, 0.0, 1.0);
# return vec2(mix(d2.x, d1.x, h)-k*h*(1.0-h), mix(d2.y, d1.y, step(d1.x, d2.x)));
#}
static func sdf3d_smooth_union(d1 : Vector2, d2 : Vector2, k : float) -> Vector2:
var h : float = clamp(0.5 + 0.5 * (d2.x - d1.x) / k, 0.0, 1.0);
return Vector2(lerp(d2.x, d1.x, h)-k*h*(1.0 - h), lerp(d2.y, d1.y, Commons.step(d1.x, d2.x)));
#vec2 sdf3d_smooth_subtraction(vec2 d1, vec2 d2, float k ) {
# float h = clamp(0.5-0.5*(d2.x+d1.x)/k, 0.0, 1.0);
# return vec2(mix(d2.x, -d1.x, h )+k*h*(1.0-h), d2.y);
#}
static func sdf3d_smooth_subtraction(d1 : Vector2, d2 : Vector2, k : float) -> Vector2:
var h : float = clamp(0.5 - 0.5 * (d2.x + d1.x) / k, 0.0, 1.0);
return Vector2(lerp(d2.x, -d1.x, h )+k*h*(1.0-h), d2.y);
#vec2 sdf3d_smooth_intersection(vec2 d1, vec2 d2, float k ) {
# float h = clamp(0.5-0.5*(d2.x-d1.x)/k, 0.0, 1.0);
# return vec2(mix(d2.x, d1.x, h)+k*h*(1.0-h), mix(d1.y, d2.y, step(d1.x, d2.x)));
#}
static func sdf3d_smooth_intersection(d1 : Vector2, d2 : Vector2, k : float) -> Vector2:
var h : float = clamp(0.5 - 0.5 * (d2.x - d1.x) / k, 0.0, 1.0);
return Vector2(lerp(d2.x, d1.x, h)+k*h*(1.0-h), lerp(d1.y, d2.y, Commons.step(d1.x, d2.x)));
@ -568,3 +765,20 @@ static func circle_repeat_transform(p : Vector3, count : float) -> Vector3:
#todo this needs to be solved
static func sdf3d_input(p : Vector3) -> Vector2:
return sdf3d_sphere(p, 0.5)
#raymarching_preview.mmg
#vec3 render_$name(vec2 uv) {
# vec3 p = vec3(uv, 2.0-raymarch_$name(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
# vec3 n = normal_$name(p);
# vec3 l = vec3(5.0, 5.0, 10.0);
# vec3 ld = normalize(l-p);
#
# float o = step(p.z, 0.001);
# float shadow = 1.0-0.75*step(raymarch_$name(l, -ld), length(l-p)-0.01);
# float light = 0.3+0.7*dot(n, ld)*shadow;
#
# return vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light;
#}
#static func sdf3d_render(p : Vector2) -> Vector3:
# return Vector3()

View File

@ -1,53 +0,0 @@
{
"name": "raymarching",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
},
"shader_model": {
"code": "vec2 $(name_uv)_d = raymarch_$name($uv);\n",
"global": "",
"inputs": [
{
"default": "vec2(0.0, 0.0)",
"function": true,
"label": "",
"longdesc": "The input object, described as 3D signed distance function with color index",
"name": "sdf",
"shortdesc": "Input",
"type": "sdf3dc"
}
],
"instance": "vec2 raymarch_$name(vec2 uv) {\n\tvec3 ro = vec3(uv-vec2(0.5), 1.0);\n\tvec3 rd = vec3(0.0, 0.0, -1.0);\n\tfloat dO = 0.0;\n\tfloat c = 0.0;\n for (int i=0; i < 100; i++) {\n \tvec3 p = ro + rd*dO;\n vec2 dS = $sdf(p);\n dO += dS.x;\n\n if (dO >= 1.0) {\n\t\t\tbreak;\n\t\t} else if (dS.x < 0.0001) {\n\t\t\tc = dS.y;\n\t\t\tbreak;\n\t\t}\n }\n \n return vec2(dO, c);\n}\n\nvec3 normal_$name(vec3 p) {\n\tif (p.z <= 0.0) {\n\t\treturn vec3(0.0, 0.0, 1.0);\n\t}\n\n\tfloat d = $sdf(p).x;\n float e = .001;\n \n vec3 n = d - vec3(\n $sdf(p-vec3(e, 0.0, 0.0)).x,\n $sdf(p-vec3(0.0, e, 0.0)).x,\n $sdf(p-vec3(0.0, 0.0, e)).x);\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n",
"longdesc": "Raymarches a 3D object (described as signed distance function with optional color index) to render a heightmap, a normal map and a color index map.",
"name": "Render",
"outputs": [
{
"f": "1.0-$(name_uv)_d.x",
"longdesc": "The generated height map",
"shortdesc": "HeightMap",
"type": "f"
},
{
"longdesc": "The generated normal map",
"rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d.x))",
"shortdesc": "NormalMap",
"type": "rgb"
},
{
"f": "$(name_uv)_d.y",
"longdesc": "The generated color index map",
"shortdesc": "ColorMap",
"type": "f"
}
],
"parameters": [
],
"shortdesc": "Render"
},
"type": "shader"
}

View File

@ -1,35 +0,0 @@
{
"name": "raymarching_preview",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"function": true,
"label": "",
"name": "sdf",
"type": "sdf3d"
}
],
"instance": "float calcdist_$name(vec3 p) {\n return min($sdf(p), p.z);\n}\n\nfloat raymarch_$name(vec3 ro, vec3 rd) {\n\tfloat d=0.0;\n\tfor (int i = 0; i < 50; i++) {\n\t\tvec3 p = ro + rd*d;\n\t\tfloat dstep = calcdist_$name(p);\n\t\td += dstep;\n\t\tif (dstep < 0.0001) break;\n\t}\n\treturn d;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = calcdist_$name(p);\n\tfloat e = .0001;\n\tvec3 n = d - vec3(calcdist_$name(p-vec3(e, 0.0, 0.0)), calcdist_$name(p-vec3(0.0, e, 0.0)), calcdist_$name(p-vec3(0.0, 0.0, e)));\n\treturn normalize(n);\n}\n\nvec3 render_$name(vec2 uv) {\n\tvec3 p = vec3(uv, 2.0-raymarch_$name(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n\tvec3 n = normal_$name(p);\n\tvec3 l = vec3(5.0, 5.0, 10.0);\n\tvec3 ld = normalize(l-p);\n\tfloat o = step(p.z, 0.001);\n\tfloat shadow = 1.0-0.75*step(raymarch_$name(l, -ld), length(l-p)-0.01);\n\tfloat light = 0.3+0.7*dot(n, ld)*shadow;\n\treturn vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light;\n}\n",
"name": "Preview",
"outputs": [
{
"rgb": "render_$name($uv-vec2(0.5))",
"type": "rgb"
}
],
"parameters": [
]
},
"type": "shader"
}

View File

@ -1,77 +0,0 @@
{
"name": "sdf3d_elongation",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"x": 0.2,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "vec2(100, 0.0)",
"label": "",
"longdesc": "The input object to be elongated",
"name": "in",
"shortdesc": "Input",
"type": "sdf3dc"
}
],
"instance": "",
"longdesc": "Elongates its input",
"name": "Elongation",
"outputs": [
{
"longdesc": "The shape generated by the operation",
"sdf3dc": "$in($uv-clamp($uv, -abs(vec3($x, $y, $z)), abs(vec3($x, $y, $z))))",
"shortdesc": "Output",
"type": "sdf3dc"
}
],
"parameters": [
{
"control": "P1.x",
"default": 0,
"label": "X",
"longdesc": "The elongation along the X axis",
"max": 1,
"min": 0,
"name": "x",
"shortdesc": "Length.x",
"step": 0.01,
"type": "float"
},
{
"control": "P1.y",
"default": 0,
"label": "Y",
"longdesc": "The elongation along the Y axis",
"max": 1,
"min": 0,
"name": "y",
"shortdesc": "Length.y",
"step": 0.01,
"type": "float"
},
{
"control": "None",
"default": 0,
"label": "Z",
"longdesc": "The elongation along the Z axis",
"max": 1,
"min": 0,
"name": "z",
"shortdesc": "Length.z",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Elongation"
},
"type": "shader"
}

View File

@ -1,51 +0,0 @@
{
"name": "sdf3d_extrusion",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"d": 0.3
},
"shader_model": {
"code": "vec2 $(name_uv)_w = vec2($in($uv.xz+vec2(0.5)),abs($uv.y)-$d);\n",
"global": "",
"inputs": [
{
"default": "100.0",
"label": "",
"longdesc": "The input 2D shape as a signed distance function",
"name": "in",
"shortdesc": "Input",
"type": "sdf2d"
}
],
"instance": "",
"longdesc": "Extrudes its 2D input shape along the Y axis",
"name": "Extrusion",
"outputs": [
{
"longdesc": "The extruded shape",
"sdf3d": "min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0))",
"shortdesc": "Output",
"type": "sdf3d"
}
],
"parameters": [
{
"control": "None",
"default": 0.25,
"label": "",
"longdesc": "The length of the extrusion operation",
"max": 1,
"min": 0,
"name": "d",
"shortdesc": "Length",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Extrusion"
},
"type": "shader"
}

View File

@ -1,59 +0,0 @@
{
"name": "sdf3d_morph",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"amount": 0.5
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "10.0",
"label": "",
"longdesc": "The first shape, defined as a signed distance function",
"name": "in1",
"shortdesc": "Input1",
"type": "sdf3d"
},
{
"default": "10.0",
"label": "",
"longdesc": "The second shape, defined as a signed distance function",
"name": "in2",
"shortdesc": "Input2",
"type": "sdf3d"
}
],
"instance": "",
"longdesc": "Morphs between 2 input shapes",
"name": "Morph",
"outputs": [
{
"longdesc": "The generated hybrid shape",
"sdf3d": "mix($in1($uv), $in2($uv), $amount)",
"shortdesc": "Output",
"type": "sdf3d"
}
],
"parameters": [
{
"control": "None",
"default": 0.5,
"label": "",
"longdesc": "The amount of the second input in the result",
"max": 1,
"min": 0,
"name": "amount",
"shortdesc": "Amount",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Morph"
},
"type": "shader"
}

View File

@ -1,51 +0,0 @@
{
"name": "sdf3d_revolution",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"d": 0.25
},
"shader_model": {
"code": "vec2 $(name_uv)_q = vec2(length($uv.xy)-$d+0.5, $uv.z+0.5);\n",
"global": "",
"inputs": [
{
"default": "10.0",
"label": "",
"longdesc": "The input shape",
"name": "in",
"shortdesc": "Input",
"type": "sdf2d"
}
],
"instance": "",
"longdesc": "Revolves its input 2D shape around the Z axis",
"name": "Revolution",
"outputs": [
{
"longdesc": "The generated 3D object",
"sdf3d": "$in($(name_uv)_q)",
"shortdesc": "Output",
"type": "sdf3d"
}
],
"parameters": [
{
"control": "None",
"default": 0.25,
"label": "",
"longdesc": "The offset applied to the input shape during the revolution operation",
"max": 1,
"min": 0,
"name": "d",
"shortdesc": "Offset",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Revolution"
},
"type": "shader"
}

View File

@ -1,51 +0,0 @@
{
"name": "sdf3d_rounded",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"r": 0.15
},
"shader_model": {
"code": "vec2 $(name_uv)_v = $in($uv);",
"global": "",
"inputs": [
{
"default": "vec2(100, 0.0)",
"label": "",
"longdesc": "The input shape, defined as a signed distance function",
"name": "in",
"shortdesc": "Input",
"type": "sdf3dc"
}
],
"instance": "",
"longdesc": "Dilates an input shape into a rounded shape",
"name": "Rounded",
"outputs": [
{
"longdesc": "The shape generated by the operation",
"sdf3dc": "vec2($(name_uv)_v.x-$r, $(name_uv)_v.y)",
"shortdesc": "Output",
"type": "sdf3dc"
}
],
"parameters": [
{
"control": "None",
"default": 0,
"label": "",
"longdesc": "The length of the dilate operation",
"max": 1,
"min": 0,
"name": "r",
"shortdesc": "Radius",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "RoundedShape"
},
"type": "shader"
}

View File

@ -1,51 +0,0 @@
{
"name": "sdf3d_scale",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"s": 1
},
"shader_model": {
"code": "vec2 $(name_uv)_in = $in(($uv)/$s);",
"global": "",
"inputs": [
{
"default": "vec2(100.0, 0.0)",
"label": "",
"longdesc": "The input object as a signed distance function",
"name": "in",
"shortdesc": "Input",
"type": "sdf3dc"
}
],
"instance": "",
"longdesc": "Scales its input 3D object described as a signed distance function.",
"name": "Scale",
"outputs": [
{
"longdesc": "The scaled object",
"sdf3dc": "vec2($(name_uv)_in.x*$s, $(name_uv)_in.y)",
"shortdesc": "Output",
"type": "sdf3dc"
}
],
"parameters": [
{
"control": "Scale1.x",
"default": 1,
"label": "",
"longdesc": "The scale factor",
"max": 5,
"min": 0,
"name": "s",
"shortdesc": "Scale",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Scale"
},
"type": "shader"
}

View File

@ -1,82 +0,0 @@
{
"name": "sdf3d_smoothboolean",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"k": 0.15,
"op": 0
},
"shader_model": {
"code": "",
"global": "vec2 sdf3d_smooth_union(vec2 d1, vec2 d2, float k) {\n float h = clamp(0.5+0.5*(d2.x-d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, d1.x, h)-k*h*(1.0-h), mix(d2.y, d1.y, step(d1.x, d2.x)));\n}\n\nvec2 sdf3d_smooth_subtraction(vec2 d1, vec2 d2, float k ) {\n float h = clamp(0.5-0.5*(d2.x+d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, -d1.x, h )+k*h*(1.0-h), d2.y);\n}\n\nvec2 sdf3d_smooth_intersection(vec2 d1, vec2 d2, float k ) {\n float h = clamp(0.5-0.5*(d2.x-d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, d1.x, h)+k*h*(1.0-h), mix(d1.y, d2.y, step(d1.x, d2.x)));\n}\n",
"inputs": [
{
"default": "vec2(100.0, 0.0)",
"label": "",
"longdesc": "The first shape, defined as a signed distance function",
"name": "in1",
"shortdesc": "Input1",
"type": "sdf3dc"
},
{
"default": "vec2(100.0, 0.0)",
"label": "",
"longdesc": "The second shape, defined as a signed distance function",
"name": "in2",
"shortdesc": "Input2",
"type": "sdf3dc"
}
],
"instance": "",
"longdesc": "Performs a smooth boolean operation (union, intersection or difference) between two shapes",
"name": "SmoothBoolean",
"outputs": [
{
"longdesc": "The shape generated by the boolean operation",
"sdf3dc": "sdf3d_smooth_$op($in1($uv), $in2($uv), $k)",
"shortdesc": "Output",
"type": "sdf3dc"
}
],
"parameters": [
{
"default": 2,
"label": "",
"longdesc": "The operation performed by this node",
"name": "op",
"shortdesc": "Operation",
"type": "enum",
"values": [
{
"name": "Union",
"value": "union"
},
{
"name": "Subtraction",
"value": "subtraction"
},
{
"name": "Intersection",
"value": "intersection"
}
]
},
{
"control": "None",
"default": 0,
"label": "",
"longdesc": "The smoothness of the boolean operation",
"max": 1,
"min": 0,
"name": "k",
"shortdesc": "Smoothness",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "SmoothBoolean"
},
"type": "shader"
}

View File

@ -1,77 +0,0 @@
{
"name": "sdf3d_translate",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"x": 0,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "vec2(100.0, 0.0)",
"label": "",
"longdesc": "The input object as a signed distance function",
"name": "in",
"shortdesc": "Input",
"type": "sdf3dc"
}
],
"instance": "",
"longdesc": "Translates its input 3D object described as a signed distance function.",
"name": "Translate",
"outputs": [
{
"longdesc": "The translated object",
"sdf3dc": "$in($uv-vec3($x, $y, $z))",
"shortdesc": "Output",
"type": "sdf3dc"
}
],
"parameters": [
{
"control": "P1.x",
"default": 0,
"label": "X",
"longdesc": "The translation along the X axis",
"max": 1,
"min": -1,
"name": "x",
"shortdesc": "Translate.x",
"step": 0.01,
"type": "float"
},
{
"control": "P1.y",
"default": 0,
"label": "Y",
"longdesc": "The translation along the Y axis",
"max": 1,
"min": -1,
"name": "y",
"shortdesc": "Translate.y",
"step": 0.01,
"type": "float"
},
{
"control": "None",
"default": 0,
"label": "Z",
"longdesc": "The translation along the Z axis",
"max": 1,
"min": -1,
"name": "z",
"shortdesc": "Translate.z",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Translate"
},
"type": "shader"
}