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

90 lines
1.8 KiB
Plaintext
Raw Normal View History

2020-05-21 21:21:35 +02:00
{
"name": "scale",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"cx": 0,
"cy": 0,
"scale_x": 1,
"scale_y": 1
},
"shader_model": {
"code": "",
"global": "vec2 scale(vec2 uv, vec2 center, vec2 scale) {\n\tuv -= center;\n\tuv /= scale;\n\tuv += center;\n return uv;\n}",
"inputs": [
{
"default": "vec4($uv, 0.0, 1.0)",
"label": "",
2020-09-29 22:27:10 +02:00
"longdesc": "The input image",
2020-05-21 21:21:35 +02:00
"name": "i",
2020-09-29 22:27:10 +02:00
"shortdesc": "Input",
2020-05-21 21:21:35 +02:00
"type": "rgba"
}
],
"instance": "",
"longdesc": "Scales its input",
2020-05-21 21:21:35 +02:00
"name": "Scale",
"outputs": [
{
2020-09-29 22:27:10 +02:00
"longdesc": "Shows the scaled image",
2020-05-21 21:21:35 +02:00
"rgba": "$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y)))",
2020-09-29 22:27:10 +02:00
"shortdesc": "Output",
2020-05-21 21:21:35 +02:00
"type": "rgba"
}
],
"parameters": [
{
"control": "P1.x",
"default": 0,
"label": "Center X:",
2020-09-29 22:27:10 +02:00
"longdesc": "The position of the scale center",
2020-05-21 21:21:35 +02:00
"max": 1,
"min": -1,
"name": "cx",
2020-09-29 22:27:10 +02:00
"shortdesc": "Center.x",
2020-05-21 21:21:35 +02:00
"step": 0.005,
"type": "float"
},
{
"control": "P1.y",
"default": 0,
"label": "Center Y:",
2020-09-29 22:27:10 +02:00
"longdesc": "The poisition of the scale center",
2020-05-21 21:21:35 +02:00
"max": 1,
"min": -1,
"name": "cy",
2020-09-29 22:27:10 +02:00
"shortdesc": "Center.y",
2020-05-21 21:21:35 +02:00
"step": 0.005,
"type": "float"
},
{
"control": "Scale1.x",
"default": 1,
"label": "Scale X:",
2020-09-29 22:27:10 +02:00
"longdesc": "The scale amount along the X axis",
2020-05-21 21:21:35 +02:00
"max": 50,
"min": 0,
"name": "scale_x",
2020-09-29 22:27:10 +02:00
"shortdesc": "Scale.x",
2020-05-21 21:21:35 +02:00
"step": 0.005,
"type": "float"
},
{
"control": "Scale1.y",
"default": 1,
"label": "Scale Y:",
2020-09-29 22:27:10 +02:00
"longdesc": "The scale amount along the Y axis",
2020-05-21 21:21:35 +02:00
"max": 50,
"min": 0,
"name": "scale_y",
2020-09-29 22:27:10 +02:00
"shortdesc": "Scale.y",
2020-05-21 21:21:35 +02:00
"step": 0.005,
"type": "float"
}
2020-09-29 22:27:10 +02:00
],
"shortdesc": "Scale"
2020-05-21 21:21:35 +02:00
},
"type": "shader"
}