material-maker/addons/material_maker/nodes/truchet_generic.mmg

45 lines
854 B
Plaintext

{
"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"
}