Skip to content

Commit

Permalink
Add "Log Scale" parameter to Scale node
Browse files Browse the repository at this point in the history
  • Loading branch information
myaaaaaaaaa committed Dec 1, 2022
1 parent fee8a5e commit 5627548
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion addons/material_maker/nodes/scale.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"parameters": {
"cx": 0,
"cy": 0,
"log_scale": 0,
"scale_x": 1,
"scale_y": 1
},
"seed_int": 0,
"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}",
Expand All @@ -29,7 +31,7 @@
"outputs": [
{
"longdesc": "Shows the scaled image",
"rgba": "$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y)))",
"rgba": "$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y) * pow(2.0, $log_scale)))",
"shortdesc": "Output",
"type": "rgba"
}
Expand Down Expand Up @@ -82,6 +84,18 @@
"shortdesc": "Scale.y",
"step": 0.005,
"type": "float"
},
{
"control": "None",
"default": 0,
"label": "Log Scale",
"longdesc": "Adjust scale to very large or very small values",
"max": 6,
"min": -6,
"name": "log_scale",
"shortdesc": "Log Scale",
"step": 0.01,
"type": "float"
}
],
"shortdesc": "Scale"
Expand Down

0 comments on commit 5627548

Please sign in to comment.