material-maker/addons/material_maker/examples/raymarching.ptex

389 lines
6.5 KiB
Plaintext
Raw Normal View History

{
"connections": [
{
"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": "_4_2_3",
"from_port": 0,
"to": "sdf3d_revolution",
"to_port": 0
},
{
"from": "sdf3d_revolution",
"from_port": 0,
"to": "sdrotate",
"to_port": 0
},
{
2019-12-18 23:18:28 +01:00
"from": "raymarching",
"from_port": 1,
"to": "Material",
2019-12-18 23:18:28 +01:00
"to_port": 4
},
{
2019-12-18 23:18:28 +01:00
"from": "sdrotate",
"from_port": 0,
2019-12-18 23:18:28 +01:00
"to": "raymarching",
"to_port": 0
},
{
2019-12-18 23:18:28 +01:00
"from": "uniform",
"from_port": 0,
"to": "Material",
"to_port": 0
},
{
2019-12-18 23:18:28 +01:00
"from": "uniform",
"from_port": 0,
"to": "Material",
"to_port": 1
}
],
"label": "Graph",
"name": "49",
"node_position": {
"x": 0,
"y": 0
},
"nodes": [
{
"name": "Material",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -336,
"y": 266
},
"parameters": {
"albedo_color": {
"a": 1,
"b": 1,
"g": 1,
"r": 1,
"type": "Color"
},
"ao_light_affect": 1,
"depth_scale": 1,
"emission_energy": 1,
"metallic": 1,
"normal_scale": 1,
"roughness": 1,
"size": 11,
"subsurf_scatter_strength": 0
},
"type": "material"
},
{
2019-12-18 23:18:28 +01:00
"name": "sdrotate",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -722.057617,
"y": 347.909668
},
"parameters": {
2019-12-18 23:18:28 +01:00
"a": 0,
"ax": 18,
"ay": -28,
"az": -29,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
2019-12-18 23:18:28 +01:00
"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": "",
2019-12-18 23:18:28 +01:00
"name": "in",
"type": "sdf3d"
}
],
2019-12-18 23:18:28 +01:00
"instance": "",
"name": "Rotate",
"outputs": [
{
2019-12-18 23:18:28 +01:00
"sdf3d": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))",
"type": "sdf3d"
}
],
"parameters": [
2019-12-18 23:18:28 +01:00
{
"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"
},
{
2019-12-18 23:18:28 +01:00
"name": "sdrhombus_2",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -1116.057617,
"y": 261.159668
},
"parameters": {
2019-12-18 23:18:28 +01:00
"cx": 0,
"cy": 0,
"h": 0.29,
"r": 0.3,
"w": 0.3
},
2019-12-18 23:18:28 +01:00
"type": "sdrhombus"
},
{
2019-12-18 23:18:28 +01:00
"name": "sdbox",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -1119.057617,
"y": 401.159668
},
"parameters": {
"cx": 0,
"cy": 0,
2019-12-18 23:18:28 +01:00
"h": 0.2,
"r": 0.3,
2019-12-18 23:18:28 +01:00
"w": 0.2
},
"shader_model": {
2019-12-18 23:18:28 +01:00
"code": "vec2 $(name_uv)_d = abs($uv-0.5*vec2($cx+1.0, $cy+1.0))-vec2($w, $h);\n",
"global": "",
"inputs": [
],
"instance": "",
2019-12-18 23:18:28 +01:00
"name": "sdBox",
"outputs": [
{
2019-12-18 23:18:28 +01:00
"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,
2019-12-18 23:18:28 +01:00
"label": "Width",
"max": 1,
"min": 0,
2019-12-18 23:18:28 +01:00
"name": "w",
"step": 0.01,
"type": "float"
},
{
2019-12-18 23:18:28 +01:00
"default": 1,
"label": "Height",
"max": 1,
"min": 0,
2019-12-18 23:18:28 +01:00
"name": "h",
"step": 0.01,
"type": "float"
},
{
2019-12-18 23:18:28 +01:00
"default": 0,
"label": "Center X",
"max": 1,
2019-12-18 23:18:28 +01:00
"min": -1,
"name": "cx",
"step": 0.01,
"type": "float"
},
{
2019-12-18 23:18:28 +01:00
"default": 0,
"label": "Center Y",
"max": 1,
2019-12-18 23:18:28 +01:00
"min": -1,
"name": "cy",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
2019-12-18 23:18:28 +01:00
"name": "sdboolean",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -894.057617,
"y": 297.159668
},
"parameters": {
"bevel": 0,
"cx": 0,
"cy": 0,
"h": 0.08,
2019-12-18 23:18:28 +01:00
"op": 0,
"r": 0.3,
"w": 0.28
},
2019-12-18 23:18:28 +01:00
"type": "sdboolean"
},
{
2019-12-18 23:18:28 +01:00
"name": "_4_2_3",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -903.047241,
"y": 363.697357
},
"parameters": {
"x": 0,
"y": 0,
"z": 0
},
"shader_model": {
"code": "",
"global": "",
"inputs": [
{
"default": "0.0",
"label": "",
"name": "in",
2019-12-18 23:18:28 +01:00
"type": "sdf2d"
}
],
"instance": "",
2019-12-18 23:18:28 +01:00
"name": "Translate",
"outputs": [
{
2019-12-18 23:18:28 +01:00
"sdf2d": "$in($uv-vec2($x, $y))",
"type": "sdf2d"
}
],
"parameters": [
{
2019-12-18 23:18:28 +01:00
"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"
},
{
2019-12-18 23:18:28 +01:00
"name": "sdf3d_revolution",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -714.403931,
"y": 295.330994
},
"parameters": {
"a": 0,
2019-12-18 23:18:28 +01:00
"d": 0.43,
"s": 1,
"x": 0.35,
"y": 0,
"z": 0
},
"shader_model": {
2019-12-18 23:18:28 +01:00
"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",
2019-12-18 23:18:28 +01:00
"type": "sdf2d"
}
],
"instance": "",
2019-12-18 23:18:28 +01:00
"name": "Extrusion",
"outputs": [
{
2019-12-18 23:18:28 +01:00
"sdf3d": "min(max($(name_uv)_w.x,$(name_uv)_w.y),0.0)+length(max($(name_uv)_w,0.0))",
"type": "sdf3d"
}
],
"parameters": [
{
2019-12-18 23:18:28 +01:00
"default": 0.25,
"label": "",
"max": 1,
"min": 0,
"name": "d",
"step": 0.01,
"type": "float"
}
]
},
"type": "shader"
},
{
2019-12-18 23:18:28 +01:00
"name": "raymarching",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -522.23468,
"y": 348.748474
},
"parameters": {
2019-12-18 23:18:28 +01:00
},
2019-12-18 23:18:28 +01:00
"type": "raymarching"
},
{
2019-12-18 23:18:28 +01:00
"name": "uniform",
"node_position": {
2019-12-18 23:18:28 +01:00
"x": -576.760742,
"y": 211.755493
},
"parameters": {
2019-12-18 23:18:28 +01:00
"color": {
"a": 1,
"b": 1,
"g": 0.415686,
"r": 0,
"type": "Color"
}
},
2019-12-18 23:18:28 +01:00
"type": "uniform"
}
],
"parameters": {
},
"type": "graph"
}