diff --git a/game/addons/mat_maker_gd/nodes/common/blur.gd b/game/addons/mat_maker_gd/nodes/common/blur.gd index aae44be1..2aa637e1 100644 --- a/game/addons/mat_maker_gd/nodes/common/blur.gd +++ b/game/addons/mat_maker_gd/nodes/common/blur.gd @@ -935,3 +935,238 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # "type": "shader" #} + +#---------------------- +#slope_blur.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "edge_detect_3_3_2", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "edge_detect_3_3_2", +# "to_port": 1 +# }, +# { +# "from": "edge_detect_3_3_2", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# } +# ], +# "label": "Slope Blur", +# "longdesc": "Applys a blur effect on its input, following slopes of an input height map", +# "name": "slope_blur", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": -395.25, +# "y": -274.75 +# }, +# "parameters": { +# "lod": 0, +# "size": 10 +# }, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -462.666626, +# "y": -397.666656 +# }, +# "parameters": { +# "param0": 10, +# "param1": 30 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Grid size:", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "edge_detect_3_3_2", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input image", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Sigma", +# "linked_widgets": [ +# { +# "node": "edge_detect_3_3_2", +# "widget": "sigma" +# } +# ], +# "longdesc": "The strength of the blur filter", +# "name": "param1", +# "shortdesc": "Sigma", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -872.666626, +# "y": -243.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "group_size": 0, +# "longdesc": "A height map whose slopes control the strength and direction of the blur filter", +# "name": "heightmap", +# "shortdesc": "Height map", +# "type": "f" +# } +# ], +# "seed_value": 91624, +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": -45.452393, +# "y": -195.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the generated blurred image", +# "name": "port0", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "edge_detect_3_3_2", +# "node_position": { +# "x": -401.725464, +# "y": -199.178955 +# }, +# "parameters": { +# "sigma": 30, +# "size": 10 +# }, +# "seed_value": -47470, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "name": "heightmap", +# "type": "f" +# } +# ], +# "instance": "vec4 $(name)_fct(vec2 uv) {\n\tfloat dx = 1.0/$size;\n float v = $heightmap(uv);\n\tvec2 slope = vec2($heightmap(uv+vec2(dx, 0.0))-v, $heightmap(uv+vec2(0.0, dx))-v);\n\tfloat slope_strength = length(slope)*$size;\n vec2 norm_slope = (slope_strength == 0.0) ? vec2(0.0, 1.0) : normalize(slope);\n vec2 e = dx*norm_slope;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = max($sigma*slope_strength, 0.0001);\n\tfor (float i = 0.0; i <= 50.0; i += 1.0) {\n\t\tfloat coef = exp(-0.5*(pow(i/sigma, 2.0)))/(6.28318530718*sigma*sigma);\n\t\trv += $in(uv+i*e)*coef;\n\t\tsum += coef;\n\t}\n\treturn rv/sum;\n}", +# "name": "Slope Blur", +# "outputs": [ +# { +# "rgba": "$(name)_fct($uv)", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Sigma", +# "max": 50, +# "min": 0, +# "name": "sigma", +# "step": 0.1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -392.952209, +# "y": -115.576294 +# }, +# "parameters": { +# "lod": 0, +# "size": 10 +# }, +# "type": "buffer" +# } +# ], +# "parameters": { +# "param0": 10, +# "param1": 30 +# }, +# "shortdesc": "Slope blur", +# "type": "graph" +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/colors.gd b/game/addons/mat_maker_gd/nodes/common/colors.gd index d4c5d844..de1affd8 100644 --- a/game/addons/mat_maker_gd/nodes/common/colors.gd +++ b/game/addons/mat_maker_gd/nodes/common/colors.gd @@ -143,6 +143,4416 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # } # ], +#---------------------- +#auto_tones.mmg + +#{ +# "connections": [ +# { +# "from": "graph", +# "from_port": 0, +# "to": "tones_map", +# "to_port": 1 +# }, +# { +# "from": "graph", +# "from_port": 1, +# "to": "tones_map", +# "to_port": 2 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "graph", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "tones_map", +# "to_port": 0 +# }, +# { +# "from": "tones_map", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# } +# ], +# "label": "Auto Tones", +# "longdesc": "Finds the minimum and maximum values in the input texture and tone maps it to the full 0.0 - 1.0 range.", +# "name": "auto_tones", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "connections": [ +# { +# "from": "combine", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 0 +# }, +# { +# "from": "decompose", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "decompose", +# "from_port": 1, +# "to": "gen_outputs", +# "to_port": 1 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 0, +# "to": "decompose", +# "to_port": 0 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 1, +# "to": "14423", +# "to_port": 0 +# }, +# { +# "from": "14423", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "combine", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "combine", +# "to_port": 1 +# } +# ], +# "label": "Find Min Max", +# "longdesc": "", +# "name": "graph", +# "node_position": { +# "x": 1105.399902, +# "y": -179.398849 +# }, +# "nodes": [ +# { +# "name": "14423", +# "node_position": { +# "x": 344, +# "y": 217 +# }, +# "parameters": { +# "size": 10 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec3 $(name)_compare(vec2 uv, float size) {\n\tfloat iter = $in(uv).b;\n\tsize = size / pow(2.0, (iter * 100.0) );\n\titer += 0.01;\n\tfloat pixel_offset = 1.0 / size;\n\tvec2 half_res_uv = floor(uv * size / 2.0) / size * 2.0 + pixel_offset / 2.0;\n\tvec3 values[4];\n\tvalues[0] = $in(half_res_uv);\n\tvalues[1] = $in(half_res_uv + vec2(pixel_offset, 0.0));\n\tvalues[2] = $in(half_res_uv + vec2(0.0, pixel_offset));\n\tvalues[3] = $in(half_res_uv + vec2(pixel_offset, pixel_offset));\n\t\n\tfloat lowest = 1.0;\n\tfloat highest = 0.0;\n\t\n\tfor (int i = 0; i < 4; i++) {\n\t\tlowest = values[i].r < lowest ? values[i].r : lowest;\n\t\thighest = values[i].g > highest ? values[i].g : highest;\n\t}\n\t\n\treturn vec3( lowest, highest , iter);\n}", +# "name": "Compare Neighbor", +# "outputs": [ +# { +# "rgb": "$(name)_compare($uv, $size)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 10, +# "first": 1, +# "label": "", +# "last": 13, +# "name": "size", +# "type": "size" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "iterate_buffer", +# "node_position": { +# "x": 328, +# "y": 63 +# }, +# "parameters": { +# "filter": false, +# "iterations": 13, +# "mipmap": false, +# "size": 10 +# }, +# "seed_value": 29168, +# "type": "iterate_buffer" +# }, +# { +# "name": "combine", +# "node_position": { +# "x": 376, +# "y": -75 +# }, +# "parameters": { +# +# }, +# "type": "combine" +# }, +# { +# "name": "decompose", +# "node_position": { +# "x": 605, +# "y": 64 +# }, +# "parameters": { +# +# }, +# "type": "decompose" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -199, +# "y": 23 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "", +# "name": "in", +# "shortdesc": "In", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 831, +# "y": 42 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "", +# "name": "min", +# "shortdesc": "Min", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "max", +# "shortdesc": "Max", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": 248.399994, +# "y": -292 +# }, +# "parameters": { +# "param0": 10 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Size", +# "linked_widgets": [ +# { +# "node": "iterate_buffer", +# "widget": "size" +# }, +# { +# "node": "14423", +# "widget": "size" +# } +# ], +# "name": "param0", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 10 +# }, +# "shortdesc": "", +# "type": "graph" +# }, +# { +# "name": "tones_map", +# "node_position": { +# "x": 1142.528442, +# "y": -88.26989 +# }, +# "parameters": { +# +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(0.5 ,0.5, 0.5, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# }, +# { +# "default": "0.0", +# "label": "", +# "name": "in_min", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "name": "in_max", +# "type": "f" +# } +# ], +# "instance": "", +# "longdesc": "Maps linearly an input tones interval to an output tones interval.", +# "name": "Mapping", +# "outputs": [ +# { +# "f": "($in($uv)-$in_min($uv))/($in_max($uv)-$in_min($uv))", +# "longdesc": "Shows the generated remapped image", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# +# ], +# "shortdesc": "Tones map" +# }, +# "type": "shader" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": 665.528564, +# "y": -136.535721 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 1425.400024, +# "y": -135.535721 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the generated remapped image", +# "name": "out", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": 1024.664307, +# "y": -298.400757 +# }, +# "parameters": { +# "param0": 10 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "graph", +# "widget": "param0" +# } +# ], +# "longdesc": "Buffers are used to find the mininum and maximum values for the input image. If the input has small details a higher resolution buffer might be needed to capture precise min and max values.\n\nNote: The output itself will not be buffered.", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 10 +# }, +# "shortdesc": "Auto Tones", +# "type": "graph" +#} + +#---------------------- +#blend.mmg +#Blends its input, using an optional mask + +# "code": "vec4 $(name_uv)_s1 = $s1($uv);\nvec4 $(name_uv)_s2 = $s2($uv);\nfloat $(name_uv)_a = $amount*$a($uv);\n", +# "inputs": [ +# { +# "default": "vec4($uv.x, 1.0, 1.0, 1.0)", +# "label": "Source1", +# "longdesc": "The foreground input", +# "name": "s1", +# "shortdesc": "Foreground", +# "type": "rgba" +# }, +# { +# "default": "vec4(1.0, $uv.y, 1.0, 1.0)", +# "label": "Source2", +# "longdesc": "The background input", +# "name": "s2", +# "shortdesc": "Background", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "label": "Opacity", +# "longdesc": "The optional opacity mask", +# "name": "a", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the result of the blend operation", +# "rgba": "vec4(blend_$blend_type($uv, $(name_uv)_s1.rgb, $(name_uv)_s2.rgb, $(name_uv)_a*$(name_uv)_s1.a), min(1.0, $(name_uv)_s2.a+$(name_uv)_a*$(name_uv)_s1.a))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "The algorithm used to blend the inputs", +# "name": "blend_type", +# "shortdesc": "Blend mode", +# "type": "enum", +# "values": [ +# { +# "name": "Normal", +# "value": "normal" +# }, +# { +# "name": "Dissolve", +# "value": "dissolve" +# }, +# { +# "name": "Multiply", +# "value": "multiply" +# }, +# { +# "name": "Screen", +# "value": "screen" +# }, +# { +# "name": "Overlay", +# "value": "overlay" +# }, +# { +# "name": "Hard Light", +# "value": "hard_light" +# }, +# { +# "name": "Soft Light", +# "value": "soft_light" +# }, +# { +# "name": "Burn", +# "value": "burn" +# }, +# { +# "name": "Dodge", +# "value": "dodge" +# }, +# { +# "name": "Lighten", +# "value": "lighten" +# }, +# { +# "name": "Darken", +# "value": "darken" +# }, +# { +# "name": "Difference", +# "value": "difference" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "3:", +# "longdesc": "The opacity of the blend operation", +# "max": 1, +# "min": 0, +# "name": "amount", +# "shortdesc": "Opacity", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#combine.mmg +#Combines 4 greyscale inputs into an RGBA image + +# "inputs": [ +# { +# "default": "0.0", +# "label": "R", +# "longdesc": "The greyscale input for the red channel", +# "name": "r", +# "shortdesc": "Red", +# "type": "f" +# }, +# { +# "default": "0.0", +# "label": "G", +# "longdesc": "The greyscale input for the green channel", +# "name": "g", +# "shortdesc": "Green", +# "type": "f" +# }, +# { +# "default": "0.0", +# "label": "B", +# "longdesc": "The greyscale input for the blue channel", +# "name": "b", +# "shortdesc": "Blue", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "A", +# "longdesc": "The greyscale input for the alpha channel", +# "name": "a", +# "shortdesc": "Alpha", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the combined RGBA image", +# "rgba": "vec4($r($uv), $g($uv), $b($uv), $a($uv))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], + +#---------------------- +#emboss.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "598", +# "to_port": 0 +# }, +# { +# "from": "598", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# } +# ], +# "label": "Emboss", +# "longdesc": "Creates highlights and shadows from an input heightmap", +# "name": "emboss", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": -65.493774, +# "y": -609.5 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "seed_value": 10109, +# "type": "buffer" +# }, +# { +# "name": "598", +# "node_position": { +# "x": -77.579605, +# "y": -529.738281 +# }, +# "parameters": { +# "amount": 5, +# "angle": 0, +# "size": 9, +# "width": 1 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "includes": [ +# "" +# ], +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tfloat rv = 0.0;\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy))*cos(atan(dy, dx)-$angle*3.14159265359/180.0)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Emboss", +# "outputs": [ +# { +# "f": "$(name)_fct($uv)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Angle", +# "max": 180, +# "min": -180, +# "name": "angle", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -461.57959, +# "y": -574.119141 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input height map", +# "name": "port0", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 187.506226, +# "y": -557.119141 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The generated image", +# "name": "port0", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -111.036682, +# "y": -777.5 +# }, +# "parameters": { +# "param0": 9, +# "param1": 0, +# "param2": 5, +# "param3": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Size", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "598", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input image", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Angle", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "angle" +# } +# ], +# "longdesc": "The angle of the simulated light", +# "name": "param1", +# "shortdesc": "Angle", +# "type": "linked_control" +# }, +# { +# "label": "Amount", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "amount" +# } +# ], +# "longdesc": "The strength of the emboss effect", +# "name": "param2", +# "shortdesc": "Strength", +# "type": "linked_control" +# }, +# { +# "label": "Width", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "width" +# } +# ], +# "longdesc": "The width (in pixels) of the area sampled for each pixel", +# "name": "param3", +# "shortdesc": "Width", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 9, +# "param1": 0, +# "param2": 5, +# "param3": 1 +# }, +# "shortdesc": "Emboss", +# "type": "graph" +#} + +#---------------------- +#invert.mmg +#A filter that inverts the R, G, and B channels of its input while keeping the A channel unchanged + +# "inputs": [ +# { +# "default": "vec4(1.0, 1.0, 1.0, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the inverted image", +# "rgba": "vec4(vec3(1.0)-$in($uv).rgb, $in($uv).a)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], + +#---------------------- +#normal_map.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "switch", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "switch", +# "to_port": 0 +# }, +# { +# "from": "edge_detect_1", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "switch", +# "from_port": 0, +# "to": "edge_detect_1", +# "to_port": 0 +# } +# ], +# "label": "Normal Map", +# "longdesc": "Generates a normal map from a height map", +# "name": "normal_map", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": -695.663818, +# "y": 34.60614 +# }, +# "parameters": { +# "lod": 0, +# "size": 10 +# }, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -731.910156, +# "y": -131.916687 +# }, +# "parameters": { +# "param0": 10, +# "param1": 1, +# "param2": 0, +# "param4": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "edge_detect_1", +# "widget": "format" +# } +# ], +# "longdesc": "The format of the generated normal map\nIn most cases this should be set to default", +# "name": "param2", +# "shortdesc": "Format", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "edge_detect_1", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the generated normal map", +# "name": "param0", +# "shortdesc": "Resolution", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "edge_detect_1", +# "widget": "amount" +# } +# ], +# "longdesc": "The strength of the normal map filter", +# "name": "param1", +# "shortdesc": "Strength", +# "type": "linked_control" +# }, +# { +# "configurations": { +# "False": [ +# { +# "node": "switch", +# "value": 0, +# "widget": "source" +# } +# ], +# "True": [ +# { +# "node": "switch", +# "value": 1, +# "widget": "source" +# } +# ] +# }, +# "label": "Buffer", +# "linked_widgets": [ +# { +# "node": "switch", +# "widget": "source" +# } +# ], +# "longdesc": "When set, a buffer is used to sample the input before the normal map filter", +# "name": "param4", +# "shortdesc": "Buffer", +# "type": "config_control" +# } +# ] +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": -445.663818, +# "y": 75.047363 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the generated normal map", +# "name": "Normal", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -1094.910156, +# "y": 74.047363 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input height map", +# "name": "Bump", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "seed_value": 12483, +# "type": "ios" +# }, +# { +# "name": "switch", +# "node_position": { +# "x": -673.5, +# "y": 113.297363 +# }, +# "parameters": { +# "choices": 2, +# "outputs": 1, +# "source": 1 +# }, +# "type": "switch" +# }, +# { +# "name": "edge_detect_1", +# "node_position": { +# "x": -676.092529, +# "y": 193.868774 +# }, +# "parameters": { +# "amount": 1, +# "format": 0, +# "size": 10 +# }, +# "shader_model": { +# "code": "", +# "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "vec3 $(name)_fct(vec2 uv) {\n\tvec3 e = vec3(1.0/$size, -1.0/$size, 0);\n\tvec2 rv = vec2(1.0, -1.0)*$in(uv+e.xy);\n\trv += vec2(-1.0, 1.0)*$in(uv-e.xy);\n\trv += vec2(1.0, 1.0)*$in(uv+e.xx);\n\trv += vec2(-1.0, -1.0)*$in(uv-e.xx);\n\trv += vec2(2.0, 0.0)*$in(uv+e.xz);\n\trv += vec2(-2.0, 0.0)*$in(uv-e.xz);\n\trv += vec2(0.0, 2.0)*$in(uv+e.zx);\n\trv += vec2(0.0, -2.0)*$in(uv-e.zx);\n\treturn vec3(rv, 0.0);\n}", +# "name": "Normal map", +# "outputs": [ +# { +# "rgb": "process_normal_$format($(name)_fct($uv), $amount*$size/128.0)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "name": "format", +# "type": "enum", +# "values": [ +# { +# "name": "Default", +# "value": "default" +# }, +# { +# "name": "OpenGL", +# "value": "opengl" +# }, +# { +# "name": "DirectX", +# "value": "directx" +# } +# ] +# }, +# { +# "default": 9, +# "first": 4, +# "label": "", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "", +# "max": 2, +# "min": 0, +# "name": "amount", +# "step": 0.01, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# } +# ], +# "parameters": { +# "param0": 10, +# "param1": 1, +# "param2": 0, +# "param4": 1 +# }, +# "shortdesc": "Normal map", +# "type": "graph" +#} + +#---------------------- +#sharpen.mmg +#Sharpens it input image + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "instance": "vec3 $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, 0.0);\n\tvec3 rv = 5.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.yx);\n\trv -= $in(uv-e.yx);\n\treturn rv;\n}", +# "outputs": [ +# { +# "longdesc": "Shows the generated sharpened image", +# "rgb": "$(name)_fct($uv)", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the input image", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# } +# ], + +#---------------------- +#tones.mmg + +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "label": "", +# "name": "input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "rgba": "adjust_levels($input($uv), $in_min, $in_mid, $in_max, $out_min, $out_max)", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": { +# "a": 0, +# "b": 0, +# "g": 0, +# "r": 0 +# }, +# "label": "", +# "name": "in_min", +# "type": "color" +# }, +# { +# "default": { +# "a": 0.498039, +# "b": 0.498039, +# "g": 0.498039, +# "r": 0.498039 +# }, +# "label": "", +# "name": "in_mid", +# "type": "color" +# }, +# { +# "default": { +# "a": 1, +# "b": 1, +# "g": 1, +# "r": 1 +# }, +# "label": "", +# "name": "in_max", +# "type": "color" +# }, +# { +# "default": { +# "a": 1, +# "b": 0, +# "g": 0, +# "r": 0 +# }, +# "label": "", +# "name": "out_min", +# "type": "color" +# }, +# { +# "default": { +# "a": 1, +# "b": 1, +# "g": 1, +# "r": 1 +# }, +# "label": "", +# "name": "out_max", +# "type": "color" +# } +# ] +# }, + +#---------------------- +#tones_map.mmg +#Maps linearly an input tones interval to an output tones interval. + +# "inputs": [ +# { +# "default": "vec4(0.5 ,0.5, 0.5, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the generated remapped image", +# "rgba": "vec4(vec3($out_min)+($in($uv).rgb-vec3($in_min))*vec3(($out_max-$out_min)/($in_max-$in_min)), $in($uv).a)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Input min", +# "longdesc": "The minimum value of the input interval", +# "max": 1, +# "min": 0, +# "name": "in_min", +# "shortdesc": "InputMin", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Input max", +# "longdesc": "The maximum value of the input interval", +# "max": 1, +# "min": 0, +# "name": "in_max", +# "shortdesc": "InputMax", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Output min", +# "longdesc": "The minimum value of the output interval", +# "max": 1, +# "min": 0, +# "name": "out_min", +# "shortdesc": "OutputMin", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Output max", +# "longdesc": "The maximum value of the output interval", +# "max": 1, +# "min": 0, +# "name": "out_max", +# "shortdesc": "OutputMax", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#make_tileable.mmg +#Creates a tileable version of its input image by moving different parts around to hide seams. + +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "function": true, +# "label": "", +# "longdesc": "The image to be made tileable", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "instance": "vec4 make_tileable_$(name)(vec2 uv, float w) {\n\tvec4 a = $in(uv);\n\tvec4 b = $in(fract(uv+vec2(0.5)));\n\tfloat coef_ab = sin(1.57079632679*clamp((length(uv-vec2(0.5))-0.5+w)/w, 0.0, 1.0));\n\tvec4 c = $in(fract(uv+vec2(0.25)));\n\tfloat coef_abc = sin(1.57079632679*clamp((min(min(length(uv-vec2(0.0, 0.5)), length(uv-vec2(0.5, 0.0))), min(length(uv-vec2(1.0, 0.5)), length(uv-vec2(0.5, 1.0))))-w)/w, 0.0, 1.0));\n\treturn mix(c, mix(a, b, coef_ab), coef_abc);\n}\n", +# "outputs": [ +# { +# "longdesc": "A tileable version of the input image", +# "rgba": "make_tileable_$(name)($uv, 0.5*$w)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.1, +# "label": "", +# "longdesc": "Width of the transition areas between parts of the input image", +# "max": 0.25, +# "min": 0, +# "name": "w", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# } +# ] + +#---------------------- +#occlusion.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "blend", +# "from_port": 0, +# "to": "colorize", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "blend", +# "to_port": 0 +# }, +# { +# "from": "colorize", +# "from_port": 0, +# "to": "_2", +# "to_port": 0 +# }, +# { +# "from": "_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "gaussian_blur_x", +# "to_port": 0 +# }, +# { +# "from": "gaussian_blur_x", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "gaussian_blur_y", +# "to_port": 0 +# }, +# { +# "from": "gaussian_blur_y", +# "from_port": 0, +# "to": "blend", +# "to_port": 1 +# } +# ], +# "label": "Occlusion", +# "longdesc": "Generates an ambient occlusion map from a height map", +# "name": "occlusion", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer_2", +# "node_position": { +# "x": -409.875, +# "y": -112.625 +# }, +# "parameters": { +# "lod": 0, +# "size": 8 +# }, +# "seed_value": 61344, +# "type": "buffer" +# }, +# { +# "name": "buffer", +# "node_position": { +# "x": -408.25, +# "y": -265.75 +# }, +# "parameters": { +# "lod": 0, +# "size": 8 +# }, +# "seed_value": 53030, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -463.666626, +# "y": -384.666656 +# }, +# "parameters": { +# "param0": 8, +# "param2": 1.5 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Grid size:", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# }, +# { +# "node": "gaussian_blur_x", +# "widget": "size" +# }, +# { +# "node": "gaussian_blur_y", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input height map", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Strength", +# "linked_widgets": [ +# { +# "node": "_2", +# "widget": "g" +# } +# ], +# "longdesc": "The strength of the occlusion map effect", +# "name": "param2", +# "shortdesc": "Strength", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -824.666626, +# "y": -116.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input heightmap", +# "name": "port0", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 33.547607, +# "y": -132.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The generated occlusion map", +# "name": "port0", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "blend", +# "node_position": { +# "x": -422.79895, +# "y": 63.16272 +# }, +# "parameters": { +# "amount": 1, +# "blend_type": 11 +# }, +# "type": "blend" +# }, +# { +# "name": "colorize", +# "node_position": { +# "x": -167.79895, +# "y": -178.83728 +# }, +# "parameters": { +# "gradient": { +# "interpolation": 1, +# "points": [ +# { +# "a": 1, +# "b": 1, +# "g": 1, +# "pos": 0, +# "r": 1 +# }, +# { +# "a": 1, +# "b": 0, +# "g": 0, +# "pos": 1, +# "r": 0 +# } +# ], +# "type": "Gradient" +# } +# }, +# "seed_value": 33856, +# "type": "colorize" +# }, +# { +# "name": "_2", +# "node_position": { +# "x": -145.403687, +# "y": -112.29187 +# }, +# "parameters": { +# "g": 1.5 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "0.0", +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "", +# "outputs": [ +# { +# "f": "pow($in($uv), $g)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 1, +# "label": "", +# "max": 2, +# "min": 0, +# "name": "g", +# "step": 0.1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "gaussian_blur_x", +# "node_position": { +# "x": -413.053711, +# "y": -189.016876 +# }, +# "parameters": { +# "sigma": 50, +# "size": 8 +# }, +# "type": "gaussian_blur_x" +# }, +# { +# "name": "gaussian_blur_y", +# "node_position": { +# "x": -405.053711, +# "y": -21.016876 +# }, +# "parameters": { +# "sigma": 50, +# "size": 8 +# }, +# "type": "gaussian_blur_y" +# } +# ], +# "parameters": { +# "param0": 8, +# "param2": 1.5 +# }, +# "shortdesc": "Occlusion", +# "type": "graph" +#} + +#---------------------- +#occlusion2.mmg + +#{ +# "connections": [ +# { +# "from": "colorize", +# "from_port": 0, +# "to": "_2", +# "to_port": 0 +# }, +# { +# "from": "_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "fast_blur", +# "to_port": 0 +# }, +# { +# "from": "fast_blur", +# "from_port": 0, +# "to": "blend", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "blend", +# "to_port": 0 +# }, +# { +# "from": "blend", +# "from_port": 0, +# "to": "colorize", +# "to_port": 0 +# } +# ], +# "label": "Occlusion", +# "longdesc": "Generates an ambient occlusion map from a height map", +# "name": "occlusion2", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -522.866638, +# "y": -383.867035 +# }, +# "parameters": { +# "param0": 11, +# "param1": 20, +# "param2": 1.5, +# "param3": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Resolution", +# "linked_widgets": [ +# { +# "node": "fast_blur", +# "widget": "param0" +# } +# ], +# "longdesc": "The resolution of the input height map", +# "name": "param0", +# "shortdesc": "Resolution", +# "type": "linked_control" +# }, +# { +# "label": "Strength", +# "linked_widgets": [ +# { +# "node": "_2", +# "widget": "g" +# } +# ], +# "longdesc": "The strength of the occlusion map effect", +# "name": "param2", +# "shortdesc": "Strength", +# "type": "linked_control" +# }, +# { +# "label": "Radius", +# "linked_widgets": [ +# { +# "node": "fast_blur", +# "widget": "param1" +# } +# ], +# "longdesc": "The radius of the blur used for the occlusion effect", +# "name": "param1", +# "shortdesc": "Radius", +# "type": "linked_control" +# }, +# { +# "label": "Quality", +# "linked_widgets": [ +# { +# "node": "fast_blur", +# "widget": "param2" +# } +# ], +# "longdesc": "The quality of the blur operation used for the occlusion effect", +# "name": "param3", +# "shortdesc": "Quality", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -842.266602, +# "y": -108.396729 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input heightmap", +# "name": "port0", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 77.5476, +# "y": -86.015305 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The generated occlusion map", +# "name": "port0", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "blend", +# "node_position": { +# "x": -422.79895, +# "y": 11.18788 +# }, +# "parameters": { +# "amount": 1, +# "blend_type": 11 +# }, +# "type": "blend" +# }, +# { +# "name": "colorize", +# "node_position": { +# "x": -124.598953, +# "y": -131.660126 +# }, +# "parameters": { +# "gradient": { +# "interpolation": 1, +# "points": [ +# { +# "a": 1, +# "b": 1, +# "g": 1, +# "pos": 0, +# "r": 1 +# }, +# { +# "a": 1, +# "b": 0, +# "g": 0, +# "pos": 1, +# "r": 0 +# } +# ], +# "type": "Gradient" +# } +# }, +# "seed_value": 33856, +# "type": "colorize" +# }, +# { +# "name": "_2", +# "node_position": { +# "x": -104.603699, +# "y": -57.918201 +# }, +# "parameters": { +# "g": 1.5 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "0.0", +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "", +# "outputs": [ +# { +# "f": "pow($in(fract($uv)), $g)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 1, +# "label": "", +# "max": 2, +# "min": 0, +# "name": "g", +# "step": 0.1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "connections": [ +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "fast_blur_shader", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "fast_blur_shader", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# } +# ], +# "label": "Fast Blur", +# "longdesc": "", +# "name": "fast_blur", +# "node_position": { +# "x": -435.552002, +# "y": -135.436234 +# }, +# "nodes": [ +# { +# "name": "fast_blur_shader", +# "node_position": { +# "x": -161.600006, +# "y": 143.188766 +# }, +# "parameters": { +# "quality": 1, +# "sigma": 20 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgba" +# } +# ], +# "instance": "vec4 $(name)_blur(vec2 uv, vec2 scale, float sigma, int quality) {\n vec4 O = vec4(0.0);\n\tfloat samples = sigma * 4.0; \n\tint LOD = max(0, int(log2(float(samples)))-quality-2);\n\tint sLOD = 1 << LOD;\n int s = max(1, int(samples/float(sLOD)));\n\tfloat sum = 0.0;\n for (int i = 0; i < s*s; i++) {\n vec2 d = vec2(float(i%s), float(i/s))*float(sLOD) - 0.5*float(samples);\n\t\tvec2 dd = d / sigma;\n\t\tfloat g = exp(-.5*dot(dd,dd))/(6.28*sigma*sigma);\n O += g * textureLod($in.texture, uv + scale * d, float(LOD));\n\t\tsum += g;\n }\n \n return O / sum;\n}\n", +# "name": "Fast Blur", +# "outputs": [ +# { +# "rgba": "$(name)_blur($uv, vec2(1.0)/$in.size, max(1.0, floor($sigma*$in.size/2048.0)), int($quality))", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 1, +# "label": "", +# "max": 256, +# "min": 1, +# "name": "sigma", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "", +# "max": 3, +# "min": 0, +# "name": "quality", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -187, +# "y": 61.5 +# }, +# "parameters": { +# "size": 11 +# }, +# "type": "buffer", +# "version": 1 +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -602, +# "y": 91.75 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port0", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 88, +# "y": 61.75 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port0", +# "type": "rgba" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -254.5, +# "y": -122.5 +# }, +# "parameters": { +# "param0": 11, +# "param1": 20, +# "param2": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Resolution", +# "linked_widgets": [ +# { +# "node": "buffer_2", +# "widget": "size" +# } +# ], +# "name": "param0", +# "type": "linked_control" +# }, +# { +# "label": "Sigma", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "sigma" +# } +# ], +# "name": "param1", +# "type": "linked_control" +# }, +# { +# "label": "Quality", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "quality" +# } +# ], +# "name": "param2", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 11, +# "param1": 20, +# "param2": 1 +# }, +# "shortdesc": "", +# "type": "graph" +# } +# ], +# "parameters": { +# "param0": 11, +# "param1": 20, +# "param2": 1.5, +# "param3": 1 +# }, +# "shortdesc": "Occlusion", +# "type": "graph" +#} + +#---------------------- +#pixelize.mmg +#Creates a pixelated image from its input, and also quantifies the colors with optional dithering. + +# "code": "vec2 $(name_uv)_uv = floor(($uv*vec2($x, $y)))+vec2(0.5);\nvec3 $(name_uv)_dither = fract(vec3(dot(vec2(171.0, 231.0), $(name_uv)_uv))/vec3(103.0, 71.0, 97.0));\n", +# "inputs": [ +# { +# "default": "vec3(1.0)", +# "label": "", +# "longdesc": "The image to be pixelated", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "longdesc": "A pixelated version of the input image", +# "rgb": "floor($i($(name_uv)_uv/vec2($x, $y))*$c+$d*($(name_uv)_dither-vec3(0.5)))/$c", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 4, +# "label": "Columns:", +# "longdesc": "Number of pixel columns of the output", +# "max": 256, +# "min": 1, +# "name": "x", +# "shortdesc": "Columns", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 4, +# "label": "Rows:", +# "longdesc": "Number of pixel rows of the output", +# "max": 256, +# "min": 1, +# "name": "y", +# "shortdesc": "Rows", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 4, +# "label": "Levels:", +# "longdesc": "Number of color levels for each channel", +# "max": 32, +# "min": 2, +# "name": "c", +# "shortdesc": "Levels", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Dither:", +# "longdesc": "Amount of dithering in the output image", +# "max": 1, +# "min": 0, +# "name": "d", +# "shortdesc": "Dithering", +# "step": 0.01, +# "type": "float" +# } +# ] + +#---------------------- +#quantize.mmg +#Quantizes the red, green and blue channels of its input + +# "inputs": [ +# { +# "default": "vec4(2.0*vec3(length($uv-vec2(0.5))), 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "The quantized image", +# "rgba": "vec4(floor($in($uv).rgb*$steps)/$steps, $in($uv).a)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 4, +# "label": "", +# "longdesc": "The number of quantization steps", +# "max": 32, +# "min": 2, +# "name": "steps", +# "shortdesc": "Steps", +# "step": 1, +# "type": "float" +# } +# ], + +#---------------------- +#skew.mmg + +# "global": "vec2 uvskew_h(vec2 uv, float amount) {\n\treturn vec2(uv.x+amount*(uv.y-0.5), uv.y);\n}\nvec2 uvskew_v(vec2 uv, float amount) {\n\treturn vec2(uv.x, uv.y+amount*(uv.x-0.5));\n}", +# "inputs": [ +# { +# "default": "vec4($uv, 0, 1)", +# "label": "", +# "name": "i", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "rgba": "$i(uvskew_$direction($uv, $amount))", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "name": "direction", +# "type": "enum", +# "values": [ +# { +# "name": "Horizontal", +# "value": "h" +# }, +# { +# "name": "Vertical", +# "value": "v" +# } +# ] +# }, +# { +# "default": 0, +# "label": "", +# "max": 3, +# "min": -3, +# "name": "amount", +# "step": 0.005, +# "type": "float", +# "widget": "spinbox" +# } +# ] + +#---------------------- +#tonality.mmg +#Remaps a greyscale image tonality using a curve + +# "inputs": [ +# { +# "default": "$uv.x", +# "label": "", +# "longdesc": "The input greyscale image", +# "name": "input", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "f": "$curve($input($uv))", +# "longdesc": "The remapped greyscale image", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": { +# "points": [ +# { +# "ls": 0, +# "rs": 1, +# "x": 0, +# "y": 0 +# }, +# { +# "ls": 1, +# "rs": 0, +# "x": 1, +# "y": 1 +# } +# ], +# "type": "Curve" +# }, +# "label": "", +# "longdesc": "The tonality curve to which the input is remapped", +# "name": "curve", +# "shortdesc": "Curve", +# "type": "curve" +# } +# ], + +#---------------------- +#tones_range.mmg +#Outputs the tone range around a specified value + +# "code": "float $(name_uv)_step = clamp(($in($uv) - ($value))/max(0.0001, $width)+0.5, 0.0, 1.0);\nfloat $(name_uv)_false = clamp((min($(name_uv)_step, 1.0-$(name_uv)_step) * 2.0) / (1.0 - $contrast), 0.0, 1.0);\nfloat $(name_uv)_true = 1.0-$(name_uv)_false;", +# "inputs": [ +# { +# "default": "($uv.x + $uv.y) / 2.0", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "f": "$(name_uv)_$invert", +# "longdesc": "Shows the generated high contrast image", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Value", +# "longdesc": "The center value of the selection", +# "max": 1, +# "min": 0, +# "name": "value", +# "shortdesc": "Value", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.25, +# "label": "Width", +# "longdesc": "The width (in tones space) of the selection area", +# "max": 1, +# "min": 0, +# "name": "width", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Contrast", +# "longdesc": "Adjusts the falloff of the output", +# "max": 1, +# "min": 0, +# "name": "contrast", +# "shortdesc": "Contrast", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": false, +# "label": "Invert", +# "longdesc": "Invert the generated image if set", +# "name": "invert", +# "shortdesc": "Invert", +# "type": "boolean" +# } +# ], + +#---------------------- +#tones_step.mmg +#Emphasizes dark and light tones around a specified value + +# "code": "vec3 $(name_uv)_false = clamp(($in($uv).rgb-vec3($value))/max(0.0001, $width)+vec3(0.5), vec3(0.0), vec3(1.0));\nvec3 $(name_uv)_true = vec3(1.0)-$(name_uv)_false;", +# "inputs": [ +# { +# "default": "vec4(0.5 ,0.5, 0.5, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the generated high contrast image", +# "rgba": "vec4($(name_uv)_$invert, $in($uv).a)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Value", +# "longdesc": "The value of the input that separate dark and light zones of the result", +# "max": 1, +# "min": 0, +# "name": "value", +# "shortdesc": "Value", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "longdesc": "The width (in tones space) of the transition area", +# "max": 1, +# "min": 0, +# "name": "width", +# "shortdesc": "width", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": false, +# "label": "Invert", +# "longdesc": "Invert the generated image if set", +# "name": "invert", +# "shortdesc": "Invert", +# "type": "boolean" +# } +# ], + +#---------------------- +#math.mmg +#Performs a math operation using its inputs or parameter values + +# "code": "float $(name_uv)_clamp_false = $op;\nfloat $(name_uv)_clamp_true = clamp($(name_uv)_clamp_false, 0.0, 1.0);\n", +# "inputs": [ +# { +# "default": "$default_in1", +# "label": "2:A", +# "longdesc": "The A operand", +# "name": "in1", +# "shortdesc": "A", +# "type": "f" +# }, +# { +# "default": "$default_in2", +# "label": "B", +# "longdesc": "The B operand", +# "name": "in2", +# "shortdesc": "B", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "f": "$(name_uv)_clamp_$clamp", +# "longdesc": "Shows a greyscale image of the result", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 19, +# "label": "", +# "longdesc": "The operation to be performed", +# "name": "op", +# "shortdesc": "Operation", +# "type": "enum", +# "values": [ +# { +# "name": "A+B", +# "value": "$in1($uv)+$in2($uv)" +# }, +# { +# "name": "A-B", +# "value": "$in1($uv)-$in2($uv)" +# }, +# { +# "name": "A*B", +# "value": "$in1($uv)*$in2($uv)" +# }, +# { +# "name": "A/B", +# "value": "$in1($uv)/$in2($uv)" +# }, +# { +# "name": "log(A)", +# "value": "log($in1($uv))" +# }, +# { +# "name": "log2(A)", +# "value": "log2($in1($uv))" +# }, +# { +# "name": "pow(A, B)", +# "value": "pow($in1($uv),$in2($uv))" +# }, +# { +# "name": "abs(A)", +# "value": "abs($in1($uv))" +# }, +# { +# "name": "round(A)", +# "value": "round($in1($uv))" +# }, +# { +# "name": "floor(A)", +# "value": "floor($in1($uv))" +# }, +# { +# "name": "ceil(A)", +# "value": "ceil($in1($uv))" +# }, +# { +# "name": "trunc(A)", +# "value": "trunc($in1($uv))" +# }, +# { +# "name": "fract(A)", +# "value": "fract($in1($uv))" +# }, +# { +# "name": "min(A, B)", +# "value": "min($in1($uv),$in2($uv))" +# }, +# { +# "name": "max(A, B)", +# "value": "max($in1($uv),$in2($uv))" +# }, +# { +# "name": "A 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Curvature", +# "outputs": [ +# { +# "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "598_2", +# "node_position": { +# "x": -100.207932, +# "y": 638.757874 +# }, +# "parameters": { +# "amount": 1, +# "size": 11, +# "width": 2 +# }, +# "shader_model": { +# "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Curvature", +# "outputs": [ +# { +# "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "598_4", +# "node_position": { +# "x": -97.532082, +# "y": 755.803345 +# }, +# "parameters": { +# "amount": 1, +# "size": 11, +# "width": 4 +# }, +# "shader_model": { +# "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Curvature", +# "outputs": [ +# { +# "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "598_5", +# "node_position": { +# "x": -95.713867, +# "y": 877.621521 +# }, +# "parameters": { +# "amount": 1, +# "size": 11, +# "width": 8 +# }, +# "shader_model": { +# "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Curvature", +# "outputs": [ +# { +# "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "598_6", +# "node_position": { +# "x": -92.077492, +# "y": 992.848633 +# }, +# "parameters": { +# "amount": 1, +# "size": 11, +# "width": 16 +# }, +# "shader_model": { +# "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", +# "name": "Curvature", +# "outputs": [ +# { +# "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "Size", +# "last": 12, +# "name": "size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Amount", +# "max": 10, +# "min": 0, +# "name": "amount", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "connections": [ +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "fast_blur_shader", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "fast_blur_shader", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# } +# ], +# "label": "Fast Blur", +# "longdesc": "", +# "name": "fast_blur", +# "node_position": { +# "x": 167.483093, +# "y": 509.757843 +# }, +# "nodes": [ +# { +# "name": "fast_blur_shader", +# "node_position": { +# "x": -168, +# "y": 120 +# }, +# "parameters": { +# "quality": 1, +# "sigma": 2 +# }, +# "type": "fast_blur_shader" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -187, +# "y": 61.5 +# }, +# "parameters": { +# "size": 11 +# }, +# "type": "buffer", +# "version": 1 +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -602, +# "y": 91.75 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port0", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 88, +# "y": 61.75 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port0", +# "type": "rgba" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -254.5, +# "y": -122.5 +# }, +# "parameters": { +# "param0": 11, +# "param1": 2, +# "param2": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Resolution", +# "linked_widgets": [ +# { +# "node": "buffer_2", +# "widget": "size" +# } +# ], +# "name": "param0", +# "type": "linked_control" +# }, +# { +# "label": "Sigma", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "sigma" +# } +# ], +# "name": "param1", +# "type": "linked_control" +# }, +# { +# "label": "Quality", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "quality" +# } +# ], +# "name": "param2", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 11, +# "param1": 2, +# "param2": 1 +# }, +# "shortdesc": "", +# "type": "graph" +# }, +# { +# "name": "fast_blur_2", +# "node_position": { +# "x": 167.156082, +# "y": 638.560974 +# }, +# "parameters": { +# "param0": 11, +# "param1": 5, +# "param2": 1 +# }, +# "type": "fast_blur" +# }, +# { +# "name": "fast_blur_3", +# "node_position": { +# "x": 171.701691, +# "y": 756.742798 +# }, +# "parameters": { +# "param0": 11, +# "param1": 8, +# "param2": 1 +# }, +# "type": "fast_blur" +# }, +# { +# "name": "fast_blur_4", +# "node_position": { +# "x": 167.377045, +# "y": 877.651917 +# }, +# "parameters": { +# "param0": 11, +# "param1": 16, +# "param2": 1 +# }, +# "type": "fast_blur" +# }, +# { +# "name": "fast_blur_5", +# "node_position": { +# "x": 170.104279, +# "y": 992.197327 +# }, +# "parameters": { +# "param0": 11, +# "param1": 34, +# "param2": 1 +# }, +# "type": "fast_blur" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -426.44928, +# "y": 678.75 +# }, +# "parameters": { +# "filter": false, +# "mipmap": false, +# "size": 11 +# }, +# "type": "buffer", +# "version": 2 +# } +# ], +# "parameters": { +# "param0": 11, +# "param2": 1 +# }, +# "shortdesc": "Smooth Curvature", +# "type": "graph" +#} + +#---------------------- +#smooth_curvature2.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "switch", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "switch", +# "to_port": 0 +# }, +# { +# "from": "598", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "switch_2", +# "to_port": 1 +# }, +# { +# "from": "598", +# "from_port": 0, +# "to": "switch_2", +# "to_port": 0 +# }, +# { +# "from": "switch_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "switch", +# "from_port": 0, +# "to": "598", +# "to_port": 0 +# } +# ], +# "label": "Smooth Curvature 2", +# "longdesc": "", +# "name": "smooth_curvature2", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": 300.603302, +# "y": -549.522034 +# }, +# "parameters": { +# "lod": 0, +# "size": 10 +# }, +# "type": "buffer" +# }, +# { +# "name": "598", +# "node_position": { +# "x": 286.999847, +# "y": -359.903259 +# }, +# "parameters": { +# "quality": 4, +# "radius": 1, +# "strength": 1 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "0.5", +# "function": true, +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "float $(name)_curve( vec2 p, vec2 o ){\n\tfloat a = $in(p+o);\n\tfloat b = $in(p-o);\n\tfloat c = $in(p+o*vec2(1.0,-1.0));\n\tfloat d = $in(p-o*vec2(1.0,-1.0));\n\treturn -a - b - c - d;\n}\n\nfloat $(name)_curvature_map(vec2 p, float r, float q){\n\tfloat s = r/q;\n\tfloat H = $in(p)*4.0;\n\tfloat v = 0.0;\n\tvec2 o;\n\tfor( o.x = 0.0; o.x < q; o.x++ ){\n\t\tfor( o.y = 0.0; o.y < q; o.y++ ){\n\t\t\tfloat c = $(name)_curve(p, o*s);\n\t\t\tv += (H + c) * ((r-length(o*s)) / r);\n\t\t}\n\t}\n\treturn v/(q*q);\n}\n\nfloat $(name)_curvature(vec2 uv, float quality, float strength, float radius) {\n\tfloat c = $(name)_curvature_map(uv, 0.050 * radius, quality)*strength / radius;\n\treturn 0.5 + c;\n}", +# "name": "Smooth Curvature", +# "outputs": [ +# { +# "f": "$(name)_curvature($uv, $quality, $strength, $radius)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 4, +# "label": "Quality", +# "longdesc": "How many times the input is sampled to generate the curvature map", +# "max": 16, +# "min": 2, +# "name": "quality", +# "shortdesc": "Quality", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Strength", +# "longdesc": "The intensity of the curvature map", +# "max": 2, +# "min": 0, +# "name": "strength", +# "shortdesc": "Strength", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Radius", +# "longdesc": "The radius of the smoothing of the curvature effect", +# "max": 2, +# "min": 0, +# "name": "radius", +# "shortdesc": "Radius", +# "step": 0.01, +# "type": "float" +# } +# ], +# "shortdesc": "Smooth Curvature" +# }, +# "type": "shader" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": 242.146149, +# "y": -788.088806 +# }, +# "parameters": { +# "param0": 10, +# "param1": 4, +# "param2": 1, +# "param3": 1, +# "param4": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Size", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the curvature map if buffer is used", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Quality", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "quality" +# } +# ], +# "longdesc": "How many times the input is sampled to generate the curvature map", +# "name": "param1", +# "shortdesc": "Quality", +# "type": "linked_control" +# }, +# { +# "label": "Strength", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "strength" +# } +# ], +# "longdesc": "The intensity of the curvature map", +# "name": "param2", +# "shortdesc": "Strength", +# "type": "linked_control" +# }, +# { +# "label": "Radius", +# "linked_widgets": [ +# { +# "node": "598", +# "widget": "radius" +# } +# ], +# "longdesc": "The radius of the smoothing of the curvature effect", +# "name": "param3", +# "shortdesc": "Radius", +# "type": "linked_control" +# }, +# { +# "configurations": { +# "False": [ +# { +# "node": "switch", +# "value": 0, +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "value": 0, +# "widget": "source" +# } +# ], +# "True": [ +# { +# "node": "switch", +# "value": 1, +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "value": 1, +# "widget": "source" +# } +# ] +# }, +# "label": "Buffer", +# "linked_widgets": [ +# { +# "node": "switch", +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "widget": "source" +# } +# ], +# "longdesc": "When set, a buffer is used to sample the input before the normal map filter", +# "name": "param4", +# "shortdesc": "Buffer", +# "type": "config_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -135.453888, +# "y": -518.927429 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input height map", +# "name": "Heightmap", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 586.203247, +# "y": -534.919678 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the generated curvature map", +# "name": "Curvature", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "switch", +# "node_position": { +# "x": 310.739746, +# "y": -451.658417 +# }, +# "parameters": { +# "choices": 2, +# "outputs": 1, +# "source": 1 +# }, +# "type": "switch" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": 293.839874, +# "y": -225.201691 +# }, +# "parameters": { +# "lod": 0, +# "size": 10 +# }, +# "type": "buffer" +# }, +# { +# "name": "switch_2", +# "node_position": { +# "x": 312.239838, +# "y": -129.465912 +# }, +# "parameters": { +# "choices": 2, +# "outputs": 1, +# "source": 1 +# }, +# "type": "switch" +# }, +# { +# "name": "blend", +# "node_position": { +# "x": 802.064697, +# "y": -277.727295 +# }, +# "parameters": { +# "amount": 0.5, +# "blend_type": 0 +# }, +# "shader_model": { +# "code": "vec4 $(name_uv)_s1 = $s1($uv);\nvec4 $(name_uv)_s2 = $s2($uv);\nfloat $(name_uv)_a = $amount*$a($uv);\n", +# "global": "vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1 + (1.0-opacity)*c2;\n}\n\nvec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\tif (rand(uv) < opacity) {\n\t\treturn c1;\n\t} else {\n\t\treturn c2;\n\t}\n}\n\nvec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1*c2 + (1.0-opacity)*c2;\n}\n\nvec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n}\n\nfloat blend_overlay_f(float c1, float c2) {\n\treturn (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n}\n\nvec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2;\n}\n\nfloat blend_soft_light_f(float c1, float c2) {\n\treturn (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n}\n\nvec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_burn_f(float c1, float c2) {\n\treturn (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n}\n\nvec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_dodge_f(float c1, float c2) {\n\treturn (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n}\n\nvec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*max(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*min(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n}\n", +# "inputs": [ +# { +# "default": "vec4(round($uv.x) , 1.0, 1.0, 1.0)", +# "label": "Source1", +# "longdesc": "The foreground input", +# "name": "s1", +# "shortdesc": "Foreground", +# "type": "rgba" +# }, +# { +# "default": "vec4(1.0, $uv.y, 1.0, 1.0)", +# "label": "Source2", +# "longdesc": "The background input", +# "name": "s2", +# "shortdesc": "Background", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "label": "Opacity", +# "longdesc": "The optional opacity mask", +# "name": "a", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "instance": "", +# "longdesc": "Blends its input, using an optional mask", +# "name": "Blend", +# "outputs": [ +# { +# "longdesc": "Shows the result of the blend operation", +# "rgba": "vec4(blend_$blend_type($uv, $(name_uv)_s1.rgb, $(name_uv)_s2.rgb, $(name_uv)_a*$(name_uv)_s1.a), min(1.0, $(name_uv)_s2.a+$(name_uv)_a*$(name_uv)_s1.a))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "The algorithm used to blend the inputs", +# "name": "blend_type", +# "shortdesc": "Blend mode", +# "type": "enum", +# "values": [ +# { +# "name": "Normal", +# "value": "normal" +# }, +# { +# "name": "Dissolve", +# "value": "dissolve" +# }, +# { +# "name": "Multiply", +# "value": "multiply" +# }, +# { +# "name": "Screen", +# "value": "screen" +# }, +# { +# "name": "Overlay", +# "value": "overlay" +# }, +# { +# "name": "Hard Light", +# "value": "hard_light" +# }, +# { +# "name": "Soft Light", +# "value": "soft_light" +# }, +# { +# "name": "Burn", +# "value": "burn" +# }, +# { +# "name": "Dodge", +# "value": "dodge" +# }, +# { +# "name": "Lighten", +# "value": "lighten" +# }, +# { +# "name": "Darken", +# "value": "darken" +# }, +# { +# "name": "Difference", +# "value": "difference" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "3:", +# "longdesc": "The opacity of the blend operation", +# "max": 1, +# "min": 0, +# "name": "amount", +# "shortdesc": "Opacity", +# "step": 0.01, +# "type": "float" +# } +# ], +# "shortdesc": "Blend" +# }, +# "type": "shader" +# } +# ], +# "parameters": { +# "param0": 10, +# "param1": 4, +# "param2": 1, +# "param3": 1, +# "param4": 1 +# }, +# "shortdesc": "Smooth Curvature", +# "type": "graph" +#} + +#---------------------- +#supersample.mmg +#A filter that samples sub-pixel details to make them visible + +# "inputs": [ +# { +# "default": "vec4(1.0, 1.0, 1.0, 1.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "instance": "vec4 supersample_$(name)(vec2 uv, float size, int count, float width) {\n\tvec4 rv = vec4(0.0);\n\tvec2 step_size = vec2(width)/size/float(count);\n\tuv -= vec2(0.5)/size;\n\tfor (int x = 0; x < count; ++x) {\n\t\tfor (int y = 0; y < count; ++y) {\n\t\t\trv += $in(uv+(vec2(float(x), float(y))+vec2(0.5))*step_size);\n\t\t}\n\t}\n\treturn rv/float(count*count);\n}", +# "outputs": [ +# { +# "longdesc": "Shows the supersampled image. Due to the performance cost of this node, it is recommended to connect a buffer directly to this output.", +# "rgba": "supersample_$(name)($uv, $size, int($count), $width)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 10, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the output", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 2, +# "label": "Count", +# "longdesc": "The number of samples on each axis. High values will badly impact performances.", +# "max": 5, +# "min": 2, +# "name": "count", +# "shortdesc": "Count", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "longdesc": "The width of the sampled area. Setting this value higher than 1 will sample neighbouring pixels and antialias the result.", +# "max": 2, +# "min": 1, +# "name": "width", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#swap_channels.mmg +#Swaps the channels of its RGBA input + +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "label": "", +# "longdesc": "The input RGBA image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "The output RGBA image", +# "rgba": "vec4($out_r,$out_g,$out_b,$out_a)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 2, +# "label": "R", +# "longdesc": "The input channel to be assigned to the Red channel", +# "name": "out_r", +# "shortdesc": "Red", +# "type": "enum", +# "values": [ +# { +# "name": "0", +# "value": "0.0" +# }, +# { +# "name": "1", +# "value": "1.0" +# }, +# { +# "name": "R", +# "value": "$in($uv).r" +# }, +# { +# "name": "-R", +# "value": "1.0-$in($uv).r" +# }, +# { +# "name": "G", +# "value": "$in($uv).g" +# }, +# { +# "name": "-G", +# "value": "1.0-$in($uv).g" +# }, +# { +# "name": "B", +# "value": "$in($uv).b" +# }, +# { +# "name": "-B", +# "value": "1.0-$in($uv).b" +# }, +# { +# "name": "A", +# "value": "$in($uv).a" +# }, +# { +# "name": "-A", +# "value": "1.0-$in($uv).a" +# } +# ] +# }, +# { +# "default": 4, +# "label": "G", +# "longdesc": "The input channel to be assigned to the Green channel", +# "name": "out_g", +# "shortdesc": "Green", +# "type": "enum", +# "values": [ +# { +# "name": "0", +# "value": "0.0" +# }, +# { +# "name": "1", +# "value": "1.0" +# }, +# { +# "name": "R", +# "value": "$in($uv).r" +# }, +# { +# "name": "-R", +# "value": "1.0-$in($uv).r" +# }, +# { +# "name": "G", +# "value": "$in($uv).g" +# }, +# { +# "name": "-G", +# "value": "1.0-$in($uv).g" +# }, +# { +# "name": "B", +# "value": "$in($uv).b" +# }, +# { +# "name": "-B", +# "value": "1.0-$in($uv).b" +# }, +# { +# "name": "A", +# "value": "$in($uv).a" +# }, +# { +# "name": "-A", +# "value": "1.0-$in($uv).a" +# } +# ] +# }, +# { +# "default": 6, +# "label": "B", +# "longdesc": "The input channel to be assigned to the Blue channel", +# "name": "out_b", +# "shortdesc": "Blue", +# "type": "enum", +# "values": [ +# { +# "name": "0", +# "value": "0.0" +# }, +# { +# "name": "1", +# "value": "1.0" +# }, +# { +# "name": "R", +# "value": "$in($uv).r" +# }, +# { +# "name": "-R", +# "value": "1.0-$in($uv).r" +# }, +# { +# "name": "G", +# "value": "$in($uv).g" +# }, +# { +# "name": "-G", +# "value": "1.0-$in($uv).g" +# }, +# { +# "name": "B", +# "value": "$in($uv).b" +# }, +# { +# "name": "-B", +# "value": "1.0-$in($uv).b" +# }, +# { +# "name": "A", +# "value": "$in($uv).a" +# }, +# { +# "name": "-A", +# "value": "1.0-$in($uv).a" +# } +# ] +# }, +# { +# "default": 8, +# "label": "A", +# "longdesc": "The input channel to be assigned to the Alpha channel", +# "name": "out_a", +# "shortdesc": "Alpha", +# "type": "enum", +# "values": [ +# { +# "name": "0", +# "value": "0.0" +# }, +# { +# "name": "1", +# "value": "1.0" +# }, +# { +# "name": "R", +# "value": "$in($uv).r" +# }, +# { +# "name": "-R", +# "value": "1.0-$in($uv).r" +# }, +# { +# "name": "G", +# "value": "$in($uv).g" +# }, +# { +# "name": "-G", +# "value": "1.0-$in($uv).g" +# }, +# { +# "name": "B", +# "value": "$in($uv).b" +# }, +# { +# "name": "-B", +# "value": "1.0-$in($uv).b" +# }, +# { +# "name": "A", +# "value": "$in($uv).a" +# }, +# { +# "name": "-A", +# "value": "1.0-$in($uv).a" +# } +# ] +# } +# ], + +#---------------------- +#math_v3.mmg +#Performs a math operation using its inputs or parameter values + +# "code": "vec3 $(name_uv)_clamp_false = $op;\nvec3 $(name_uv)_clamp_true = clamp($(name_uv)_clamp_false, vec3(0.0), vec3(1.0));\n", +# "inputs": [ +# { +# "default": "vec3($d_in1_x, $d_in1_y, $d_in1_z)", +# "label": "2:A", +# "longdesc": "The A operand", +# "name": "in1", +# "shortdesc": "A", +# "type": "rgb" +# }, +# { +# "default": "vec3($d_in2_x, $d_in2_y, $d_in2_z)", +# "label": "B", +# "longdesc": "The B operand", +# "name": "in2", +# "shortdesc": "B", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows a greyscale image of the result", +# "rgb": "$(name_uv)_clamp_$clamp", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 19, +# "label": "", +# "longdesc": "The operation to be performed", +# "name": "op", +# "shortdesc": "Operation", +# "type": "enum", +# "values": [ +# { +# "name": "A+B", +# "value": "$in1($uv)+$in2($uv)" +# }, +# { +# "name": "A-B", +# "value": "$in1($uv)-$in2($uv)" +# }, +# { +# "name": "A*B", +# "value": "$in1($uv)*$in2($uv)" +# }, +# { +# "name": "A/B", +# "value": "$in1($uv)/$in2($uv)" +# }, +# { +# "name": "log(A)", +# "value": "log($in1($uv))" +# }, +# { +# "name": "log2(A)", +# "value": "log2($in1($uv))" +# }, +# { +# "name": "pow(A, B)", +# "value": "pow($in1($uv),$in2($uv))" +# }, +# { +# "name": "abs(A)", +# "value": "abs($in1($uv))" +# }, +# { +# "name": "round(A)", +# "value": "round($in1($uv))" +# }, +# { +# "name": "floor(A)", +# "value": "floor($in1($uv))" +# }, +# { +# "name": "ceil(A)", +# "value": "ceil($in1($uv))" +# }, +# { +# "name": "trunc(A)", +# "value": "trunc($in1($uv))" +# }, +# { +# "name": "fract(A)", +# "value": "fract($in1($uv))" +# }, +# { +# "name": "min(A, B)", +# "value": "min($in1($uv),$in2($uv))" +# }, +# { +# "name": "max(A, B)", +# "value": "max($in1($uv),$in2($uv))" +# }, +# { +# "name": "A Vector3: var K : Color = Color(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); @@ -263,3 +4673,86 @@ static func grayscale_luminosity(c : Vector3) -> float: static func invert(color : Color) -> Color: return Color(1.0 - color.r, 1.0 - color.g, 1.0 - color.b, color.a); + + +#vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*c1 + (1.0-opacity)*c2;\n +#} + +#vec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# if (rand(uv) < opacity) {\n\t\t +# return c1;\n\t +# } else {\n\t\t +# return c2;\n\t +# }\n +#} + +#vec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*c1*c2 + (1.0-opacity)*c2;\n +#} + +#vec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n +#} + +#float blend_overlay_f(float c1, float c2) {\n\t +# return (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n +#} + +#vec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n +#} + +#vec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2;\n +#} + +#float blend_soft_light_f(float c1, float c2) {\n\t +# return (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n +#} + +#vec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n +#} + +#float blend_burn_f(float c1, float c2) {\n\t +# return (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n +#} + +#vec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2; +#} + +#float blend_dodge_f(float c1, float c2) {\n\t +# return (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n +#} + +#vec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n +#} + +#vec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*max(c1, c2) + (1.0-opacity)*c2;\n +#} + +#vec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*min(c1, c2) + (1.0-opacity)*c2;\n +#} + +#vec3 blend_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\t +# return opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n +#} + +#vec4 adjust_levels(vec4 input, vec4 in_min, vec4 in_mid, vec4 in_max, vec4 out_min, vec4 out_max) {\n\t +# input = clamp((input-in_min)/(in_max-in_min), 0.0, 1.0);\n\t +# in_mid = (in_mid-in_min)/(in_max-in_min);\n\t +# vec4 dark = step(in_mid, input);\n\t +# +# input = 0.5*mix(input/(in_mid), 1.0+(input-in_mid)/(1.0-in_mid), dark);\n\t +# return out_min+input*(out_max-out_min);\n +#} + + + + + diff --git a/game/addons/mat_maker_gd/nodes/common/commons.gd b/game/addons/mat_maker_gd/nodes/common/commons.gd index e46a597f..add0fefe 100644 --- a/game/addons/mat_maker_gd/nodes/common/commons.gd +++ b/game/addons/mat_maker_gd/nodes/common/commons.gd @@ -3,6 +3,91 @@ extends Reference #pattern.mmg +#---------------------- +#hlsl_defs.tmpl + +##define hlsl_atan(x,y) atan2(x, y) +##define mod(x,y) ((x)-(y)*floor((x)/(y))) +#inline float4 textureLod(sampler2D tex, float2 uv, float lod) { +# return tex2D(tex, uv); +#} +#inline float2 tofloat2(float x) { +# return float2(x, x); +#} +#inline float2 tofloat2(float x, float y) { +# return float2(x, y); +#} +#inline float3 tofloat3(float x) { +# return float3(x, x, x); +#} +#inline float3 tofloat3(float x, float y, float z) { +# return float3(x, y, z); +#} +#inline float3 tofloat3(float2 xy, float z) { +# return float3(xy.x, xy.y, z); +#} +#inline float3 tofloat3(float x, float2 yz) { +# return float3(x, yz.x, yz.y); +#} +#inline float4 tofloat4(float x, float y, float z, float w) { +# return float4(x, y, z, w); +#} +#inline float4 tofloat4(float x) { +# return float4(x, x, x, x); +#} +#inline float4 tofloat4(float x, float3 yzw) { +# return float4(x, yzw.x, yzw.y, yzw.z); +#} +#inline float4 tofloat4(float2 xy, float2 zw) { +# return float4(xy.x, xy.y, zw.x, zw.y); +#} +#inline float4 tofloat4(float3 xyz, float w) { +# return float4(xyz.x, xyz.y, xyz.z, w); +#} +#inline float2x2 tofloat2x2(float2 v1, float2 v2) { +# return float2x2(v1.x, v1.y, v2.x, v2.y); +#} + +#---------------------- +#glsl_defs.tmpl + +#float rand(vec2 x) { +# return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5453); +#} + +#vec2 rand2(vec2 x) { +# return fract(cos(mod(vec2(dot(x, vec2(13.9898, 8.141)), +# dot(x, vec2(3.4562, 17.398))), vec2(3.14))) * 43758.5453); +#} + +#vec3 rand3(vec2 x) { +# return fract(cos(mod(vec3(dot(x, vec2(13.9898, 8.141)), +# dot(x, vec2(3.4562, 17.398)), +# dot(x, vec2(13.254, 5.867))), vec3(3.14))) * 43758.5453); +#} + +#float param_rnd(float minimum, float maximum, float seed) { +# return minimum+(maximum-minimum)*rand(vec2(seed)); +#} + +#vec3 rgb2hsv(vec3 c) { +# vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); +# vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); +# vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); +# +# float d = q.x - min(q.w, q.y); +# float e = 1.0e-10; +# return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +#} + +#vec3 hsv2rgb(vec3 c) { +# vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); +# vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); +# return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +#} + +#---------------------- + static func clampv3(v : Vector3, mi : Vector3, ma : Vector3) -> Vector3: v.x = clamp(v.x, mi.x, ma.x) v.y = clamp(v.y, mi.y, ma.y) diff --git a/game/addons/mat_maker_gd/nodes/common/edge_detect.gd b/game/addons/mat_maker_gd/nodes/common/edge_detect.gd index 3ea3843b..a4fc7547 100644 --- a/game/addons/mat_maker_gd/nodes/common/edge_detect.gd +++ b/game/addons/mat_maker_gd/nodes/common/edge_detect.gd @@ -171,3 +171,53 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # } # ], +#---------------------- +#mul_detect.mmg + +# "code": "float $(name_uv)_d = ($in($uv)-$v)/$t;", +# "global": "", +# "inputs": [ +# { +# "default": "1.0", +# "label": "", +# "name": "mul", +# "type": "f" +# }, +# { +# "default": "0.0", +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "MulDetect", +# "outputs": [ +# { +# "f": "$mul($uv)*clamp(1.0-$(name_uv)_d*$(name_uv)_d, 0.0, 1.0)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Value", +# "max": 1, +# "min": 0, +# "name": "v", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.1, +# "label": "Tolerance", +# "max": 1, +# "min": 0.01, +# "name": "t", +# "step": 0.001, +# "type": "float" +# } +# ] + diff --git a/game/addons/mat_maker_gd/nodes/common/noises.gd b/game/addons/mat_maker_gd/nodes/common/noises.gd index b55e32ba..98a29dd0 100644 --- a/game/addons/mat_maker_gd/nodes/common/noises.gd +++ b/game/addons/mat_maker_gd/nodes/common/noises.gd @@ -39,6 +39,85 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # return color; #} +#---------------------- +#noise_anisotropic.mmg +#Generates x-axis interpolated value noise + +# "outputs": [ +# { +# "f": "anisotropic($(uv), vec2($(scale_x), $(scale_y)), $(seed), $(smoothness), $(interpolation))", +# "longdesc": "Shows a greyscale value noise", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 4, +# "label": "Scale X", +# "longdesc": "The scale along the X axis", +# "max": 32, +# "min": 1, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 256, +# "label": "Scale Y", +# "longdesc": "The scale along the Y axis", +# "max": 1024, +# "min": 1, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Smoothness", +# "longdesc": "Controls how much the noise is blurred along the x-axis", +# "max": 1, +# "min": 0, +# "name": "smoothness", +# "shortdesc": "Smoothness", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Interpolation", +# "longdesc": "Controls the type of interpolation used for the smoothing. 0 is linear interpolation, 1 is smooth interpolation", +# "max": 1, +# "min": 0, +# "name": "interpolation", +# "shortdesc": "Interpolation", +# "step": 0.01, +# "type": "float" +# } +# ], + static func dots(uv : Vector2, size : float, density : float, pseed : float) -> float: return 0.0 + +#float anisotropic(vec2 uv, vec2 size, float seed, float smoothness, float interpolation) {\n\ +# tvec2 seed2 = rand2(vec2(seed, 1.0-seed));\n\t\n\t +# vec2 xy = floor(uv*size);\n\t +# vec2 offset = vec2(rand(seed2 + xy.y), 0.0);\n\t +# vec2 xy_offset = floor(uv * size + offset );\n +# +# float f0 = rand(seed2+mod(xy_offset, size));\n +# float f1 = rand(seed2+mod(xy_offset+vec2(1.0, 0.0), size));\n\t +# float mixer = clamp( (fract(uv.x*size.x+offset.x) -.5) / smoothness + 0.5, 0.0, 1.0 );\n +# float smooth_mix = smoothstep(0.0, 1.0, mixer);\n\t +# float linear = mix(f0, f1, mixer);\n\t +# float smoothed = mix(f0, f1, smooth_mix);\n\t\n +# +# return mix(linear, smoothed, interpolation);\n +#} diff --git a/game/addons/mat_maker_gd/nodes/common/patterns.gd b/game/addons/mat_maker_gd/nodes/common/patterns.gd index 98b42cf0..d40627c5 100644 --- a/game/addons/mat_maker_gd/nodes/common/patterns.gd +++ b/game/addons/mat_maker_gd/nodes/common/patterns.gd @@ -302,6 +302,58 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # } # ] +#---------------------- +#sine_wave.mmg +#Draws a greyscale sine wave pattern + +# "outputs": [ +# { +# "f": "1.0-abs(2.0*($uv.y-0.5)-$amplitude*sin(($frequency*$uv.x+$phase)*6.28318530718))", +# "longdesc": "Shows a greyscale image of a sine wave", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Amplitude", +# "longdesc": "The amplitude of the sine wave function", +# "max": 1, +# "min": 0, +# "name": "amplitude", +# "shortdesc": "Amplitude", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Frequency", +# "longdesc": "The frequency of the sine wave function (i.e. the number of oscillations shown in the generated image).", +# "max": 16, +# "min": 0, +# "name": "frequency", +# "shortdesc": "Frequency", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Phase", +# "longdesc": "The phase of the sine wave function", +# "max": 1, +# "min": 0, +# "name": "phase", +# "shortdesc": "Phase", +# "step": 0.01, +# "type": "float" +# } +# ], + + enum CombinerAxisType { SINE, TRIANGLE, diff --git a/game/addons/mat_maker_gd/nodes/common/simple.gd b/game/addons/mat_maker_gd/nodes/common/simple.gd new file mode 100644 index 00000000..50bfa0ce --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/simple.gd @@ -0,0 +1,147 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#profile.mmg + +# "inputs": [ +# { +# "default": "dot($gradient($uv.x).xyz, vec3(1.0/3.0))", +# "label": "2:", +# "name": "in", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "f": "draw_profile_$style($uv, $in($uv), (dot($gradient($uv.x+0.001).xyz, vec3(1.0/3.0))-dot($gradient($uv.x-0.001).xyz, vec3(1.0/3.0)))/0.002, max(0.0001, $width))", +# "longdesc": "An image showing the profile defined by the gradient", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "Style of the output image (fill or curve)", +# "name": "style", +# "shortdesc": "Style", +# "type": "enum", +# "values": [ +# { +# "name": "Curve", +# "value": "curve" +# }, +# { +# "name": "Fill", +# "value": "fill" +# } +# ] +# }, +# { +# "default": { +# "interpolation": 1, +# "points": [ +# { +# "a": 1, +# "b": 0, +# "g": 0, +# "pos": 0, +# "r": 0 +# }, +# { +# "a": 1, +# "b": 1, +# "g": 1, +# "pos": 1, +# "r": 1 +# } +# ], +# "type": "Gradient" +# }, +# "label": "", +# "longdesc": "Gradient that defines the profile to be shown", +# "name": "gradient", +# "shortdesc": "Gradient", +# "type": "gradient" +# }, +# { +# "control": "None", +# "default": 0.05, +# "label": "", +# "longdesc": "Width of the curve", +# "max": 1, +# "min": 0, +# "name": "width", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# } +# ] + +#---------------------- +#uniform.mmg +#Draws a uniform image + +# "outputs": [ +# { +# "longdesc": "A uniform image of the selected color", +# "rgba": "$(color)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": { +# "a": 1, +# "b": 1, +# "g": 1, +# "r": 1 +# }, +# "label": "", +# "longdesc": "Color of the uniform image", +# "name": "color", +# "shortdesc": "Color", +# "type": "color" +# } +# ] + +#---------------------- +#uniform_greyscale.mmg +#Draws a uniform greyscale image + +# "outputs": [ +# { +# "f": "$(color)", +# "longdesc": "A uniform image of the selected value", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "", +# "longdesc": "The value of the uniform greyscale image", +# "max": 1, +# "min": 0, +# "name": "color", +# "shortdesc": "Value", +# "step": 0.01, +# "type": "float" +# } +# ] + +#float draw_profile_fill(vec2 uv, float y, float dy, float w) {\n\t +# return 1.0-clamp(sin(1.57079632679-atan(dy))*(1.0-uv.y-y)/w, 0.0, 1.0);\n +#} + +#float draw_profile_curve(vec2 uv, float y, float dy, float w) {\n\t +# return 1.0-clamp(sin(1.57079632679-atan(dy))*abs(1.0-uv.y-y)/w, 0.0, 1.0);\n +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/transforms.gd b/game/addons/mat_maker_gd/nodes/common/transforms.gd index 3eac6671..30d20d00 100644 --- a/game/addons/mat_maker_gd/nodes/common/transforms.gd +++ b/game/addons/mat_maker_gd/nodes/common/transforms.gd @@ -1752,6 +1752,130 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # "type": "shader" #} +#---------------------- +#repeat.mmg +#Translates, rotates and scales its input + +# "inputs": [ +# { +# "default": "vec4($uv, 0.0, 1.0)", +# "label": "", +# "longdesc": "The input image to be transformed", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the transformed image", +# "rgba": "$i(fract($uv))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], + +#---------------------- +#remap.mmg +#The remapped image map + +# "code": "float $(name_uv)_x = $in($uv)*($max-$min);", +# "inputs": [ +# { +# "default": "0.0", +# "label": "", +# "longdesc": "The greyscale input map", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "f": "$min+$(name_uv)_x-mod($(name_uv)_x, max($step, 0.00000001))", +# "longdesc": "The remapped image map", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "Min", +# "longdesc": "The value generated for black areas of the input", +# "max": 10, +# "min": -10, +# "name": "min", +# "shortdesc": "Min", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Max", +# "longdesc": "The value generated for white areas of the input", +# "max": 10, +# "min": -10, +# "name": "max", +# "shortdesc": "Max", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Step", +# "longdesc": "The step between generated values", +# "max": 1, +# "min": 0, +# "name": "step", +# "shortdesc": "Step", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#height_to_angle.mmg +#Generates an angle map to be used by Advances Tiler nodes from a heightmap + +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The input heightmap", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv, float epsilon) {\n\tvec3 e = vec3(epsilon, -epsilon, 0);\n\tvec2 rv = vec2(1.0, -1.0)*$in(uv+e.xy);\n\trv += vec2(-1.0, 1.0)*$in(uv-e.xy);\n\trv += vec2(1.0, 1.0)*$in(uv+e.xx);\n\trv += vec2(-1.0, -1.0)*$in(uv-e.xx);\n\trv += vec2(2.0, 0.0)*$in(uv+e.xz);\n\trv += vec2(-2.0, 0.0)*$in(uv-e.xz);\n\trv += vec2(0.0, 2.0)*$in(uv+e.zx);\n\trv += vec2(0.0, -2.0)*$in(uv-e.zx);\n\treturn atan(rv.y, rv.x)/3.141592;\n}", +# "outputs": [ +# { +# "f": "$(name)_fct($uv, 0.0001)+$angle/180.0", +# "longdesc": "The generated angle map. Values are between -1 and 1 and the corresponding Advanced Tiler parameter (Rotate) must be set to 180.", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The offset angle applied to the generated map", +# "max": 180, +# "min": -180, +# "name": "angle", +# "shortdesc": "Angle", +# "step": 0.01, +# "type": "float" +# } +# ], + #vec2 transform(vec2 uv, vec2 translate, float rotate, vec2 scale, bool repeat) {\n \t # vec2 rv;\n\t # uv -= translate;\n\t diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/auto_tones.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/auto_tones.mmg deleted file mode 100644 index 3958a373..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/auto_tones.mmg +++ /dev/null @@ -1,386 +0,0 @@ -{ - "connections": [ - { - "from": "graph", - "from_port": 0, - "to": "tones_map", - "to_port": 1 - }, - { - "from": "graph", - "from_port": 1, - "to": "tones_map", - "to_port": 2 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "graph", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "tones_map", - "to_port": 0 - }, - { - "from": "tones_map", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Auto Tones", - "longdesc": "Finds the minimum and maximum values in the input texture and tone maps it to the full 0.0 - 1.0 range.", - "name": "auto_tones", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "connections": [ - { - "from": "combine", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 0 - }, - { - "from": "decompose", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "decompose", - "from_port": 1, - "to": "gen_outputs", - "to_port": 1 - }, - { - "from": "iterate_buffer", - "from_port": 0, - "to": "decompose", - "to_port": 0 - }, - { - "from": "iterate_buffer", - "from_port": 1, - "to": "14423", - "to_port": 0 - }, - { - "from": "14423", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "combine", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "combine", - "to_port": 1 - } - ], - "label": "Find Min Max", - "longdesc": "", - "name": "graph", - "node_position": { - "x": 1105.399902, - "y": -179.398849 - }, - "nodes": [ - { - "name": "14423", - "node_position": { - "x": 344, - "y": 217 - }, - "parameters": { - "size": 10 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec3 $(name)_compare(vec2 uv, float size) {\n\tfloat iter = $in(uv).b;\n\tsize = size / pow(2.0, (iter * 100.0) );\n\titer += 0.01;\n\tfloat pixel_offset = 1.0 / size;\n\tvec2 half_res_uv = floor(uv * size / 2.0) / size * 2.0 + pixel_offset / 2.0;\n\tvec3 values[4];\n\tvalues[0] = $in(half_res_uv);\n\tvalues[1] = $in(half_res_uv + vec2(pixel_offset, 0.0));\n\tvalues[2] = $in(half_res_uv + vec2(0.0, pixel_offset));\n\tvalues[3] = $in(half_res_uv + vec2(pixel_offset, pixel_offset));\n\t\n\tfloat lowest = 1.0;\n\tfloat highest = 0.0;\n\t\n\tfor (int i = 0; i < 4; i++) {\n\t\tlowest = values[i].r < lowest ? values[i].r : lowest;\n\t\thighest = values[i].g > highest ? values[i].g : highest;\n\t}\n\t\n\treturn vec3( lowest, highest , iter);\n}", - "name": "Compare Neighbor", - "outputs": [ - { - "rgb": "$(name)_compare($uv, $size)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 10, - "first": 1, - "label": "", - "last": 13, - "name": "size", - "type": "size" - } - ] - }, - "type": "shader" - }, - { - "name": "iterate_buffer", - "node_position": { - "x": 328, - "y": 63 - }, - "parameters": { - "filter": false, - "iterations": 13, - "mipmap": false, - "size": 10 - }, - "seed_value": 29168, - "type": "iterate_buffer" - }, - { - "name": "combine", - "node_position": { - "x": 376, - "y": -75 - }, - "parameters": { - - }, - "type": "combine" - }, - { - "name": "decompose", - "node_position": { - "x": 605, - "y": 64 - }, - "parameters": { - - }, - "type": "decompose" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -199, - "y": 23 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "", - "name": "in", - "shortdesc": "In", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 831, - "y": 42 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "", - "name": "min", - "shortdesc": "Min", - "type": "f" - }, - { - "group_size": 0, - "longdesc": "", - "name": "max", - "shortdesc": "Max", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": 248.399994, - "y": -292 - }, - "parameters": { - "param0": 10 - }, - "type": "remote", - "widgets": [ - { - "label": "Size", - "linked_widgets": [ - { - "node": "iterate_buffer", - "widget": "size" - }, - { - "node": "14423", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "param0": 10 - }, - "shortdesc": "", - "type": "graph" - }, - { - "name": "tones_map", - "node_position": { - "x": 1142.528442, - "y": -88.26989 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(0.5 ,0.5, 0.5, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "f" - }, - { - "default": "0.0", - "label": "", - "name": "in_min", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "name": "in_max", - "type": "f" - } - ], - "instance": "", - "longdesc": "Maps linearly an input tones interval to an output tones interval.", - "name": "Mapping", - "outputs": [ - { - "f": "($in($uv)-$in_min($uv))/($in_max($uv)-$in_min($uv))", - "longdesc": "Shows the generated remapped image", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - - ], - "shortdesc": "Tones map" - }, - "type": "shader" - }, - { - "name": "gen_inputs", - "node_position": { - "x": 665.528564, - "y": -136.535721 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 1425.400024, - "y": -135.535721 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "Shows the generated remapped image", - "name": "out", - "shortdesc": "Output", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": 1024.664307, - "y": -298.400757 - }, - "parameters": { - "param0": 10 - }, - "type": "remote", - "widgets": [ - { - "label": "", - "linked_widgets": [ - { - "node": "graph", - "widget": "param0" - } - ], - "longdesc": "Buffers are used to find the mininum and maximum values for the input image. If the input has small details a higher resolution buffer might be needed to capture precise min and max values.\n\nNote: The output itself will not be buffered.", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "param0": 10 - }, - "shortdesc": "Auto Tones", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/blend.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/blend.mmg deleted file mode 100644 index 1fbbbd4c..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/blend.mmg +++ /dev/null @@ -1,126 +0,0 @@ -{ - "name": "blend", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "amount": 0.5, - "blend_type": 0 - }, - "shader_model": { - "code": "vec4 $(name_uv)_s1 = $s1($uv);\nvec4 $(name_uv)_s2 = $s2($uv);\nfloat $(name_uv)_a = $amount*$a($uv);\n", - "global": "vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1 + (1.0-opacity)*c2;\n}\n\nvec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\tif (rand(uv) < opacity) {\n\t\treturn c1;\n\t} else {\n\t\treturn c2;\n\t}\n}\n\nvec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1*c2 + (1.0-opacity)*c2;\n}\n\nvec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n}\n\nfloat blend_overlay_f(float c1, float c2) {\n\treturn (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n}\n\nvec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2;\n}\n\nfloat blend_soft_light_f(float c1, float c2) {\n\treturn (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n}\n\nvec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_burn_f(float c1, float c2) {\n\treturn (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n}\n\nvec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_dodge_f(float c1, float c2) {\n\treturn (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n}\n\nvec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*max(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*min(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n}\n", - "inputs": [ - { - "default": "vec4($uv.x, 1.0, 1.0, 1.0)", - "label": "Source1", - "longdesc": "The foreground input", - "name": "s1", - "shortdesc": "Foreground", - "type": "rgba" - }, - { - "default": "vec4(1.0, $uv.y, 1.0, 1.0)", - "label": "Source2", - "longdesc": "The background input", - "name": "s2", - "shortdesc": "Background", - "type": "rgba" - }, - { - "default": "1.0", - "label": "Opacity", - "longdesc": "The optional opacity mask", - "name": "a", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "", - "longdesc": "Blends its input, using an optional mask", - "name": "Blend", - "outputs": [ - { - "longdesc": "Shows the result of the blend operation", - "rgba": "vec4(blend_$blend_type($uv, $(name_uv)_s1.rgb, $(name_uv)_s2.rgb, $(name_uv)_a*$(name_uv)_s1.a), min(1.0, $(name_uv)_s2.a+$(name_uv)_a*$(name_uv)_s1.a))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "longdesc": "The algorithm used to blend the inputs", - "name": "blend_type", - "shortdesc": "Blend mode", - "type": "enum", - "values": [ - { - "name": "Normal", - "value": "normal" - }, - { - "name": "Dissolve", - "value": "dissolve" - }, - { - "name": "Multiply", - "value": "multiply" - }, - { - "name": "Screen", - "value": "screen" - }, - { - "name": "Overlay", - "value": "overlay" - }, - { - "name": "Hard Light", - "value": "hard_light" - }, - { - "name": "Soft Light", - "value": "soft_light" - }, - { - "name": "Burn", - "value": "burn" - }, - { - "name": "Dodge", - "value": "dodge" - }, - { - "name": "Lighten", - "value": "lighten" - }, - { - "name": "Darken", - "value": "darken" - }, - { - "name": "Difference", - "value": "difference" - } - ] - }, - { - "control": "None", - "default": 0.5, - "label": "3:", - "longdesc": "The opacity of the blend operation", - "max": 1, - "min": 0, - "name": "amount", - "shortdesc": "Opacity", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Blend" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush.mmg deleted file mode 100644 index 950bf9d2..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush.mmg +++ /dev/null @@ -1,169 +0,0 @@ -{ - "name": "brush", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "has_albedo": true, - "has_depth": false, - "has_emission": false, - "has_normal": false, - "has_metallic": true, - "has_roughness": true, - "mode": 0 - }, - "is_brush": true, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "clamp(1.0-2.0*length($uv-vec2(0.5)), 0.0, 1.0)", - "label": "Brush", - "name": "brush", - "type": "f" - }, - { - "default": "vec4(1.0)", - "group_size": 5, - "label": "Albedo", - "name": "albedo", - "type": "rgba" - }, - { - "default": "0.0", - "label": "Metallic", - "name": "metallic", - "type": "f" - }, - { - "default": "0.0", - "label": "Roughness", - "name": "roughness", - "type": "f" - }, - { - "default": "vec4(0.0)", - "label": "Emission", - "name": "emission", - "type": "rgba" - }, - { - "default": "vec4(0.5, 0.5, 0.0, 0.0)", - "label": "Normal", - "name": "normal", - "type": "rgba" - }, - { - "default": "0.0", - "label": "Depth", - "name": "depth", - "type": "f" - }, - { - "default": "1.0", - "label": "Occlusion", - "name": "ao", - "type": "f" - } - ], - "instance": "", - "name": "Brush", - "outputs": [ - { - "f": "$brush($uv)", - "type": "f" - }, - { - "rgba": "$albedo($uv)", - "type": "rgba" - }, - { - "rgba": "vec4($metallic($uv), $roughness($uv), $has_metallic ? $albedo($uv).a : 0.0, $has_roughness ? $albedo($uv).a : 0.0)", - "type": "rgba" - }, - { - "rgba": "$emission($uv)", - "type": "rgba" - }, - { - "rgba": "$normal($uv)", - "type": "rgba" - }, - { - "rgba": "vec4($depth($uv), $ao($uv), $has_depth ? $albedo($uv).a : 0.0, $has_ao ? $albedo($uv).a : 0.0)", - "type": "rgba" - }, - { - "rgba": "vec4(vec3(1.0), $albedo($uv).a)", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "mode", - "type": "enum", - "values": [ - { - "name": "Stamp", - "value": "stamp" - }, - { - "name": "Pattern", - "value": "pattern" - }, - { - "name": "UV Pattern", - "value": "uv_pattern" - } - ] - }, - { - "default": true, - "label": "", - "name": "has_albedo", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_metallic", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_roughness", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_emission", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_normal", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_depth", - "type": "boolean" - }, - { - "default": false, - "label": "", - "name": "has_ao", - "type": "boolean" - } - ] - }, - "type": "brush_node" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush_select_from_id.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush_select_from_id.mmg deleted file mode 100644 index 3c541c27..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/brush_select_from_id.mmg +++ /dev/null @@ -1,56 +0,0 @@ -{ - "name": "brush_select_from_id", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "id": { - "a": 1, - "b": 1, - "g": 1, - "r": 0, - "type": "Color" - } - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "label": "", - "name": "in", - "type": "rgba" - }, - { - "default": "vec4(1.0)", - "label": "", - "name": "ids", - "type": "rgba" - } - ], - "instance": "", - "name": "Select From ID", - "outputs": [ - { - "rgba": "$in($uv)*vec4(1.0, 1.0, 1.0, step(length($ids($uv)-$id), 0.01))", - "type": "rgba" - } - ], - "parameters": [ - { - "default": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "label": "", - "name": "id", - "type": "color" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/combine.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/combine.mmg deleted file mode 100644 index bd9d6452..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/combine.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "combine", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "R", - "longdesc": "The greyscale input for the red channel", - "name": "r", - "shortdesc": "Red", - "type": "f" - }, - { - "default": "0.0", - "label": "G", - "longdesc": "The greyscale input for the green channel", - "name": "g", - "shortdesc": "Green", - "type": "f" - }, - { - "default": "0.0", - "label": "B", - "longdesc": "The greyscale input for the blue channel", - "name": "b", - "shortdesc": "Blue", - "type": "f" - }, - { - "default": "1.0", - "label": "A", - "longdesc": "The greyscale input for the alpha channel", - "name": "a", - "shortdesc": "Alpha", - "type": "f" - } - ], - "instance": "", - "longdesc": "Combines 4 greyscale inputs into an RGBA image", - "name": "Combine", - "outputs": [ - { - "longdesc": "Shows the combined RGBA image", - "rgba": "vec4($r($uv), $g($uv), $b($uv), $a($uv))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - - ], - "shortdesc": "Combine" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/compare.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/compare.mmg deleted file mode 100644 index 40199e65..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/compare.mmg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "compare", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in1", - "type": "rgba" - }, - { - "default": "0.0", - "label": "", - "name": "in2", - "type": "rgba" - } - ], - "instance": "", - "name": "Compare", - "outputs": [ - { - "f": "dot(abs($in1($uv)-$in2($uv)), vec4(1.0))", - "type": "f" - } - ], - "parameters": [ - - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/emboss.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/emboss.mmg deleted file mode 100644 index 468789eb..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/emboss.mmg +++ /dev/null @@ -1,242 +0,0 @@ -{ - "connections": [ - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "598", - "to_port": 0 - }, - { - "from": "598", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Emboss", - "longdesc": "Creates highlights and shadows from an input heightmap", - "name": "emboss", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -65.493774, - "y": -609.5 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "seed_value": 10109, - "type": "buffer" - }, - { - "name": "598", - "node_position": { - "x": -77.579605, - "y": -529.738281 - }, - "parameters": { - "amount": 5, - "angle": 0, - "size": 9, - "width": 1 - }, - "shader_model": { - "code": "", - "global": "", - "includes": [ - "" - ], - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "float $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tfloat rv = 0.0;\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy))*cos(atan(dy, dx)-$angle*3.14159265359/180.0)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Emboss", - "outputs": [ - { - "f": "$(name)_fct($uv)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -461.57959, - "y": -574.119141 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The input height map", - "name": "port0", - "shortdesc": "Input", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 187.506226, - "y": -557.119141 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The generated image", - "name": "port0", - "shortdesc": "Output", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -111.036682, - "y": -777.5 - }, - "parameters": { - "param0": 9, - "param1": 0, - "param2": 5, - "param3": 1 - }, - "type": "remote", - "widgets": [ - { - "label": "Size", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "598", - "widget": "size" - } - ], - "longdesc": "The resolution of the input image", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - }, - { - "label": "Angle", - "linked_widgets": [ - { - "node": "598", - "widget": "angle" - } - ], - "longdesc": "The angle of the simulated light", - "name": "param1", - "shortdesc": "Angle", - "type": "linked_control" - }, - { - "label": "Amount", - "linked_widgets": [ - { - "node": "598", - "widget": "amount" - } - ], - "longdesc": "The strength of the emboss effect", - "name": "param2", - "shortdesc": "Strength", - "type": "linked_control" - }, - { - "label": "Width", - "linked_widgets": [ - { - "node": "598", - "widget": "width" - } - ], - "longdesc": "The width (in pixels) of the area sampled for each pixel", - "name": "param3", - "shortdesc": "Width", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "param0": 9, - "param1": 0, - "param2": 5, - "param3": 1 - }, - "shortdesc": "Emboss", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/glsl_defs.tmpl b/game/addons/mat_maker_gd/nodes/material_maker_nodes/glsl_defs.tmpl deleted file mode 100644 index d4dc1851..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/glsl_defs.tmpl +++ /dev/null @@ -1,34 +0,0 @@ -float rand(vec2 x) { - return fract(cos(mod(dot(x, vec2(13.9898, 8.141)), 3.14)) * 43758.5453); -} - -vec2 rand2(vec2 x) { - return fract(cos(mod(vec2(dot(x, vec2(13.9898, 8.141)), - dot(x, vec2(3.4562, 17.398))), vec2(3.14))) * 43758.5453); -} - -vec3 rand3(vec2 x) { - return fract(cos(mod(vec3(dot(x, vec2(13.9898, 8.141)), - dot(x, vec2(3.4562, 17.398)), - dot(x, vec2(13.254, 5.867))), vec3(3.14))) * 43758.5453); -} - -float param_rnd(float minimum, float maximum, float seed) { - return minimum+(maximum-minimum)*rand(vec2(seed)); -} - -vec3 rgb2hsv(vec3 c) { - vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); - vec4 p = c.g < c.b ? vec4(c.bg, K.wz) : vec4(c.gb, K.xy); - vec4 q = c.r < p.x ? vec4(p.xyw, c.r) : vec4(c.r, p.yzx); - - float d = q.x - min(q.w, q.y); - float e = 1.0e-10; - return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); -} - -vec3 hsv2rgb(vec3 c) { - vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); - vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); - return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); -} diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/height_to_angle.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/height_to_angle.mmg deleted file mode 100644 index 35340e19..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/height_to_angle.mmg +++ /dev/null @@ -1,52 +0,0 @@ -{ - "name": "height_to_angle", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "angle": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The input heightmap", - "name": "in", - "shortdesc": "Input", - "type": "f" - } - ], - "instance": "float $(name)_fct(vec2 uv, float epsilon) {\n\tvec3 e = vec3(epsilon, -epsilon, 0);\n\tvec2 rv = vec2(1.0, -1.0)*$in(uv+e.xy);\n\trv += vec2(-1.0, 1.0)*$in(uv-e.xy);\n\trv += vec2(1.0, 1.0)*$in(uv+e.xx);\n\trv += vec2(-1.0, -1.0)*$in(uv-e.xx);\n\trv += vec2(2.0, 0.0)*$in(uv+e.xz);\n\trv += vec2(-2.0, 0.0)*$in(uv-e.xz);\n\trv += vec2(0.0, 2.0)*$in(uv+e.zx);\n\trv += vec2(0.0, -2.0)*$in(uv-e.zx);\n\treturn atan(rv.y, rv.x)/3.141592;\n}", - "longdesc": "Generates an angle map to be used by Advances Tiler nodes from a heightmap", - "name": "Height To Angle", - "outputs": [ - { - "f": "$(name)_fct($uv, 0.0001)+$angle/180.0", - "longdesc": "The generated angle map. Values are between -1 and 1 and the corresponding Advanced Tiler parameter (Rotate) must be set to 180.", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The offset angle applied to the generated map", - "max": 180, - "min": -180, - "name": "angle", - "shortdesc": "Angle", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Height to angle" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/hlsl_defs.tmpl b/game/addons/mat_maker_gd/nodes/material_maker_nodes/hlsl_defs.tmpl deleted file mode 100644 index a3722db8..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/hlsl_defs.tmpl +++ /dev/null @@ -1,41 +0,0 @@ -#define hlsl_atan(x,y) atan2(x, y) -#define mod(x,y) ((x)-(y)*floor((x)/(y))) -inline float4 textureLod(sampler2D tex, float2 uv, float lod) { - return tex2D(tex, uv); -} -inline float2 tofloat2(float x) { - return float2(x, x); -} -inline float2 tofloat2(float x, float y) { - return float2(x, y); -} -inline float3 tofloat3(float x) { - return float3(x, x, x); -} -inline float3 tofloat3(float x, float y, float z) { - return float3(x, y, z); -} -inline float3 tofloat3(float2 xy, float z) { - return float3(xy.x, xy.y, z); -} -inline float3 tofloat3(float x, float2 yz) { - return float3(x, yz.x, yz.y); -} -inline float4 tofloat4(float x, float y, float z, float w) { - return float4(x, y, z, w); -} -inline float4 tofloat4(float x) { - return float4(x, x, x, x); -} -inline float4 tofloat4(float x, float3 yzw) { - return float4(x, yzw.x, yzw.y, yzw.z); -} -inline float4 tofloat4(float2 xy, float2 zw) { - return float4(xy.x, xy.y, zw.x, zw.y); -} -inline float4 tofloat4(float3 xyz, float w) { - return float4(xyz.x, xyz.y, xyz.z, w); -} -inline float2x2 tofloat2x2(float2 v1, float2 v2) { - return float2x2(v1.x, v1.y, v2.x, v2.y); -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/invert.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/invert.mmg deleted file mode 100644 index ffaa8e86..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/invert.mmg +++ /dev/null @@ -1,40 +0,0 @@ -{ - "name": "invert", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0, 1.0, 1.0, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "A filter that inverts the R, G, and B channels of its input while keeping the A channel unchanged", - "name": "Invert", - "outputs": [ - { - "longdesc": "Shows the inverted image", - "rgba": "vec4(vec3(1.0)-$in($uv).rgb, $in($uv).a)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - - ], - "shortdesc": "Invert filter" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/io_types.mmt b/game/addons/mat_maker_gd/nodes/material_maker_nodes/io_types.mmt deleted file mode 100644 index 22930189..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/io_types.mmt +++ /dev/null @@ -1,112 +0,0 @@ -[ - { - "name":"f", - "label":"Greyscale", - "type":"float", - "paramdefs":"vec2 uv", - "params":"uv", - "slot_type":0, - "convert":[ - { "type":"rgb", "expr":"vec3($(value))" }, - { "type":"rgba", "expr":"vec4(vec3($(value)), 1.0)" } - ], - "color":{ "r":0.5, "g":0.5, "b":0.5, "a":1.0 } - }, - { - "name":"rgb", - "label":"Color", - "type":"vec3", - "paramdefs":"vec2 uv", - "params":"uv", - "slot_type":0, - "convert":[ - { "type":"f", "expr":"(dot($(value), vec3(1.0))/3.0)" }, - { "type":"rgba", "expr":"vec4($(value), 1.0)" } - ], - "color":{ "r":0.5, "g":0.5, "b":1.0, "a":1.0 } - }, - { - "name":"rgba", - "label":"RGBA", - "type":"vec4", - "paramdefs":"vec2 uv", - "params":"uv", - "slot_type":0, - "convert":[ - { "type":"f", "expr":"(dot(($(value)).rgb, vec3(1.0))/3.0)" }, - { "type":"rgb", "expr":"(($(value)).rgb)" } - ], - "color":{ "r":0.0, "g":0.5, "b":0.0, "a":0.5 } - }, - { - "name":"sdf2d", - "label":"SDF2D", - "type":"float", - "paramdefs":"vec2 uv", - "params":"uv", - "slot_type":1, - "color":{ "r":1.0, "g":0.5, "b":0.0, "a":1.0 } - }, - { - "name":"sdf3d", - "label":"SDF3D", - "type":"float", - "paramdefs":"vec3 p", - "params":"p", - "slot_type":2, - "convert":[ - { "type":"sdf3dc", "expr":"vec2($(value), 0.0)" } - ], - "color":{ "r":0.5, "g":0.0, "b":0.0, "a":1.0 } - }, - { - "name":"sdf3dc", - "label":"SDF3D-C", - "type":"vec2", - "paramdefs":"vec3 p", - "params":"p", - "slot_type":2, - "convert":[ - { "type":"sdf3d", "expr":"($(value)).x" } - ], - "color":{ "r":1.0, "g":0.0, "b":0.0, "a":1.0 } - }, - { - "name":"tex3d_gs", - "label":"Greyscale TEX3D", - "type":"float", - "paramdefs":"vec4 p", - "params":"p", - "slot_type":3, - "convert":[ - { "type":"tex3d", "expr":"vec3($(value))" } - ], - "color":{ "r":0.8, "g":0.0, "b":1.0, "a":1.0 } - }, - { - "name":"tex3d", - "label":"TEX3D", - "type":"vec3", - "paramdefs":"vec4 p", - "params":"p", - "slot_type":3, - "convert":[ - { "type":"tex3d_gs", "expr":"(dot($(value), vec3(1.0))/3.0)" } - ], - "color":{ "r":1.0, "g":0.0, "b":1.0, "a":1.0 } - }, - { - "name":"v4v4", - "label":"V4->V4", - "type":"vec4", - "paramdefs":"vec4 p", - "params":"p", - "slot_type":4, - "color":{ "r":0.6, "g":0.4, "b":0.1, "a":1.0 } - }, - { - "name":"any", - "slot_type":42, - "color":{ "r":1.0, "g":1.0, "b":1.0, "a":1.0 } - } -] diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/magnify.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/magnify.mmg deleted file mode 100644 index e0b90dbf..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/magnify.mmg +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "magnify", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "cx": 0, - "cy": 0, - "scale": 1.98 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image to be transformed", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "max(1.0-2.0*length($uv-vec2(0.5)), 0.0)", - "label": "", - "longdesc": "The magnifying glass shape", - "name": "s", - "shortdesc": "Shape", - "type": "f" - } - ], - "instance": "", - "longdesc": "Magnifying glass effect", - "name": "Magnify", - "outputs": [ - { - "longdesc": "Shows the transformed image", - "rgba": "$i(vec2($cx+0.5, $cy+0.5)+($uv-vec2($cx+0.5, $cy+0.5))/mix(1.0, $scale, $s($uv-vec2($cx, $cy))))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "Center X:", - "longdesc": "X coordinate of the magnifying glass center", - "max": 0.5, - "min": -0.5, - "name": "cx", - "shortdesc": "center.x", - "step": 0.01, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Center Y:", - "longdesc": "Y coordinate of the magnifying glass center", - "max": 0.5, - "min": -0.5, - "name": "cy", - "shortdesc": "center.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Scale:", - "longdesc": "The maximum scaling factor for the magnifying glass", - "max": 10, - "min": 0, - "name": "scale", - "shortdesc": "Scale", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Magnify" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/make_tileable.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/make_tileable.mmg deleted file mode 100644 index ec5b9a86..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/make_tileable.mmg +++ /dev/null @@ -1,51 +0,0 @@ -{ - "name": "make_tileable", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "w": 0.1 - }, - "shader_model": { - "code": "", - "longdesc": "Creates a tileable version of its input image by moving different parts around to hide seams.", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "function": true, - "label": "", - "longdesc": "The image to be made tileable", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "vec4 make_tileable_$(name)(vec2 uv, float w) {\n\tvec4 a = $in(uv);\n\tvec4 b = $in(fract(uv+vec2(0.5)));\n\tfloat coef_ab = sin(1.57079632679*clamp((length(uv-vec2(0.5))-0.5+w)/w, 0.0, 1.0));\n\tvec4 c = $in(fract(uv+vec2(0.25)));\n\tfloat coef_abc = sin(1.57079632679*clamp((min(min(length(uv-vec2(0.0, 0.5)), length(uv-vec2(0.5, 0.0))), min(length(uv-vec2(1.0, 0.5)), length(uv-vec2(0.5, 1.0))))-w)/w, 0.0, 1.0));\n\treturn mix(c, mix(a, b, coef_ab), coef_abc);\n}\n", - "name": "Make Tileable", - "outputs": [ - { - "longdesc": "A tileable version of the input image", - "rgba": "make_tileable_$(name)($uv, 0.5*$w)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.1, - "label": "", - "longdesc": "Width of the transition areas between parts of the input image", - "max": 0.25, - "min": 0, - "name": "w", - "shortdesc": "Width", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/math.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/math.mmg deleted file mode 100644 index 8e22e1f8..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/math.mmg +++ /dev/null @@ -1,172 +0,0 @@ -{ - "name": "math", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "clamp": false, - "default_in1": 0, - "default_in2": 0, - "op": 0 - }, - "shader_model": { - "code": "float $(name_uv)_clamp_false = $op;\nfloat $(name_uv)_clamp_true = clamp($(name_uv)_clamp_false, 0.0, 1.0);\n", - "global": "", - "inputs": [ - { - "default": "$default_in1", - "label": "2:A", - "longdesc": "The A operand", - "name": "in1", - "shortdesc": "A", - "type": "f" - }, - { - "default": "$default_in2", - "label": "B", - "longdesc": "The B operand", - "name": "in2", - "shortdesc": "B", - "type": "f" - } - ], - "instance": "", - "longdesc": "Performs a math operation using its inputs or parameter values", - "name": "Math", - "outputs": [ - { - "f": "$(name_uv)_clamp_$clamp", - "longdesc": "Shows a greyscale image of the result", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 19, - "label": "", - "longdesc": "The operation to be performed", - "name": "op", - "shortdesc": "Operation", - "type": "enum", - "values": [ - { - "name": "A+B", - "value": "$in1($uv)+$in2($uv)" - }, - { - "name": "A-B", - "value": "$in1($uv)-$in2($uv)" - }, - { - "name": "A*B", - "value": "$in1($uv)*$in2($uv)" - }, - { - "name": "A/B", - "value": "$in1($uv)/$in2($uv)" - }, - { - "name": "log(A)", - "value": "log($in1($uv))" - }, - { - "name": "log2(A)", - "value": "log2($in1($uv))" - }, - { - "name": "pow(A, B)", - "value": "pow($in1($uv),$in2($uv))" - }, - { - "name": "abs(A)", - "value": "abs($in1($uv))" - }, - { - "name": "round(A)", - "value": "round($in1($uv))" - }, - { - "name": "floor(A)", - "value": "floor($in1($uv))" - }, - { - "name": "ceil(A)", - "value": "ceil($in1($uv))" - }, - { - "name": "trunc(A)", - "value": "trunc($in1($uv))" - }, - { - "name": "fract(A)", - "value": "fract($in1($uv))" - }, - { - "name": "min(A, B)", - "value": "min($in1($uv),$in2($uv))" - }, - { - "name": "max(A, B)", - "value": "max($in1($uv),$in2($uv))" - }, - { - "name": "A 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Curvature", - "outputs": [ - { - "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "598_2", - "node_position": { - "x": -100.207932, - "y": 638.757874 - }, - "parameters": { - "amount": 1, - "size": 11, - "width": 2 - }, - "shader_model": { - "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Curvature", - "outputs": [ - { - "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "598_4", - "node_position": { - "x": -97.532082, - "y": 755.803345 - }, - "parameters": { - "amount": 1, - "size": 11, - "width": 4 - }, - "shader_model": { - "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Curvature", - "outputs": [ - { - "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "598_5", - "node_position": { - "x": -95.713867, - "y": 877.621521 - }, - "parameters": { - "amount": 1, - "size": 11, - "width": 8 - }, - "shader_model": { - "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Curvature", - "outputs": [ - { - "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "598_6", - "node_position": { - "x": -92.077492, - "y": 992.848633 - }, - "parameters": { - "amount": 1, - "size": 11, - "width": 16 - }, - "shader_model": { - "code": "vec2 $(name_uv)_emboss = $(name)_fct($uv);", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec2 $(name)_fct(vec2 uv) {\n\tfloat pixels = max(1.0, $width);\n\tfloat e = 1.0/$size;\n\tvec2 rv = vec2(0.0);\n\tfor (float dx = -pixels; dx <= pixels; dx += 1.0) {\n\t\tfor (float dy = -pixels; dy <= pixels; dy += 1.0) {\n\t\t\tif (abs(dx) > 0.5 || abs(dy) > 0.5) {\n\t\t\t\trv += $in(uv+e*vec2(dx, dy)).xy*cos(vec2(atan(dy, dx))-vec2(0.0, 0.5)*3.14159265359)/length(vec2(dx, dy));\n\t\t\t}\n\t\t}\n\t}\n\treturn $amount*rv/pixels+0.5;\n}", - "name": "Curvature", - "outputs": [ - { - "f": "0.5*($(name_uv)_emboss.x+$(name_uv)_emboss.y)", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "Size", - "last": 12, - "name": "size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Amount", - "max": 10, - "min": 0, - "name": "amount", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "connections": [ - { - "from": "buffer_2", - "from_port": 0, - "to": "fast_blur_shader", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "fast_blur_shader", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Fast Blur", - "longdesc": "", - "name": "fast_blur", - "node_position": { - "x": 167.483093, - "y": 509.757843 - }, - "nodes": [ - { - "name": "fast_blur_shader", - "node_position": { - "x": -168, - "y": 120 - }, - "parameters": { - "quality": 1, - "sigma": 2 - }, - "type": "fast_blur_shader" - }, - { - "name": "buffer_2", - "node_position": { - "x": -187, - "y": 61.5 - }, - "parameters": { - "size": 11 - }, - "type": "buffer", - "version": 1 - }, - { - "name": "gen_inputs", - "node_position": { - "x": -602, - "y": 91.75 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "name": "port0", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 88, - "y": 61.75 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -254.5, - "y": -122.5 - }, - "parameters": { - "param0": 11, - "param1": 2, - "param2": 1 - }, - "type": "remote", - "widgets": [ - { - "label": "Resolution", - "linked_widgets": [ - { - "node": "buffer_2", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "Sigma", - "linked_widgets": [ - { - "node": "fast_blur_shader", - "widget": "sigma" - } - ], - "name": "param1", - "type": "linked_control" - }, - { - "label": "Quality", - "linked_widgets": [ - { - "node": "fast_blur_shader", - "widget": "quality" - } - ], - "name": "param2", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "param0": 11, - "param1": 2, - "param2": 1 - }, - "shortdesc": "", - "type": "graph" - }, - { - "name": "fast_blur_2", - "node_position": { - "x": 167.156082, - "y": 638.560974 - }, - "parameters": { - "param0": 11, - "param1": 5, - "param2": 1 - }, - "type": "fast_blur" - }, - { - "name": "fast_blur_3", - "node_position": { - "x": 171.701691, - "y": 756.742798 - }, - "parameters": { - "param0": 11, - "param1": 8, - "param2": 1 - }, - "type": "fast_blur" - }, - { - "name": "fast_blur_4", - "node_position": { - "x": 167.377045, - "y": 877.651917 - }, - "parameters": { - "param0": 11, - "param1": 16, - "param2": 1 - }, - "type": "fast_blur" - }, - { - "name": "fast_blur_5", - "node_position": { - "x": 170.104279, - "y": 992.197327 - }, - "parameters": { - "param0": 11, - "param1": 34, - "param2": 1 - }, - "type": "fast_blur" - }, - { - "name": "buffer_2", - "node_position": { - "x": -426.44928, - "y": 678.75 - }, - "parameters": { - "filter": false, - "mipmap": false, - "size": 11 - }, - "type": "buffer", - "version": 2 - } - ], - "parameters": { - "param0": 11, - "param2": 1 - }, - "shortdesc": "Smooth Curvature", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/smooth_curvature2.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/smooth_curvature2.mmg deleted file mode 100644 index 71314606..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/smooth_curvature2.mmg +++ /dev/null @@ -1,475 +0,0 @@ -{ - "connections": [ - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "switch", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "switch", - "to_port": 0 - }, - { - "from": "598", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "switch_2", - "to_port": 1 - }, - { - "from": "598", - "from_port": 0, - "to": "switch_2", - "to_port": 0 - }, - { - "from": "switch_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "switch", - "from_port": 0, - "to": "598", - "to_port": 0 - } - ], - "label": "Smooth Curvature 2", - "longdesc": "", - "name": "smooth_curvature2", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": 300.603302, - "y": -549.522034 - }, - "parameters": { - "lod": 0, - "size": 10 - }, - "type": "buffer" - }, - { - "name": "598", - "node_position": { - "x": 286.999847, - "y": -359.903259 - }, - "parameters": { - "quality": 4, - "radius": 1, - "strength": 1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.5", - "function": true, - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "float $(name)_curve( vec2 p, vec2 o ){\n\tfloat a = $in(p+o);\n\tfloat b = $in(p-o);\n\tfloat c = $in(p+o*vec2(1.0,-1.0));\n\tfloat d = $in(p-o*vec2(1.0,-1.0));\n\treturn -a - b - c - d;\n}\n\nfloat $(name)_curvature_map(vec2 p, float r, float q){\n\tfloat s = r/q;\n\tfloat H = $in(p)*4.0;\n\tfloat v = 0.0;\n\tvec2 o;\n\tfor( o.x = 0.0; o.x < q; o.x++ ){\n\t\tfor( o.y = 0.0; o.y < q; o.y++ ){\n\t\t\tfloat c = $(name)_curve(p, o*s);\n\t\t\tv += (H + c) * ((r-length(o*s)) / r);\n\t\t}\n\t}\n\treturn v/(q*q);\n}\n\nfloat $(name)_curvature(vec2 uv, float quality, float strength, float radius) {\n\tfloat c = $(name)_curvature_map(uv, 0.050 * radius, quality)*strength / radius;\n\treturn 0.5 + c;\n}", - "name": "Smooth Curvature", - "outputs": [ - { - "f": "$(name)_curvature($uv, $quality, $strength, $radius)", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 4, - "label": "Quality", - "longdesc": "How many times the input is sampled to generate the curvature map", - "max": 16, - "min": 2, - "name": "quality", - "shortdesc": "Quality", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Strength", - "longdesc": "The intensity of the curvature map", - "max": 2, - "min": 0, - "name": "strength", - "shortdesc": "Strength", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Radius", - "longdesc": "The radius of the smoothing of the curvature effect", - "max": 2, - "min": 0, - "name": "radius", - "shortdesc": "Radius", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Smooth Curvature" - }, - "type": "shader" - }, - { - "name": "gen_parameters", - "node_position": { - "x": 242.146149, - "y": -788.088806 - }, - "parameters": { - "param0": 10, - "param1": 4, - "param2": 1, - "param3": 1, - "param4": 1 - }, - "type": "remote", - "widgets": [ - { - "label": "Size", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "buffer_2", - "widget": "size" - } - ], - "longdesc": "The resolution of the curvature map if buffer is used", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - }, - { - "label": "Quality", - "linked_widgets": [ - { - "node": "598", - "widget": "quality" - } - ], - "longdesc": "How many times the input is sampled to generate the curvature map", - "name": "param1", - "shortdesc": "Quality", - "type": "linked_control" - }, - { - "label": "Strength", - "linked_widgets": [ - { - "node": "598", - "widget": "strength" - } - ], - "longdesc": "The intensity of the curvature map", - "name": "param2", - "shortdesc": "Strength", - "type": "linked_control" - }, - { - "label": "Radius", - "linked_widgets": [ - { - "node": "598", - "widget": "radius" - } - ], - "longdesc": "The radius of the smoothing of the curvature effect", - "name": "param3", - "shortdesc": "Radius", - "type": "linked_control" - }, - { - "configurations": { - "False": [ - { - "node": "switch", - "value": 0, - "widget": "source" - }, - { - "node": "switch_2", - "value": 0, - "widget": "source" - } - ], - "True": [ - { - "node": "switch", - "value": 1, - "widget": "source" - }, - { - "node": "switch_2", - "value": 1, - "widget": "source" - } - ] - }, - "label": "Buffer", - "linked_widgets": [ - { - "node": "switch", - "widget": "source" - }, - { - "node": "switch_2", - "widget": "source" - } - ], - "longdesc": "When set, a buffer is used to sample the input before the normal map filter", - "name": "param4", - "shortdesc": "Buffer", - "type": "config_control" - } - ] - }, - { - "name": "gen_inputs", - "node_position": { - "x": -135.453888, - "y": -518.927429 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The input height map", - "name": "Heightmap", - "shortdesc": "Input", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 586.203247, - "y": -534.919678 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "Shows the generated curvature map", - "name": "Curvature", - "shortdesc": "Output", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "switch", - "node_position": { - "x": 310.739746, - "y": -451.658417 - }, - "parameters": { - "choices": 2, - "outputs": 1, - "source": 1 - }, - "type": "switch" - }, - { - "name": "buffer_2", - "node_position": { - "x": 293.839874, - "y": -225.201691 - }, - "parameters": { - "lod": 0, - "size": 10 - }, - "type": "buffer" - }, - { - "name": "switch_2", - "node_position": { - "x": 312.239838, - "y": -129.465912 - }, - "parameters": { - "choices": 2, - "outputs": 1, - "source": 1 - }, - "type": "switch" - }, - { - "name": "blend", - "node_position": { - "x": 802.064697, - "y": -277.727295 - }, - "parameters": { - "amount": 0.5, - "blend_type": 0 - }, - "shader_model": { - "code": "vec4 $(name_uv)_s1 = $s1($uv);\nvec4 $(name_uv)_s2 = $s2($uv);\nfloat $(name_uv)_a = $amount*$a($uv);\n", - "global": "vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1 + (1.0-opacity)*c2;\n}\n\nvec3 blend_dissolve(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\tif (rand(uv) < opacity) {\n\t\treturn c1;\n\t} else {\n\t\treturn c2;\n\t}\n}\n\nvec3 blend_multiply(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1*c2 + (1.0-opacity)*c2;\n}\n\nvec3 blend_screen(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n}\n\nfloat blend_overlay_f(float c1, float c2) {\n\treturn (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n}\n\nvec3 blend_overlay(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_overlay_f(c1.x, c2.x), blend_overlay_f(c1.y, c2.y), blend_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_hard_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*0.5*(c1*c2+blend_overlay(uv, c1, c2, 1.0)) + (1.0-opacity)*c2;\n}\n\nfloat blend_soft_light_f(float c1, float c2) {\n\treturn (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n}\n\nvec3 blend_soft_light(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_soft_light_f(c1.x, c2.x), blend_soft_light_f(c1.y, c2.y), blend_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_burn_f(float c1, float c2) {\n\treturn (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n}\n\nvec3 blend_burn(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_burn_f(c1.x, c2.x), blend_burn_f(c1.y, c2.y), blend_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend_dodge_f(float c1, float c2) {\n\treturn (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n}\n\nvec3 blend_dodge(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend_dodge_f(c1.x, c2.x), blend_dodge_f(c1.y, c2.y), blend_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend_lighten(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*max(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*min(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n}\n", - "inputs": [ - { - "default": "vec4(round($uv.x) , 1.0, 1.0, 1.0)", - "label": "Source1", - "longdesc": "The foreground input", - "name": "s1", - "shortdesc": "Foreground", - "type": "rgba" - }, - { - "default": "vec4(1.0, $uv.y, 1.0, 1.0)", - "label": "Source2", - "longdesc": "The background input", - "name": "s2", - "shortdesc": "Background", - "type": "rgba" - }, - { - "default": "1.0", - "label": "Opacity", - "longdesc": "The optional opacity mask", - "name": "a", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "", - "longdesc": "Blends its input, using an optional mask", - "name": "Blend", - "outputs": [ - { - "longdesc": "Shows the result of the blend operation", - "rgba": "vec4(blend_$blend_type($uv, $(name_uv)_s1.rgb, $(name_uv)_s2.rgb, $(name_uv)_a*$(name_uv)_s1.a), min(1.0, $(name_uv)_s2.a+$(name_uv)_a*$(name_uv)_s1.a))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "longdesc": "The algorithm used to blend the inputs", - "name": "blend_type", - "shortdesc": "Blend mode", - "type": "enum", - "values": [ - { - "name": "Normal", - "value": "normal" - }, - { - "name": "Dissolve", - "value": "dissolve" - }, - { - "name": "Multiply", - "value": "multiply" - }, - { - "name": "Screen", - "value": "screen" - }, - { - "name": "Overlay", - "value": "overlay" - }, - { - "name": "Hard Light", - "value": "hard_light" - }, - { - "name": "Soft Light", - "value": "soft_light" - }, - { - "name": "Burn", - "value": "burn" - }, - { - "name": "Dodge", - "value": "dodge" - }, - { - "name": "Lighten", - "value": "lighten" - }, - { - "name": "Darken", - "value": "darken" - }, - { - "name": "Difference", - "value": "difference" - } - ] - }, - { - "control": "None", - "default": 0.5, - "label": "3:", - "longdesc": "The opacity of the blend operation", - "max": 1, - "min": 0, - "name": "amount", - "shortdesc": "Opacity", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Blend" - }, - "type": "shader" - } - ], - "parameters": { - "param0": 10, - "param1": 4, - "param2": 1, - "param3": 1, - "param4": 1 - }, - "shortdesc": "Smooth Curvature", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/supersample.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/supersample.mmg deleted file mode 100644 index 9c16bbc4..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/supersample.mmg +++ /dev/null @@ -1,76 +0,0 @@ -{ - "name": "supersample", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 2, - "size": 9, - "width": 1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0, 1.0, 1.0, 1.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "vec4 supersample_$(name)(vec2 uv, float size, int count, float width) {\n\tvec4 rv = vec4(0.0);\n\tvec2 step_size = vec2(width)/size/float(count);\n\tuv -= vec2(0.5)/size;\n\tfor (int x = 0; x < count; ++x) {\n\t\tfor (int y = 0; y < count; ++y) {\n\t\t\trv += $in(uv+(vec2(float(x), float(y))+vec2(0.5))*step_size);\n\t\t}\n\t}\n\treturn rv/float(count*count);\n}", - "longdesc": "A filter that samples sub-pixel details to make them visible", - "name": "Supersample", - "outputs": [ - { - "longdesc": "Shows the supersampled image. Due to the performance cost of this node, it is recommended to connect a buffer directly to this output.", - "rgba": "supersample_$(name)($uv, $size, int($count), $width)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 10, - "first": 4, - "label": "Size", - "last": 12, - "longdesc": "The resolution of the output", - "name": "size", - "shortdesc": "Size", - "type": "size" - }, - { - "control": "None", - "default": 2, - "label": "Count", - "longdesc": "The number of samples on each axis. High values will badly impact performances.", - "max": 5, - "min": 2, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "longdesc": "The width of the sampled area. Setting this value higher than 1 will sample neighbouring pixels and antialias the result.", - "max": 2, - "min": 1, - "name": "width", - "shortdesc": "Width", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Supersample" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/swap_channels.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/swap_channels.mmg deleted file mode 100644 index 0f750f6a..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/swap_channels.mmg +++ /dev/null @@ -1,242 +0,0 @@ -{ - "name": "swap_channels", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "out_a": 8, - "out_b": 6, - "out_g": 4, - "out_r": 2 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "label": "", - "longdesc": "The input RGBA image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Swaps the channels of its RGBA input", - "name": "Swap channels", - "outputs": [ - { - "longdesc": "The output RGBA image", - "rgba": "vec4($out_r,$out_g,$out_b,$out_a)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 2, - "label": "R", - "longdesc": "The input channel to be assigned to the Red channel", - "name": "out_r", - "shortdesc": "Red", - "type": "enum", - "values": [ - { - "name": "0", - "value": "0.0" - }, - { - "name": "1", - "value": "1.0" - }, - { - "name": "R", - "value": "$in($uv).r" - }, - { - "name": "-R", - "value": "1.0-$in($uv).r" - }, - { - "name": "G", - "value": "$in($uv).g" - }, - { - "name": "-G", - "value": "1.0-$in($uv).g" - }, - { - "name": "B", - "value": "$in($uv).b" - }, - { - "name": "-B", - "value": "1.0-$in($uv).b" - }, - { - "name": "A", - "value": "$in($uv).a" - }, - { - "name": "-A", - "value": "1.0-$in($uv).a" - } - ] - }, - { - "default": 4, - "label": "G", - "longdesc": "The input channel to be assigned to the Green channel", - "name": "out_g", - "shortdesc": "Green", - "type": "enum", - "values": [ - { - "name": "0", - "value": "0.0" - }, - { - "name": "1", - "value": "1.0" - }, - { - "name": "R", - "value": "$in($uv).r" - }, - { - "name": "-R", - "value": "1.0-$in($uv).r" - }, - { - "name": "G", - "value": "$in($uv).g" - }, - { - "name": "-G", - "value": "1.0-$in($uv).g" - }, - { - "name": "B", - "value": "$in($uv).b" - }, - { - "name": "-B", - "value": "1.0-$in($uv).b" - }, - { - "name": "A", - "value": "$in($uv).a" - }, - { - "name": "-A", - "value": "1.0-$in($uv).a" - } - ] - }, - { - "default": 6, - "label": "B", - "longdesc": "The input channel to be assigned to the Blue channel", - "name": "out_b", - "shortdesc": "Blue", - "type": "enum", - "values": [ - { - "name": "0", - "value": "0.0" - }, - { - "name": "1", - "value": "1.0" - }, - { - "name": "R", - "value": "$in($uv).r" - }, - { - "name": "-R", - "value": "1.0-$in($uv).r" - }, - { - "name": "G", - "value": "$in($uv).g" - }, - { - "name": "-G", - "value": "1.0-$in($uv).g" - }, - { - "name": "B", - "value": "$in($uv).b" - }, - { - "name": "-B", - "value": "1.0-$in($uv).b" - }, - { - "name": "A", - "value": "$in($uv).a" - }, - { - "name": "-A", - "value": "1.0-$in($uv).a" - } - ] - }, - { - "default": 8, - "label": "A", - "longdesc": "The input channel to be assigned to the Alpha channel", - "name": "out_a", - "shortdesc": "Alpha", - "type": "enum", - "values": [ - { - "name": "0", - "value": "0.0" - }, - { - "name": "1", - "value": "1.0" - }, - { - "name": "R", - "value": "$in($uv).r" - }, - { - "name": "-R", - "value": "1.0-$in($uv).r" - }, - { - "name": "G", - "value": "$in($uv).g" - }, - { - "name": "-G", - "value": "1.0-$in($uv).g" - }, - { - "name": "B", - "value": "$in($uv).b" - }, - { - "name": "-B", - "value": "1.0-$in($uv).b" - }, - { - "name": "A", - "value": "$in($uv).a" - }, - { - "name": "-A", - "value": "1.0-$in($uv).a" - } - ] - } - ], - "shortdesc": "Swap channels" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tonality.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/tonality.mmg deleted file mode 100644 index f605f491..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tonality.mmg +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "tonality", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "curve": { - "points": [ - { - "ls": 0, - "rs": 1, - "x": 0, - "y": 0 - }, - { - "ls": 1, - "rs": 0, - "x": 1, - "y": 1 - } - ], - "type": "Curve" - } - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "$uv.x", - "label": "", - "longdesc": "The input greyscale image", - "name": "input", - "shortdesc": "Input", - "type": "f" - } - ], - "instance": "", - "longdesc": "Remaps a greyscale image tonality using a curve", - "name": "Tonality", - "outputs": [ - { - "f": "$curve($input($uv))", - "longdesc": "The remapped greyscale image", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": { - "points": [ - { - "ls": 0, - "rs": 1, - "x": 0, - "y": 0 - }, - { - "ls": 1, - "rs": 0, - "x": 1, - "y": 1 - } - ], - "type": "Curve" - }, - "label": "", - "longdesc": "The tonality curve to which the input is remapped", - "name": "curve", - "shortdesc": "Curve", - "type": "curve" - } - ], - "shortdesc": "Tonality" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones.mmg deleted file mode 100644 index be161f0c..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones.mmg +++ /dev/null @@ -1,122 +0,0 @@ -{ - "name": "levels", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "in_max": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "in_mid": { - "a": 0.5, - "b": 0.5, - "g": 0.5, - "r": 0.5, - "type": "Color" - }, - "in_min": { - "a": 0, - "b": 0, - "g": 0, - "r": 0, - "type": "Color" - }, - "out_max": { - "a": 1, - "b": 1, - "g": 1, - "r": 1, - "type": "Color" - }, - "out_min": { - "a": 0, - "b": 0, - "g": 0, - "r": 0, - "type": "Color" - } - }, - "shader_model": { - "code": "", - "global": "vec4 adjust_levels(vec4 input, vec4 in_min, vec4 in_mid, vec4 in_max, vec4 out_min, vec4 out_max) {\n\tinput = clamp((input-in_min)/(in_max-in_min), 0.0, 1.0);\n\tin_mid = (in_mid-in_min)/(in_max-in_min);\n\tvec4 dark = step(in_mid, input);\n\tinput = 0.5*mix(input/(in_mid), 1.0+(input-in_mid)/(1.0-in_mid), dark);\n\treturn out_min+input*(out_max-out_min);\n}\n", - "inputs": [ - { - "default": "vec4(1.0)", - "label": "", - "name": "input", - "type": "rgba" - } - ], - "instance": "", - "name": "Levels", - "outputs": [ - { - "rgba": "adjust_levels($input($uv), $in_min, $in_mid, $in_max, $out_min, $out_max)", - "type": "rgba" - } - ], - "parameters": [ - { - "default": { - "a": 0, - "b": 0, - "g": 0, - "r": 0 - }, - "label": "", - "name": "in_min", - "type": "color" - }, - { - "default": { - "a": 0.498039, - "b": 0.498039, - "g": 0.498039, - "r": 0.498039 - }, - "label": "", - "name": "in_mid", - "type": "color" - }, - { - "default": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "label": "", - "name": "in_max", - "type": "color" - }, - { - "default": { - "a": 1, - "b": 0, - "g": 0, - "r": 0 - }, - "label": "", - "name": "out_min", - "type": "color" - }, - { - "default": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "label": "", - "name": "out_max", - "type": "color" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_map.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_map.mmg deleted file mode 100644 index 952fc85d..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_map.mmg +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "tones_map", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "in_max": 1, - "in_min": 0, - "out_max": 1, - "out_min": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(0.5 ,0.5, 0.5, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Maps linearly an input tones interval to an output tones interval.", - "name": "Tones map", - "outputs": [ - { - "longdesc": "Shows the generated remapped image", - "rgba": "vec4(vec3($out_min)+($in($uv).rgb-vec3($in_min))*vec3(($out_max-$out_min)/($in_max-$in_min)), $in($uv).a)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.5, - "label": "Input min", - "longdesc": "The minimum value of the input interval", - "max": 1, - "min": 0, - "name": "in_min", - "shortdesc": "InputMin", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Input max", - "longdesc": "The maximum value of the input interval", - "max": 1, - "min": 0, - "name": "in_max", - "shortdesc": "InputMax", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Output min", - "longdesc": "The minimum value of the output interval", - "max": 1, - "min": 0, - "name": "out_min", - "shortdesc": "OutputMin", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Output max", - "longdesc": "The maximum value of the output interval", - "max": 1, - "min": 0, - "name": "out_max", - "shortdesc": "OutputMax", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Tones map" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_range.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_range.mmg deleted file mode 100644 index eba25413..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_range.mmg +++ /dev/null @@ -1,86 +0,0 @@ -{ - "name": "tones_range", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "contrast": 0.5, - "invert": false, - "value": 0.5, - "width": 0.25 - }, - "shader_model": { - "code": "float $(name_uv)_step = clamp(($in($uv) - ($value))/max(0.0001, $width)+0.5, 0.0, 1.0);\nfloat $(name_uv)_false = clamp((min($(name_uv)_step, 1.0-$(name_uv)_step) * 2.0) / (1.0 - $contrast), 0.0, 1.0);\nfloat $(name_uv)_true = 1.0-$(name_uv)_false;", - "global": "", - "inputs": [ - { - "default": "($uv.x + $uv.y) / 2.0", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "f" - } - ], - "instance": "", - "longdesc": "Outputs the tone range around a specified value,", - "name": "Tones Range", - "outputs": [ - { - "f": "$(name_uv)_$invert", - "longdesc": "Shows the generated high contrast image", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.5, - "label": "Value", - "longdesc": "The center value of the selection", - "max": 1, - "min": 0, - "name": "value", - "shortdesc": "Value", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.25, - "label": "Width", - "longdesc": "The width (in tones space) of the selection area", - "max": 1, - "min": 0, - "name": "width", - "shortdesc": "Width", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Contrast", - "longdesc": "Adjusts the falloff of the output", - "max": 1, - "min": 0, - "name": "contrast", - "shortdesc": "Contrast", - "step": 0.01, - "type": "float" - }, - { - "default": false, - "label": "Invert", - "longdesc": "Invert the generated image if set", - "name": "invert", - "shortdesc": "Invert", - "type": "boolean" - } - ], - "shortdesc": "Tones Range" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_step.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_step.mmg deleted file mode 100644 index af4c0497..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/tones_step.mmg +++ /dev/null @@ -1,73 +0,0 @@ -{ - "name": "tones_step", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "invert": false, - "value": 0.5, - "width": 0.1 - }, - "shader_model": { - "code": "vec3 $(name_uv)_false = clamp(($in($uv).rgb-vec3($value))/max(0.0001, $width)+vec3(0.5), vec3(0.0), vec3(1.0));\nvec3 $(name_uv)_true = vec3(1.0)-$(name_uv)_false;", - "global": "", - "inputs": [ - { - "default": "vec4(0.5 ,0.5, 0.5, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Emphasizes dark and light tones around a specified value", - "name": "Tones step", - "outputs": [ - { - "longdesc": "Shows the generated high contrast image", - "rgba": "vec4($(name_uv)_$invert, $in($uv).a)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.5, - "label": "Value", - "longdesc": "The value of the input that separate dark and light zones of the result", - "max": 1, - "min": 0, - "name": "value", - "shortdesc": "Value", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "longdesc": "The width (in tones space) of the transition area", - "max": 1, - "min": 0, - "name": "width", - "shortdesc": "width", - "step": 0.01, - "type": "float" - }, - { - "default": false, - "label": "Invert", - "longdesc": "Invert the generated image if set", - "name": "invert", - "shortdesc": "Invert", - "type": "boolean" - } - ], - "shortdesc": "Tones step" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform.mmg deleted file mode 100644 index b7730ffb..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform.mmg +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "uniform", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "color": { - "a": 1, - "b": 1, - "g": 0.415686, - "r": 0, - "type": "Color" - } - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - - ], - "instance": "", - "longdesc": "Draws a uniform image", - "name": "Uniform", - "outputs": [ - { - "longdesc": "A uniform image of the selected color", - "rgba": "$(color)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": { - "a": 1, - "b": 1, - "g": 1, - "r": 1 - }, - "label": "", - "longdesc": "Color of the uniform image", - "name": "color", - "shortdesc": "Color", - "type": "color" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform_greyscale.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform_greyscale.mmg deleted file mode 100644 index 0d006d0d..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/uniform_greyscale.mmg +++ /dev/null @@ -1,43 +0,0 @@ -{ - "name": "uniform_greyscale", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "color": 0.5 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - - ], - "instance": "", - "longdesc": "Draws a uniform greyscale image", - "name": "Greyscale Uniform", - "outputs": [ - { - "f": "$(color)", - "longdesc": "A uniform image of the selected value", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.5, - "label": "", - "longdesc": "The value of the uniform greyscale image", - "max": 1, - "min": 0, - "name": "color", - "shortdesc": "Value", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" -} \ No newline at end of file