Added behive and generic truchet nodes, update bricks

This commit is contained in:
RodZill4 2019-11-30 18:54:46 +01:00
parent e251cb3af6
commit f05c8a408b
5 changed files with 448 additions and 8 deletions

View File

@ -0,0 +1,340 @@
{
"connections": [
{
"from": "colorize_2",
"from_port": 0,
"to": "blend",
"to_port": 0
},
{
"from": "colorize",
"from_port": 0,
"to": "blend",
"to_port": 1
},
{
"from": "normal_map",
"from_port": 0,
"to": "Material",
"to_port": 4
},
{
"from": "blend",
"from_port": 0,
"to": "normal_map",
"to_port": 0
},
{
"from": "blend",
"from_port": 0,
"to": "colorize_3",
"to_port": 0
},
{
"from": "colorize_3",
"from_port": 0,
"to": "Material",
"to_port": 6
},
{
"from": "uniform_greyscale",
"from_port": 0,
"to": "Material",
"to_port": 1
},
{
"from": "colorize_4",
"from_port": 0,
"to": "Material",
"to_port": 2
},
{
"from": "colorize_5",
"from_port": 0,
"to": "Material",
"to_port": 0
},
{
"from": "blend",
"from_port": 0,
"to": "colorize_5",
"to_port": 0
},
{
"from": "blend",
"from_port": 0,
"to": "colorize_4",
"to_port": 0
},
{
"from": "beehive_2",
"from_port": 0,
"to": "colorize_2",
"to_port": 0
},
{
"from": "beehive_2",
"from_port": 1,
"to": "colorize",
"to_port": 0
}
],
"label": "Graph",
"name": "49",
"node_position": {
"x": 0,
"y": 0
},
"nodes": [
{
"name": "Material",
"node_position": {
"x": 134,
"y": -22
},
"parameters": {
"albedo_color": {
"a": 1,
"b": 1,
"g": 1,
"r": 1,
"type": "Color"
},
"ao_light_affect": 1,
"depth_scale": 0.2,
"emission_energy": 1,
"metallic": 1,
"normal_scale": 1,
"roughness": 1,
"size": 11,
"subsurf_scatter_strength": 0
},
"type": "material"
},
{
"name": "colorize",
"node_position": {
"x": -489.5,
"y": 20
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 0,
"g": 0,
"pos": 0,
"r": 0
},
{
"a": 1,
"b": 0.225431,
"g": 0.225431,
"pos": 0.583818,
"r": 0.225431
},
{
"a": 1,
"b": 0.96875,
"g": 0.96875,
"pos": 0.672727,
"r": 0.96875
}
],
"type": "Gradient"
}
},
"type": "colorize"
},
{
"name": "colorize_2",
"node_position": {
"x": -493.5,
"y": -42
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 1,
"g": 1,
"pos": 0,
"r": 1
},
{
"a": 1,
"b": 0.947917,
"g": 0.947917,
"pos": 0.049912,
"r": 0.947917
},
{
"a": 1,
"b": 0.115584,
"g": 0.115584,
"pos": 0.106977,
"r": 0.115584
},
{
"a": 1,
"b": 0,
"g": 0,
"pos": 0.290909,
"r": 0
}
],
"type": "Gradient"
}
},
"type": "colorize"
},
{
"name": "blend",
"node_position": {
"x": -528.009644,
"y": 89
},
"parameters": {
"amount": 1,
"blend_type": 9
},
"type": "blend"
},
{
"name": "normal_map",
"node_position": {
"x": -138.009644,
"y": 78
},
"parameters": {
"amount": 0.5,
"param0": 11,
"param1": 1.02,
"param2": 0,
"size": 4
},
"type": "normal_map"
},
{
"name": "colorize_3",
"node_position": {
"x": -132.009644,
"y": 208.5
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 1,
"g": 1,
"pos": 0,
"r": 1
},
{
"a": 1,
"b": 0,
"g": 0,
"pos": 1,
"r": 0
}
],
"type": "Gradient"
}
},
"type": "colorize"
},
{
"name": "uniform_greyscale",
"node_position": {
"x": -98.009644,
"y": -64.5
},
"parameters": {
"color": 0.16
},
"type": "uniform_greyscale"
},
{
"name": "colorize_4",
"node_position": {
"x": -153.009644,
"y": 10
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 0.65625,
"g": 0.65625,
"pos": 0.518182,
"r": 0.65625
},
{
"a": 1,
"b": 0,
"g": 0,
"pos": 0.890909,
"r": 0
}
],
"type": "Gradient"
}
},
"type": "colorize"
},
{
"name": "colorize_5",
"node_position": {
"x": -106.009644,
"y": -151
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 0,
"g": 0.068034,
"pos": 0,
"r": 0.098958
},
{
"a": 1,
"b": 0,
"g": 0.6875,
"pos": 0.881818,
"r": 1
}
],
"type": "Gradient"
}
},
"type": "colorize"
},
{
"name": "beehive_2",
"node_position": {
"x": -496.732483,
"y": -162.254547
},
"parameters": {
"sx": 20,
"sy": 12
},
"type": "beehive"
}
],
"parameters": {
},
"type": "graph"
}

