From fb625c712445c2cdcf097aedf79d69cd62242720 Mon Sep 17 00:00:00 2001 From: myaaaaaaaaa <103326468+myaaaaaaaaa@users.noreply.github.com> Date: Wed, 30 Nov 2022 22:48:08 -0500 Subject: [PATCH] Add "Log Scale" parameter to Scale node --- addons/material_maker/nodes/scale.mmg | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/addons/material_maker/nodes/scale.mmg b/addons/material_maker/nodes/scale.mmg index 52e36eece..9f1b9b87d 100644 --- a/addons/material_maker/nodes/scale.mmg +++ b/addons/material_maker/nodes/scale.mmg @@ -8,6 +8,7 @@ "parameters": { "cx": 0, "cy": 0, + "log_scale": 0, "scale_x": 1, "scale_y": 1 }, @@ -32,7 +33,7 @@ "outputs": [ { "longdesc": "Shows a 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" } @@ -85,9 +86,21 @@ "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" }, "type": "shader" -} \ No newline at end of file +}