Small cleanups to transforms.gd.

This commit is contained in:
Relintai 2021-11-12 01:04:39 +01:00
parent 0cb0559118
commit baf4c89ce1

View File

@ -940,481 +940,210 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
#splatter.mmg #splatter.mmg
#Spreads several occurences of an input image randomly. #Spreads several occurences of an input image randomly.
# "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), vec2(float($seed)));", #vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), vec2(float($seed)));
# "inputs": [
# { #vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\t
# "default": "0.0", # float c = 0.0;\n\t
# "function": true, # vec3 rc = vec3(0.0);\n\t
# "label": "", # vec3 rc1;\n\t
# "longdesc": "The input image or atlas of 4 or 16 input images", #
# "name": "in", # for (int i = 0; i < count; ++i) {\n\t\t
# "shortdesc": "Input", # seed = rand2(seed);\n\t\t
# "type": "f" # rc1 = rand3(seed);\n\t\t
# }, # float mask = $mask(fract(seed+vec2(0.5)));\n\t\t
# { #
# "default": "1.0", # if (mask > 0.01) {\n\t\t\t
# "function": true, # vec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\t
# "label": "", # seed = rand2(seed);\n\t\t\t
# "longdesc": "The mask applied to the pattern", # float angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t
# "name": "mask", # float ca = cos(angle);\n\t\t\t
# "shortdesc": "Mask", # float sa = sin(angle);\n\t\t\t
# "type": "f" # pv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t
# } # pv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t
# ], # pv /= vec2($scale_x, $scale_y);\n\t\t\t
# "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\trc1 = rand3(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tvec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\tif (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", # pv += vec2(0.5);\n\t\t\t
# "outputs": [ # seed = rand2(seed);\n\t\t\t
# { # vec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\t
# "f": "$(name_uv)_rch.a", #
# "longdesc": "Shows the generated pattern", # if (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\t
# "shortdesc": "Output", # continue;\n\t\t\t
# "type": "f" # }\n\t\t\t
# }, #
# { # $select_inputs\n\t\t\t
# "longdesc": "Shows a random color for each instance of the input image", #
# "rgb": "$(name_uv)_rch.rgb", # float c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\t
# "shortdesc": "Instance map", # c = max(c, c1);\n\t\t\t
# "type": "rgb" # rc = mix(rc, rc1, step(c, c1));\n\t\t
# } # }\n\t
# ], # }\n\t
# "parameters": [ #
# { # return vec4(rc, c);\n
# "control": "None", #}
# "default": 10,
# "label": "Count", #Inputs:
# "longdesc": "The number of occurences of the input image",
# "max": 100, #in, float, default: 0, - The input image or atlas of 4 or 16 input images
# "min": 1, #Mask, float, default: 1, - The mask applied to the pattern
# "name": "count",
# "shortdesc": "Count", #Outputs:
# "step": 1, #Output, float, Shows the generated pattern
# "type": "float" #$(name_uv)_rch.a
# },
# { #Instance map, rgb, Shows a random color for each instance of the input image
# "default": 0, #$(name_uv)_rch.rgb
# "label": "Inputs",
# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", #select_inputs enum
# "name": "select_inputs", #1, " "
# "shortdesc": "Input", #4, "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));"
# "type": "enum", #16, "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# "values": [
# { #Parameters:
# "name": "1", #count, int, default 25, min 1, max 100, - The number of occurences of the input image
# "value": " " #select_inputs (Inputs), enum, default 0, values 1, 4, 16
# }, #tile, Vector2, default 4, min:1, max:64, step:1 - The number of columns of the tiles pattern
# { #overlap, float, default 1, min 0, max 5, step 1 - The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.
# "name": "4", #scale, Vector2, default 1, min:0, max:2, step:0.01 - "The scale of input images on the X axis
# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" #rotate (rnd_rotate), float, default 0, min 0, max 180, step 0.1
# }, #scale (rnd_scale), float, default 0, min 0, max 1, step 0.01 - The random scale applied to each image instance
# { #value (rnd_value), float, default 0, min 0, max 1, step 0.01
# "name": "16",
# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# }
# ]
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale X",
# "longdesc": "The scale of input images on the X axis",
# "max": 2,
# "min": 0,
# "name": "scale_x",
# "shortdesc": "Scale.x",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale Y",
# "longdesc": "The scale of input images on the Y axis",
# "max": 2,
# "min": 0,
# "name": "scale_y",
# "shortdesc": "Scale.y",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Rotate",
# "longdesc": "The random rotation applied to each image instance",
# "max": 180,
# "min": 0,
# "name": "rotate",
# "shortdesc": "RndRotate",
# "step": 0.1,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Scale",
# "longdesc": "The random scale applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "scale",
# "shortdesc": "RndScale",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0.5,
# "label": "Rnd Value",
# "longdesc": "The random greyscale value applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "value",
# "shortdesc": "RndValue",
# "step": 0.01,
# "type": "float"
# },
# {
# "default": false,
# "label": "Variations",
# "longdesc": "Check to splat variations of the input",
# "name": "variations",
# "shortdesc": "Variations",
# "type": "boolean"
# }
# ]
#---------------------- #----------------------
#splatter_color.mmg #splatter_color.mmg
#preads several occurences of an input image randomly. #preads several occurences of an input image randomly.
# "inputs": [ #vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\t
# { # vec4 c = vec4(0.0);\n\t
# "default": "vec4(0.0, 0.0, 0.0, 0.0)", #
# "function": true, # for (int i = 0; i < count; ++i) {\n\t\t
# "label": "", # seed = rand2(seed);\n\t\t
# "longdesc": "The input image or atlas of 4 or 16 input images", # float mask = $mask(fract(seed+vec2(0.5)));\n\t\t
# "name": "in", #
# "shortdesc": "Input", # if (mask > 0.01) {\n\t\t\t
# "type": "rgba" # vec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\t
# }, # seed = rand2(seed);\n\t\t\t
# { # float angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t
# "default": "1.0", # float ca = cos(angle);\n\t\t\t
# "function": true, # float sa = sin(angle);\n\t\t\t
# "label": "", # pv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t
# "longdesc": "The mask applied to the pattern", # pv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t
# "name": "mask", # pv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\t
# "shortdesc": "Mask", # seed = rand2(seed);\n\t\t\t
# "type": "f" #
# } # if (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t
# ], # continue;\n\t\t\t
# "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tvec4 c = vec4(0.0);\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\tc = mix(c, n, na);\n\t\t}\n\t}\n\treturn c;\n}\n", # }\n\t\t\t
# "outputs": [ #
# { # $select_inputs\n\t\t\t
# "longdesc": "Shows the generated pattern", #
# "rgba": "splatter_$(name)($uv, int($count), vec2(float($seed)))", # vec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\t
# "shortdesc": "Output", #
# "type": "rgba" # float na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\t
# } # float a = (1.0-c.a)*(1.0*na);\n\t\t\t
# ], # c = mix(c, n, na);\n\t\t
# "parameters": [ # }\n\t
# { # }\n\t
# "control": "None", #
# "default": 10, # return c;\n
# "label": "Count", #}
# "longdesc": "The number of occurences of the input image",
# "max": 100, #Inputs:
# "min": 1,
# "name": "count", #in, rgba, default: 0, - The input image or atlas of 4 or 16 input images
# "shortdesc": "Count", #Mask, float, default: 1, - The mask applied to the pattern
# "step": 1,
# "type": "float" #Outputs:
# }, #Output, rgba, Shows the generated pattern
# { #splatter_$(name)($uv, int($count), vec2(float($seed)))
# "default": 0,
# "label": "Inputs", #select_inputs enum
# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", #1, " "
# "name": "select_inputs", #4, "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));"
# "shortdesc": "Input", #16, "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# "type": "enum",
# "values": [ #Parameters:
# { #count, int, default 25, min 1, max 100, - The number of occurences of the input image
# "name": "1", #select_inputs (Inputs), enum, default 0, values 1, 4, 16
# "value": " " #tile, Vector2, default 4, min:1, max:64, step:1 - The number of columns of the tiles pattern
# }, #overlap, float, default 1, min 0, max 5, step 1 - The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.
# { #scale, Vector2, default 1, min:0, max:2, step:0.01 - "The scale of input images on the X axis
# "name": "4", #rotate (rnd_rotate), float, default 0, min 0, max 180, step 0.1
# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" #scale (rnd_scale), float, default 0, min 0, max 1, step 0.01 - The random scale applied to each image instance
# }, #value (rnd_value), float, default 0, min 0, max 1, step 0.01
# { #variations bool
# "name": "16",
# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# }
# ]
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale X",
# "longdesc": "The scale of input images on the X axis",
# "max": 2,
# "min": 0,
# "name": "scale_x",
# "shortdesc": "Scale.x",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale Y",
# "longdesc": "The scale of input images on the Y axis",
# "max": 2,
# "min": 0,
# "name": "scale_y",
# "shortdesc": "Scale.y",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Rotate",
# "longdesc": "The random rotation applied to each image instance",
# "max": 180,
# "min": 0,
# "name": "rotate",
# "shortdesc": "RndRotate",
# "step": 0.1,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Scale",
# "longdesc": "The random scale applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "scale",
# "shortdesc": "RndScale",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0.5,
# "label": "Rnd Opacity",
# "longdesc": "The random opacity applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "opacity",
# "shortdesc": "RndOpacity",
# "step": 0.01,
# "type": "float"
# },
# {
# "default": false,
# "label": "Variations",
# "longdesc": "Check to splat variations of the input",
# "name": "variations",
# "shortdesc": "Variations",
# "type": "boolean"
# }
# ]
#---------------------- #----------------------
#circle_splatter.mmg #circle_splatter.mmg
#Spreads several occurences of an input image in a circle or spiral pattern. #Spreads several occurences of an input image in a circle or spiral pattern.
# "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), int($rings), vec2(float($seed)));", #vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), int($rings), vec2(float($seed)));
# "inputs": [
# { #vec4 splatter_$(name)(vec2 uv, int count, int rings, vec2 seed) {\n\t
# "default": "0.0", # float c = 0.0;\n\t
# "function": true, # vec3 rc = vec3(0.0);\n\t
# "label": "", # vec3 rc1;\n\t
# "longdesc": "The input image or atlas of 4 or 16 input images", # seed = rand2(seed);\n\t
# "name": "in", #
# "shortdesc": "Input", # for (int i = 0; i < count; ++i) {\n\t\t
# "type": "f" # float a = -1.57079632679+6.28318530718*float(i)*$rings/float(count);\n\t\t
# }, # float rings_distance = ceil(float(i+1)*float(rings)/float(count))/float(rings);\n\t\t
# { # float spiral_distance = float(i+1)/float(count);\n\t\t
# "default": "1.0", # vec2 pos = $radius*mix(rings_distance, spiral_distance, $spiral)*vec2(cos(a), sin(a));\n\t\t
# "function": true, # float mask = $mask(fract(pos-vec2(0.5)));\n\t\t
# "label": "", #
# "longdesc": "The mask applied to the pattern", # if (mask > 0.01) {\n\t\t\t
# "name": "mask", # vec2 pv = uv-0.5-pos;\n\t\t\t
# "shortdesc": "Mask", # rc1 = rand3(seed);\n\t\t\tseed = rand2(seed);\n\t\t\t
# "type": "f" # float angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251 + (a+1.57079632679) * $i_rotate;\n\t\t\t
# } # float ca = cos(angle);\n\t\t\t
# ], # float sa = sin(angle);\n\t\t\t
# "instance": "vec4 splatter_$(name)(vec2 uv, int count, int rings, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tseed = rand2(seed);\n\tfor (int i = 0; i < count; ++i) {\n\t\tfloat a = -1.57079632679+6.28318530718*float(i)*$rings/float(count);\n\t\tfloat rings_distance = ceil(float(i+1)*float(rings)/float(count))/float(rings);\n\t\tfloat spiral_distance = float(i+1)/float(count);\n\t\tvec2 pos = $radius*mix(rings_distance, spiral_distance, $spiral)*vec2(cos(a), sin(a));\n\t\tfloat mask = $mask(fract(pos-vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = uv-0.5-pos;\n\t\t\trc1 = rand3(seed);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251 + (a+1.57079632679) * $i_rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv /= mix(1.0, float(i+1)/float(count+1), $i_scale);\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in(pv)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", # pv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t
# "outputs": [ # pv /= mix(1.0, float(i+1)/float(count+1), $i_scale);\n\t\t\t
# { # pv /= vec2($scale_x, $scale_y);\n\t\t\t
# "f": "$(name_uv)_rch.a", # pv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t
# "longdesc": "Shows the generated pattern", # pv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\t
# "shortdesc": "Output", #
# "type": "f" # if (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t
# }, # continue;\n\t\t\t
# { # }\n\t\t\t
# "longdesc": "Shows a random color for each instance of the input image", #
# "rgb": "$(name_uv)_rch.rgb", # $select_inputs\n\t\t\t
# "shortdesc": "Instance map", #
# "type": "rgb" # float c1 = $in(pv)*mask*(1.0-$value*seed.x);\n\t\t\t
# } #
# ], # c = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t
# "parameters": [ # }\n\t
# { # }\n\t
# "control": "None", #
# "default": 10, # return vec4(rc, c);\n
# "label": "Count", #}
# "longdesc": "The number of occurences of the input image",
# "max": 256,
# "min": 1, #Inputs:
# "name": "count",
# "shortdesc": "Count", #in, float, default: 0, - The input image or atlas of 4 or 16 input images
# "step": 1, #Mask, float, default: 1, - The mask applied to the pattern
# "type": "float"
# }, #Outputs:
# { #Output, float, Shows the generated pattern
# "control": "None", #$(name_uv)_rch.rgb
# "default": 1,
# "label": "Rings", #select_inputs enum
# "longdesc": "The number of rings of the circle pattern", #1, " "
# "max": 16, #4, "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));"
# "min": 1, #16, "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# "name": "rings",
# "shortdesc": "Rings", #Parameters:
# "step": 1, #count, int, default 10, min 1, max 256, - The number of occurences of the input image
# "type": "float" #rings, int, default 1, min 1, max 16, - The number of occurences of the input image
# }, #select_inputs (Inputs), enum, default 0, values 1, 4, 16
# { #scale, Vector2, default 1, min:0, max:2, step:0.01 - "The scale of input images on the X axis
# "default": 0, #radius, float, default 0.4, min 0, max 0.5, step 0.01
# "label": "Inputs", #spiral, float, default 0, min 0, max 1, step 0.01
# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", #i_rotate (inc_rotate), float, default 0, min 0, max 180, step 0.1
# "name": "select_inputs", #i_scale (inc_scale), float, default 0, min 0, max 1, step 0.01
# "shortdesc": "Input", #rotate (rnd_rotate), float, default 0, min 0, max 180, step 0.1
# "type": "enum", #scale (rnd_scale), float, default 0, min 0, max 1, step 0.01 - The random scale applied to each image instance
# "values": [ #value (rnd_value), float, default 0, min 0, max 1, step 0.01
# {
# "name": "1",
# "value": " "
# },
# {
# "name": "4",
# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));"
# },
# {
# "name": "16",
# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));"
# }
# ]
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale X",
# "longdesc": "The scale of input images on the X axis",
# "max": 2,
# "min": 0,
# "name": "scale_x",
# "shortdesc": "Scale.x",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 1,
# "label": "Scale Y",
# "longdesc": "The scale of input images on the Y axis",
# "max": 2,
# "min": 0,
# "name": "scale_y",
# "shortdesc": "Scale.y",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0.25,
# "label": "Radius",
# "longdesc": "The radius of the outer circle pattern",
# "max": 0.5,
# "min": 0,
# "name": "radius",
# "shortdesc": "Radius",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Spiral",
# "longdesc": "The type of pattern:\n- 0: circles\n- 1: spiral",
# "max": 1,
# "min": 0,
# "name": "spiral",
# "shortdesc": "Spiral",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Inc Rotate",
# "longdesc": "The rotate increment along the pattern",
# "max": 1,
# "min": 0,
# "name": "i_rotate",
# "shortdesc": "IncRotate",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Inc Scale",
# "longdesc": "The scale increment of the pattern",
# "max": 1,
# "min": 0,
# "name": "i_scale",
# "shortdesc": "IncScale",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Rotate",
# "longdesc": "The random rotation applied to each image instance",
# "max": 180,
# "min": 0,
# "name": "rotate",
# "shortdesc": "RndRotate",
# "step": 0.1,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0,
# "label": "Rnd Scale",
# "longdesc": "The random scale applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "scale",
# "shortdesc": "RndScale",
# "step": 0.01,
# "type": "float"
# },
# {
# "control": "None",
# "default": 0.5,
# "label": "Rnd Value",
# "longdesc": "The random greyscale value applied to each image instance",
# "max": 1,
# "min": 0,
# "name": "value",
# "shortdesc": "RndValue",
# "step": 0.01,
# "type": "float"
# }
# ]
#---------------------- #----------------------
#warp_dilation.mmg #warp_dilation.mmg