View File

@ -0,0 +1,55 @@
{
"name": "beehive",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"sx": 4,
"sy": 4
},
"shader_model": {
"code": "vec2 $(name_uv)_uv = $uv*vec2($sx, $sy*1.73205080757);\nvec4 $(name_uv)_center = beehive_center($(name_uv)_uv);",
"global": "float beehive_dist(vec2 p){\n\tvec2 s = vec2(1.0, 1.73205080757);\n p = abs(p);\n return max(dot(p, s*.5), p.x);\n}\n\nvec4 beehive_center(vec2 p) {\n\tvec2 s = vec2(1.0, 1.73205080757);\n vec4 hC = floor(vec4(p, p - vec2(.5, 1))/vec4(s,s)) + .5;\n vec4 h = vec4(p - hC.xy*s, p - (hC.zw + .5)*s);\n return dot(h.xy, h.xy)<dot(h.zw, h.zw) ? vec4(h.xy, hC.xy) : vec4(h.zw, hC.zw + 9.73);\n}\n",
"inputs": [
],
"instance": "",
"name": "Beehive",
"outputs": [
{
"f": "1.0-2.0*beehive_dist($(name_uv)_center.xy)",
"type": "f"
},
{
"rgb": "rand3(fract($(name_uv)_center.zw/vec2($sx, $sy))+vec2($seed))",
"type": "rgb"
},
{
"rgb": "vec3(vec2(0.5)+$(name_uv)_center.xy, 0.0)",
"type": "rgb"
}
],
"parameters": [
{
"default": 2,
"label": "Size X",
"max": 64,
"min": 1,
"name": "sx",
"step": 1,
"type": "float"
},
{
"default": 2,
"label": "Size Y",
"max": 64,
"min": 1,
"name": "sy",
"step": 1,
"type": "float"
}
]
},
"type": "shader"
}

View File

@ -5,15 +5,15 @@
"y": 0
},
"parameters": {
"bevel": 0.05,
"columns": 2,
"bevel": 0.1,
"columns": 3,
"corner": 0,
"mortar": 0.05,
"pattern": 4,
"mortar": 0.1,
"pattern": 0,
"repeat": 1,
"round": 0,
"row_offset": 0.5,
"rows": 2
"rows": 6
},
"shader_model": {
"code": "vec4 $(name_uv)_rect = bricks_$pattern($uv, vec2($columns, $rows), $repeat, $row_offset);\nvec4 $(name_uv) = brick($uv, $(name_uv)_rect.xy, $(name_uv)_rect.zw, $mortar, $round, max(0.001, $bevel));\n",

View File

@ -1,5 +1,5 @@
{
"name": "indirect_uv",
"name": "custom_uv",
"node_position": {
"x": 0,
"y": 0
@ -12,7 +12,7 @@
"global": "",
"inputs": [
{
"default": "0.0",
"default": "vec4(1.0)",
"label": "Input",
"name": "in",
"type": "rgba"
@ -25,7 +25,7 @@
}
],
"instance": "",
"name": "Indirect UV",
"name": "Custom UV",
"outputs": [
{
"rgba": "$in($map($uv).xy)",

View File

@ -0,0 +1,45 @@
{
"name": "truchet_generic",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"Size": 4,
"shape": 0,
"size": 6,
"type": 1
},
"shader_model": {
"code": "",
"global": "vec2 truchet_generic_uv(vec2 uv, vec2 seed) {\n vec2 i = floor(uv);\n vec2 f = fract(uv);\n\tvec2 invert = step(rand2(seed+i), vec2(0.5));\n return f*(vec2(1.0)-invert)+(vec2(1.0)-f)*invert;\n}\n",
"inputs": [
{
"default": "vec4(1.0)",
"label": "",
"name": "in",
"type": "rgba"
}
],
"instance": "",
"name": "Generic Truchet",
"outputs": [
{
"rgba": "$in(truchet_generic_uv($uv*$size, vec2($seed, $seed)))",
"type": "rgba"
}
],
"parameters": [
{
"default": 4,
"label": "Size",
"max": 64,
"min": 2,
"name": "size",
"step": 1,
"type": "float"
}
]
},
"type": "shader"
}