More signed distance functions nodes...

This commit is contained in:
RodZill4 2019-12-15 16:21:15 +01:00
parent e919507f06
commit 864e4e9fe8
9 changed files with 927 additions and 318 deletions

View File

@ -1,11 +1,5 @@
{
"connections": [
{
"from": "_3",
"from_port": 1,
"to": "Material",
"to_port": 4
},
{
"from": "perlin",
"from_port": 0,
@ -18,54 +12,12 @@
"to": "Material",
"to_port": 2
},
{
"from": "sdf3d_sphere",
"from_port": 0,
"to": "_4",
"to_port": 0
},
{
"from": "sdf3d_sphere",
"from_port": 0,
"to": "_4_2",
"to_port": 0
},
{
"from": "_4",
"from_port": 0,
"to": "sdf3d_boolean",
"to_port": 0
},
{
"from": "_4_2",
"from_port": 0,
"to": "sdf3d_boolean",
"to_port": 1
},
{
"from": "sdf3d_boolean",
"from_port": 0,
"to": "_4_2_2",
"to_port": 0
},
{
"from": "_4_2_2",
"from_port": 0,
"to": "sdf3d_smoothboolean",
"to_port": 0
},
{
"from": "sdf3d_box",
"from_port": 0,
"to": "sdf3d_smoothboolean",
"to_port": 1
},
{
"from": "sdf3d_torus",
"from_port": 0,
"to": "_4_2_2_2",
"to_port": 0
},
{
"from": "sdf3d_smoothboolean",
"from_port": 0,
@ -73,15 +25,105 @@
"to_port": 1
},
{
"from": "_4_2_2_2",
"from": "sdf3d_smoothboolean_2",
"from_port": 0,
"to": "_3",
"to_port": 0
},
{
"from": "sdf3d_torus",
"from_port": 0,
"to": "sdf3d_translate",
"to_port": 0
},
{
"from": "sdf3d_translate",
"from_port": 0,
"to": "sdf3d_smoothboolean_2",
"to_port": 0
},
{
"from": "sdf3d_sphere",
"from_port": 0,
"to": "sdf3d_translate_2",
"to_port": 0
},
{
"from": "sdf3d_translate_2",
"from_port": 0,
"to": "sdf3d_boolean",
"to_port": 0
},
{
"from": "sdf3d_sphere",
"from_port": 0,
"to": "sdf3d_translate_2_2",
"to_port": 0
},
{
"from": "sdf3d_translate_2_2",
"from_port": 0,
"to": "sdf3d_boolean",
"to_port": 1
},
{
"from": "sdf3d_boolean",
"from_port": 0,
"to": "sdf3d_translate_3",
"to_port": 0
},
{
"from": "sdf3d_translate_3",
"from_port": 0,
"to": "sdf3d_smoothboolean",
"to_port": 0
},
{
"from": "sdf3d_smoothboolean_2",
"from_port": 0,
"to": "_3",
"to": "sdscale",
"to_port": 0
},
{
"from": "sdbox",
"from_port": 0,
"to": "sdboolean",
"to_port": 1
},
{
"from": "sdrhombus_2",
"from_port": 0,
"to": "sdboolean",
"to_port": 0
},
{
"from": "sdboolean",
"from_port": 0,
"to": "_4_2_3",
"to_port": 0
},
{
"from": "sdrotate",
"from_port": 0,
"to": "_3_2",
"to_port": 0
},
{
"from": "_3_2",
"from_port": 1,
"to": "Material",
"to_port": 4
},
{
"from": "_4_2_3",
"from_port": 0,
"to": "sdf3d_revolution",
"to_port": 0
},
{
"from": "sdf3d_revolution",
"from_port": 0,
"to": "sdrotate",
"to_port": 0
}
],
@ -95,8 +137,8 @@
{
"name": "Material",
"node_position": {
"x": -36,
"y": -273
"x": -252,
"y": 252
},
"parameters": {
"albedo_color": {
@ -120,8 +162,8 @@
{
"name": "_3",
"node_position": {
"x": -424.5,
"y": -165
"x": -563.5,
"y": -507
},
"parameters": {
@ -159,8 +201,8 @@
{
"name": "perlin",
"node_position": {
"x": -511.535645,
"y": -348.25
"x": -523.535645,
"y": -5.25
},
"parameters": {
"iterations": 5,
@ -173,8 +215,8 @@
{
"name": "colorize",
"node_position": {
"x": -260.535645,
"y": -304.25
"x": -504.535645,
"y": 119.75
},
"parameters": {
"gradient": {
@ -207,73 +249,11 @@
},
"type": "colorize"
},
{
"name": "_4",
"node_position": {
"x": -1008.238525,
"y": -303.85495
},
"parameters": {
"x": -0.17,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf3d": "$in($uv+vec3($x, $y, $z))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 1,
"min": -1,
"name": "z",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "sdf3d_boolean",
"node_position": {
"x": -821.049805,
"y": -365.10495
"x": -985.049805,
"y": -699.10498
},
"parameters": {
"bevel": 0,
@ -289,8 +269,8 @@
{
"name": "sdf3d_box",
"node_position": {
"x": -1025.376221,
"y": -92.60495
"x": -1189.376221,
"y": -426.60495
},
"parameters": {
"r": 0.26,
@ -356,8 +336,8 @@
{
"name": "sdf3d_torus",
"node_position": {
"x": -819.376282,
"y": -100.60495
"x": -981.376282,
"y": -453.60495
},
"parameters": {
"R": 0.38,
@ -426,8 +406,8 @@
{
"name": "sdf3d_smoothboolean",
"node_position": {
"x": -822.049805,
"y": -189.10495
"x": -986.049805,
"y": -523.10498
},
"parameters": {
"bevel": 0,
@ -441,197 +421,11 @@
},
"type": "sdf3d_smoothboolean"
},
{
"name": "_4_2",
"node_position": {
"x": -1004.406982,
"y": -196.60495
},
"parameters": {
"x": 0.17,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf3d": "$in($uv+vec3($x, $y, $z))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 1,
"min": -1,
"name": "z",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "_4_2_2",
"node_position": {
"x": -808.049805,
"y": -300.60495
},
"parameters": {
"x": 0,
"y": 0.14,
"z": -0.23
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf3d": "$in($uv+vec3($x, $y, $z))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 1,
"min": -1,
"name": "z",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "_4_2_2_2",
"node_position": {
"x": -813.069458,
"y": 32.162903
},
"parameters": {
"x": 0,
"y": 0.19,
"z": -0.23
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf3d": "$in($uv+vec3($x, $y, $z))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 1,
"min": -1,
"name": "z",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "sdf3d_smoothboolean_2",
"node_position": {
"x": -621.569458,
"y": -171.337097
"x": -758.569458,
"y": -341.337097
},
"parameters": {
"bevel": 0,
@ -648,13 +442,416 @@
{
"name": "sdf3d_sphere",
"node_position": {
"x": -1000.049805,
"y": -359.10495
"x": -1164.049805,
"y": -693.10498
},
"parameters": {
"r": 0.07
},
"type": "sdf3d_sphere"
},
{
"name": "sdf3d_translate",
"node_position": {
"x": -977.057617,
"y": -329.090332
},
"parameters": {
"x": 0,
"y": -0.19,
"z": 0.23
},
"type": "sdf3d_translate"
},
{
"name": "sdf3d_translate_2",
"node_position": {
"x": -1172.057617,
"y": -640.590332
},
"parameters": {
"x": 0.17,
"y": 0,
"z": 0
},
"type": "sdf3d_translate"
},
{
"name": "sdf3d_translate_2_2",
"node_position": {
"x": -1171.057617,
"y": -537.090332
},
"parameters": {
"x": -0.17,
"y": 0,
"z": 0
},
"type": "sdf3d_translate"
},
{
"name": "sdf3d_translate_3",
"node_position": {
"x": -983.057617,
"y": -640.340332
},
"parameters": {
"x": 0,
"y": -0.12,
"z": 0.23
},
"type": "sdf3d_translate"
},
{
"name": "sdscale",
"node_position": {
"x": -972.057617,
"y": -229.090332
},
"parameters": {
"a": 0,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Scale",
"outputs": [
{
"sdf3d": "$in(($uv)/$s)*$s",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 1,
"label": "",
"max": 5,
"min": 0,
"name": "s",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "sdrotate",
"node_position": {
"x": -729.057617,
"y": 370.909668
},
"parameters": {
"a": 0,
"ax": 18,
"ay": -28,
"az": -29,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "vec3 rotate3d(vec3 p, vec3 a) {\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Rotate",
"outputs": [
{
"sdf3d": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 180,
"min": -180,
"name": "ax",
"step": 1,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 180,
"min": -180,
"name": "ay",
"step": 1,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 180,
"min": -180,
"name": "az",
"step": 1,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "sdrhombus_2",
"node_position": {
"x": -1116.057617,
"y": 261.159668
},
"parameters": {
"cx": 0,
"cy": 0,
"h": 0.29,
"r": 0.3,
"w": 0.3
},
"type": "sdrhombus"
},
{
"name": "sdbox",
"node_position": {
"x": -1119.057617,
"y": 401.159668
},
"parameters": {
"cx": 0,
"cy": 0,
"h": 0.2,
"r": 0.3,
"w": 0.2
},
"shader_model": {
"code": "vec2 $(name_uv)_d = abs($uv-0.5*vec2($cx+1.0, $cy+1.0))-vec2($w, $h);\n",
"global": "",
"inputs": [
],
"instance": "",
"name": "sdBox",
"outputs": [
{
"sdf2d": "length(max($(name_uv)_d,vec2(0)))+min(max($(name_uv)_d.x,$(name_uv)_d.y),0.0)",
"type": "sdf2d"
}
],
"parameters": [
{
"default": 0.5,
"label": "Width",
"max": 1,
"min": 0,
"name": "w",
"step": 0.01,
"type": "float"
},
{
"default": 1,
"label": "Height",
"max": 1,
"min": 0,
"name": "h",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Center X",
"max": 1,
"min": -1,
"name": "cx",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Center Y",
"max": 1,
"min": -1,
"name": "cy",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "sdboolean",
"node_position": {
"x": -894.057617,
"y": 297.159668
},
"parameters": {
"bevel": 0,
"cx": 0,
"cy": 0,
"h": 0.08,
"op": 0,
"r": 0.3,
"w": 0.28
},
"type": "sdboolean"
},
{
"name": "_4_2_3",
"node_position": {
"x": -903.047241,
"y": 363.697357
},
"parameters": {
"x": 0,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf2d": "$in($uv-vec2($x, $y))",
"type": "sdf2d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
"name": "_3_2",
"node_position": {
"x": -567.336426,
"y": 335.947357
},
"parameters": {
},
"shader_model": {
"code": "float $(name_uv)_d = raymarch_$name($uv);\n",
"global": "",
"inputs": [
{
"default": "0.0",
"function": true,
"label": "",
"name": "sdf",
"type": "sdf3d"
}
],
"instance": "float input_$name(vec3 p) {\n\treturn min($sdf(p), p.z);\n}\n\nfloat 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.;\n \n for (int i=0; i < 50; i++) {\n \tvec3 p = ro + rd*dO;\n float dS = input_$name(p);\n dO += dS;\n if (dO > 0.001 && dS < 0.0001) break;\n }\n \n return dO;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = input_$name(p);\n float e = .001;\n \n vec3 n = d - vec3(\n input_$name(p-vec3(e, 0.0, 0.0)),\n input_$name(p-vec3(0.0, e, 0.0)),\n input_$name(p-vec3(0.0, 0.0, e)));\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n",
"name": "Raymarching",
"outputs": [
{
"f": "1.0-$(name_uv)_d",
"type": "f"
},
{
"rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d))",
"type": "rgb"
}
],
"parameters": [
]
},
"type": "shader"
},
{
"name": "sdf3d_revolution",
"node_position": {
"x": -723.403931,
"y": 294.330994
},
"parameters": {
"a": 0,
"d": 0.43,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "vec2 $(name_uv)_w = vec2($in($uv.xz+vec2(0.5)),abs($uv.y)-$d);\n",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Extrusion",
"outputs": [
{
"sdf3d": "min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0.25,
"label": "",
"max": 1,
"min": 0,
"name": "d",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}
],
"parameters": {

View File

@ -0,0 +1,47 @@
{
"name": "sdf3d_extrusion",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"d": 0.5,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "vec2 $(name_uv)_w = vec2($in($uv.xz+vec2(0.5)),abs($uv.y)-$d);\n",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Extrusion",
"outputs": [
{
"sdf3d": "min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0.25,
"label": "",
"max": 1,
"min": 0,
"name": "d",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,47 @@
{
"name": "sdf3d_revolution",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"d": 0.25,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "vec2 $(name_uv)_q = vec2(length($uv.xy)-$d+0.5, $uv.z+0.5);\n",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Revolution",
"outputs": [
{
"sdf3d": "$in($(name_uv)_q)",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0.25,
"label": "",
"max": 1,
"min": 0,
"name": "d",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,66 @@
{
"name": "sdf3d_rotate",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"ax": 0,
"ay": 0,
"az": 0,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "vec3 rotate3d(vec3 p, vec3 a) {\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Rotate",
"outputs": [
{
"sdf3d": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 180,
"min": -180,
"name": "ax",
"step": 1,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 180,
"min": -180,
"name": "ay",
"step": 1,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 180,
"min": -180,
"name": "az",
"step": 1,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,46 @@
{
"name": "sdf3d_scale",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "vec2 rotate(vec2 uv, float a) {\n\tvec2 rv;\n\tfloat c = cos(a);\n\tfloat s = sin(a);\n\tuv -= vec2(0.5);\n\trv.x = uv.x*c+uv.y*s;\n\trv.y = -uv.x*s+uv.y*c;\n\treturn rv+vec2(0.5);\n}\n",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Scale",
"outputs": [
{
"sdf3d": "$in(($uv)/$s)*$s",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 1,
"label": "",
"max": 5,
"min": 0,
"name": "s",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,62 @@
{
"name": "sdf3d_translate",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"x": 0,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf3d": "$in($uv-vec3($x, $y, $z))",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Z",
"max": 1,
"min": -1,
"name": "z",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,45 @@
{
"name": "sdrotate",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "vec2 rotate(vec2 uv, float a) {\n\tvec2 rv;\n\tfloat c = cos(a);\n\tfloat s = sin(a);\n\tuv -= vec2(0.5);\n\trv.x = uv.x*c+uv.y*s;\n\trv.y = -uv.x*s+uv.y*c;\n\treturn rv+vec2(0.5);\n}\n",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Rotate",
"outputs": [
{
"sdf2d": "$in(rotate($uv, $a*0.01745329251))",
"type": "sdf2d"
}
],
"parameters": [
{
"default": 0,
"label": "",
"max": 180,
"min": -180,
"name": "a",
"step": 1,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,46 @@
{
"name": "sdscale",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"a": 0,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf3d"
}
],
"instance": "",
"name": "Scale",
"outputs": [
{
"sdf3d": "$in(($uv)/$s)*$s",
"type": "sdf3d"
}
],
"parameters": [
{
"default": 1,
"label": "",
"max": 5,
"min": 0,
"name": "s",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -0,0 +1,53 @@
{
"name": "sdtranslate",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"x": 0,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
"type": "sdf2d"
}
],
"instance": "",
"name": "Translate",
"outputs": [
{
"sdf2d": "$in($uv-vec2($x, $y))",
"type": "sdf2d"
}
],
"parameters": [
{
"default": 0,
"label": "X",
"max": 1,
"min": -1,
"name": "x",
"step": 0.01,
"type": "float"
},
{
"default": 0,
"label": "Y",
"max": 1,
"min": -1,
"name": "y",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
}