2019-11-27 23:58:16 +01:00
|
|
|
{
|
2019-11-30 18:54:46 +01:00
|
|
|
"name": "custom_uv",
|
2019-11-27 23:58:16 +01:00
|
|
|
"node_position": {
|
|
|
|
"x": 0,
|
|
|
|
"y": 0
|
|
|
|
},
|
|
|
|
"parameters": {
|
2020-05-21 21:20:39 +02:00
|
|
|
"rotate": 0,
|
|
|
|
"scale": 0
|
2019-11-27 23:58:16 +01:00
|
|
|
},
|
|
|
|
"shader_model": {
|
2020-05-21 21:20:39 +02:00
|
|
|
"code": "vec3 $(name_uv)_map = $map($uv);",
|
|
|
|
"global": "vec2 custom_uv_transform(vec2 uv, float rotate, float scale, vec2 seed) {\n\tseed = rand2(seed);\n\tuv -= vec2(0.5);\n\tfloat angle = (seed.x * 2.0 - 1.0) * rotate;\n\tfloat ca = cos(angle);\n\tfloat sa = sin(angle);\n\tuv = vec2(ca*uv.x+sa*uv.y, -sa*uv.x+ca*uv.y);\n\tuv *= (seed.y-0.5)*2.0*scale+1.0;\n\tuv += vec2(0.5);\n\treturn uv;\n}\n",
|
2019-11-27 23:58:16 +01:00
|
|
|
"inputs": [
|
|
|
|
{
|
2019-11-30 18:54:46 +01:00
|
|
|
"default": "vec4(1.0)",
|
2019-11-27 23:58:16 +01:00
|
|
|
"label": "Input",
|
|
|
|
"name": "in",
|
|
|
|
"type": "rgba"
|
|
|
|
},
|
|
|
|
{
|
2020-05-21 21:20:39 +02:00
|
|
|
"default": "vec3(1.0)",
|
2019-11-27 23:58:16 +01:00
|
|
|
"label": "UV",
|
|
|
|
"name": "map",
|
|
|
|
"type": "rgb"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"instance": "",
|
2019-11-30 18:54:46 +01:00
|
|
|
"name": "Custom UV",
|
2019-11-27 23:58:16 +01:00
|
|
|
"outputs": [
|
|
|
|
{
|
2020-05-21 21:20:39 +02:00
|
|
|
"rgba": "$in(custom_uv_transform($(name_uv)_map.xy, $rotate*0.01745329251, $scale, vec2($(name_uv)_map.z, float($seed))))",
|
2019-11-27 23:58:16 +01:00
|
|
|
"type": "rgba"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"parameters": [
|
2020-05-21 21:20:39 +02:00
|
|
|
{
|
|
|
|
"control": "None",
|
|
|
|
"default": 0,
|
|
|
|
"label": "Rotate",
|
|
|
|
"max": 180,
|
|
|
|
"min": 0,
|
|
|
|
"name": "rotate",
|
|
|
|
"step": 0.1,
|
|
|
|
"type": "float"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"control": "None",
|
|
|
|
"default": 0.5,
|
|
|
|
"label": "Scale",
|
|
|
|
"max": 1,
|
|
|
|
"min": 0,
|
|
|
|
"name": "scale",
|
|
|
|
"step": 0.1,
|
|
|
|
"type": "float"
|
|
|
|
}
|
2019-11-27 23:58:16 +01:00
|
|
|
]
|
|
|
|
},
|
|
|
|
"type": "shader"
|
|
|
|
}
|