diff --git a/game/addons/mat_maker_gd/nodes/common/blur.gd b/game/addons/mat_maker_gd/nodes/common/blur.gd new file mode 100644 index 00000000..aae44be1 --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/blur.gd @@ -0,0 +1,937 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#directional_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": "edge_detect_3_3_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "edge_detect_3_3_2", +# "to_port": 1 +# } +# ], +# "label": "Directional Blur", +# "longdesc": "Applies a directional gaussian blur to its input", +# "name": "directional_blur", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": -381.25, +# "y": -270.75 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -436.666626, +# "y": -413.666656 +# }, +# "parameters": { +# "param0": 9, +# "param1": 50, +# "param2": 45 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Grid size:", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "edge_detect_3_3_2", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input", +# "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" +# }, +# { +# "label": "Angle", +# "linked_widgets": [ +# { +# "node": "edge_detect_3_3_2", +# "widget": "angle" +# } +# ], +# "longdesc": "The angle of the directional blur effect", +# "name": "param2", +# "shortdesc": "Angle", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -779.666626, +# "y": -247.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "group_size": 0, +# "longdesc": "A map that controls the strength of the blur filter", +# "name": "amount", +# "shortdesc": "Strength 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": -376.725464, +# "y": -184.178955 +# }, +# "parameters": { +# "angle": 45, +# "sigma": 50, +# "size": 9 +# }, +# "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": "Label", +# "name": "amount", +# "type": "f" +# } +# ], +# "instance": "vec4 $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(cos($angle*0.01745329251), -sin($angle*0.01745329251))/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = $sigma*$amount(uv);\n\tfor (float i = -50.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": "Directional 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" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Angle", +# "max": 180, +# "min": -180, +# "name": "angle", +# "step": 0.1, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# } +# ], +# "parameters": { +# "param0": 9, +# "param1": 50, +# "param2": 45 +# }, +# "shortdesc": "Directional blur", +# "type": "graph" +#} + +#---------------------- +#fast_blur.mmg + +#{ +# "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": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "fast_blur_shader", +# "node_position": { +# "x": -168, +# "y": 120 +# }, +# "parameters": { +# "quality": 1, +# "sigma": 100 +# }, +# "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, +# "longdesc": "The input image", +# "name": "input", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 88, +# "y": 61.75 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The generated blurred image", +# "name": "output", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -254.5, +# "y": -122.5 +# }, +# "parameters": { +# "param0": 11, +# "param1": 100, +# "param2": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Resolution", +# "linked_widgets": [ +# { +# "node": "buffer_2", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution used to sample the input image", +# "name": "param0", +# "shortdesc": "Resolution", +# "type": "linked_control" +# }, +# { +# "label": "Sigma", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "sigma" +# } +# ], +# "longdesc": "The standard deviation of the gaussian distribution", +# "name": "param1", +# "shortdesc": "Sigma", +# "type": "linked_control" +# }, +# { +# "label": "Quality", +# "linked_widgets": [ +# { +# "node": "fast_blur_shader", +# "widget": "quality" +# } +# ], +# "longdesc": "The quality of the effect (increasing quality increases compute time)", +# "name": "param2", +# "shortdesc": "Quality", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "param0": 11, +# "param1": 100, +# "param2": 1 +# }, +# "shortdesc": "", +# "type": "graph" +#} + +#---------------------- +#fast_blur_shader.mmg + +#{ +# "name": "fast_blur_shader", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "quality": 1, +# "sigma": 100 +# }, +# "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" +#} + +#---------------------- +#gaussian_blur.mmg + +#{ +# "connections": [ +# { +# "from": "switch", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "switch", +# "from_port": 0, +# "to": "switch_2", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "switch", +# "to_port": 1 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "gaussian_blur_x", +# "to_port": 0 +# }, +# { +# "from": "gaussian_blur_x", +# "from_port": 0, +# "to": "switch", +# "to_port": 0 +# }, +# { +# "from": "gaussian_blur_y", +# "from_port": 0, +# "to": "switch_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "gaussian_blur_y", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "gaussian_blur_x", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "gaussian_blur_y", +# "to_port": 1 +# }, +# { +# "from": "buffer_3", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "switch_2", +# "from_port": 0, +# "to": "buffer_3", +# "to_port": 0 +# } +# ], +# "label": "Gaussian Blur", +# "longdesc": "Applys a gaussian blur on its input", +# "name": "gaussian_blur", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer_2", +# "node_position": { +# "x": -399.875, +# "y": -43.625 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "switch", +# "node_position": { +# "x": -496.452393, +# "y": -130.166656 +# }, +# "parameters": { +# "choices": 2, +# "outputs": 1, +# "source": 0 +# }, +# "type": "switch" +# }, +# { +# "name": "switch_2", +# "node_position": { +# "x": -240.452393, +# "y": -133.666656 +# }, +# "parameters": { +# "choices": 2, +# "outputs": 1, +# "source": 0 +# }, +# "type": "switch" +# }, +# { +# "name": "buffer", +# "node_position": { +# "x": -402.25, +# "y": -315.75 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -439.666626, +# "y": -456.666656 +# }, +# "parameters": { +# "param0": 9, +# "param1": 50, +# "param2": 0 +# }, +# "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" +# }, +# { +# "node": "buffer_3", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input image", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Sigma:", +# "linked_widgets": [ +# { +# "node": "gaussian_blur_x", +# "widget": "sigma" +# }, +# { +# "node": "gaussian_blur_y", +# "widget": "sigma" +# } +# ], +# "longdesc": "The strength of the blur filter", +# "name": "param1", +# "shortdesc": "Sigma", +# "type": "linked_control" +# }, +# { +# "configurations": { +# "Both": [ +# { +# "node": "switch", +# "value": 0, +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "value": 0, +# "widget": "source" +# } +# ], +# "X": [ +# { +# "node": "switch", +# "value": 0, +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "value": 1, +# "widget": "source" +# } +# ], +# "Y": [ +# { +# "node": "switch", +# "value": 1, +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "value": 0, +# "widget": "source" +# } +# ] +# }, +# "label": "Direction:", +# "linked_widgets": [ +# { +# "node": "switch", +# "widget": "source" +# }, +# { +# "node": "switch_2", +# "widget": "source" +# } +# ], +# "longdesc": "Apply the blur filter horizontally, vertically of in both directions", +# "name": "param2", +# "shortdesc": "Direction", +# "type": "config_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -928.666626, +# "y": -188.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input image", +# "name": "input", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "group_size": 0, +# "longdesc": "A map that controls the strength of the blur filter", +# "name": "amount", +# "shortdesc": "Strength map", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 193.547607, +# "y": -135.392853 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the generated blurred image", +# "name": "port0", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "seed_value": 77778, +# "type": "ios" +# }, +# { +# "name": "gaussian_blur_x", +# "node_position": { +# "x": -412.993408, +# "y": -221.281738 +# }, +# "parameters": { +# "sigma": 50, +# "size": 9 +# }, +# "type": "gaussian_blur_x" +# }, +# { +# "name": "gaussian_blur_y", +# "node_position": { +# "x": -405.993408, +# "y": 38.718262 +# }, +# "parameters": { +# "sigma": 50, +# "size": 9 +# }, +# "seed_value": 12279, +# "type": "gaussian_blur_y" +# }, +# { +# "name": "buffer_3", +# "node_position": { +# "x": -50.246796, +# "y": -133.96936 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# } +# ], +# "parameters": { +# "param0": 9, +# "param1": 50, +# "param2": 0 +# }, +# "shortdesc": "Gaussian blur", +# "type": "graph" +#} + +#---------------------- +#gaussian_blur_x.mmg + +#{ +# "name": "gaussian_blur_x", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "sigma": 35.700001, +# "size": 9 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "name": "amount", +# "type": "f" +# } +# ], +# "instance": "vec4 $(name)_fct(vec2 uv) {\n\tfloat e = 1.0/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = max(0.000001, $sigma*$amount(uv));\n\tfor (float i = -50.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+vec2(i*e, 0.0))*coef;\n\t\tsum += coef;\n\t}\n\treturn rv/sum;\n}", +# "name": "Gaussian blur X", +# "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" +#} + +#---------------------- +#gaussian_blur_y.mmg + +#{ +# "name": "gaussian_blur_y", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "sigma": 35.700001, +# "size": 9 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "name": "amount", +# "type": "f" +# } +# ], +# "instance": "vec4 $(name)_fct(vec2 uv) {\n\tfloat e = 1.0/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = max(0.000001, $sigma*$amount(uv));\n\tfor (float i = -50.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+vec2(0.0, i*e))*coef;\n\t\tsum += coef;\n\t}\n\treturn rv/sum;\n}", +# "name": "Gaussian blur Y", +# "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" +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/colors.gd b/game/addons/mat_maker_gd/nodes/common/colors.gd index d5d75c81..d4c5d844 100644 --- a/game/addons/mat_maker_gd/nodes/common/colors.gd +++ b/game/addons/mat_maker_gd/nodes/common/colors.gd @@ -19,6 +19,130 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); #} +#---------------------- +#colorize.mmg +#Remaps a greyscale image to a custom gradient + +# "inputs": [ +# { +# "default": "$uv.x", +# "label": "", +# "longdesc": "The input greyscale image", +# "name": "input", +# "shortdesc": "Input", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "The remapped RGBA image", +# "rgba": "$gradient($input($uv))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "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": "The gradient to which the input is remapped", +# "name": "gradient", +# "shortdesc": "Gradient", +# "type": "gradient" +# } +# ], + +#---------------------- +#default_color.mmg + +# "inputs": [ +# { +# "default": "$default", +# "label": "", +# "name": "in", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "rgba": "$in($uv)", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": { +# "a": 1, +# "b": 1, +# "g": 1, +# "r": 1 +# }, +# "label": "", +# "name": "default", +# "type": "color" +# } +# ] + +#---------------------- +#decompose.mmg +#Decomposes an RGBA input into 4 greyscale images + +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "label": "", +# "longdesc": "The RGBA input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "f": "$i($uv).r", +# "longdesc": "Shows the Red channel of the input", +# "shortdesc": "Red", +# "type": "f" +# }, +# { +# "f": "$i($uv).g", +# "longdesc": "Shows the Green channel of the input", +# "shortdesc": "Green", +# "type": "f" +# }, +# { +# "f": "$i($uv).b", +# "longdesc": "Shows the Blue channel of the input", +# "shortdesc": "Blue", +# "type": "f" +# }, +# { +# "f": "$i($uv).a", +# "longdesc": "Shows the Alpha channel of the input", +# "shortdesc": "Alpha", +# "type": "f" +# } +# ], + static func rgb_to_hsv(c : Vector3) -> Vector3: var K : Color = Color(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); diff --git a/game/addons/mat_maker_gd/nodes/common/dilate.gd b/game/addons/mat_maker_gd/nodes/common/dilate.gd new file mode 100644 index 00000000..9bbe8e88 --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/dilate.gd @@ -0,0 +1,521 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#dilate.mmg + +#{ +# "connections": [ +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer", +# "to_port": 0 +# }, +# { +# "from": "buffer", +# "from_port": 0, +# "to": "dilate_pass_1", +# "to_port": 0 +# }, +# { +# "from": "dilate_pass_1", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "dilate_pass_4", +# "to_port": 0 +# }, +# { +# "from": "dilate_pass_3", +# "from_port": 0, +# "to": "buffer_2_3", +# "to_port": 0 +# }, +# { +# "from": "buffer_2_3", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "buffer_2_2", +# "from_port": 0, +# "to": "dilate_pass_3", +# "to_port": 1 +# }, +# { +# "from": "dilate_pass_4", +# "from_port": 0, +# "to": "dilate_pass_3", +# "to_port": 0 +# }, +# { +# "from": "default_color", +# "from_port": 0, +# "to": "buffer_2_2", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "default_color", +# "to_port": 0 +# } +# ], +# "label": "Dilate", +# "longdesc": "Dilates the white areas of a mask, using the colors of an optional input", +# "name": "dilate", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer", +# "node_position": { +# "x": -473.691315, +# "y": -200.988342 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -255.691315, +# "y": -123.988342 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -140.306458, +# "y": -377.953613 +# }, +# "parameters": { +# "param0": 9, +# "param1": 0.1, +# "param2": 0, +# "param3": 0 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "buffer", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# }, +# { +# "node": "buffer_2_2", +# "widget": "size" +# }, +# { +# "node": "dilate_pass_1", +# "widget": "s" +# }, +# { +# "node": "dilate_pass_4", +# "widget": "s" +# }, +# { +# "node": "buffer_2_3", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input images", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "dilate_pass_1", +# "widget": "d" +# }, +# { +# "node": "dilate_pass_4", +# "widget": "d" +# } +# ], +# "longdesc": "The length of the dilate effect", +# "name": "param1", +# "shortdesc": "Length", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "dilate_pass_3", +# "widget": "amount" +# } +# ], +# "longdesc": "0 to generate a gradient to black while dilating, 1 to fill with input color", +# "name": "param2", +# "shortdesc": "Fill", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "dilate_pass_4", +# "widget": "distance" +# } +# ], +# "name": "param3", +# "shortdesc": "Distance function", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -872.306458, +# "y": -171.4814 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The input mask whose white areas will be dilated", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "The optional source for colors", +# "name": "source", +# "shortdesc": "Source", +# "type": "rgb" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 254.21106, +# "y": -64.4814 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the dilated image", +# "name": "out", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "seed_value": -14401, +# "type": "ios" +# }, +# { +# "name": "buffer_2_2", +# "node_position": { +# "x": -255.323547, +# "y": -44.695679 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "dilate_pass_1", +# "node_position": { +# "x": -252.698792, +# "y": -201.368988 +# }, +# "parameters": { +# "d": 0.1, +# "s": 9 +# }, +# "seed_value": 71939, +# "type": "dilate_pass_1" +# }, +# { +# "name": "dilate_pass_3", +# "node_position": { +# "x": -31.698792, +# "y": -72.368988 +# }, +# "parameters": { +# "amount": 0 +# }, +# "type": "dilate_pass_3" +# }, +# { +# "name": "dilate_pass_4", +# "node_position": { +# "x": -31.689392, +# "y": -186.577301 +# }, +# "parameters": { +# "d": 0.1, +# "distance": 0, +# "s": 9 +# }, +# "type": "dilate_pass_2" +# }, +# { +# "name": "buffer_2_3", +# "node_position": { +# "x": -46.966125, +# "y": -0.711548 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "default_color", +# "node_position": { +# "x": -469.868713, +# "y": -98.02066 +# }, +# "parameters": { +# "default": { +# "a": 1, +# "b": 1, +# "g": 1, +# "r": 1, +# "type": "Color" +# } +# }, +# "type": "default_color" +# } +# ], +# "parameters": { +# "param0": 9, +# "param1": 0.1, +# "param2": 0, +# "param3": 0 +# }, +# "shortdesc": "Dilate", +# "type": "graph" +#} + +#---------------------- +#dilate_pass_1.mmg + +#{ +# "name": "distance_pass_1", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "d": 0.1, +# "s": 9 +# }, +# "seed_value": 8258, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "vec3 $(name)_distance_h(vec2 uv) {\n\tvec2 e = vec2(1.0/$s, 0.0);\n\tint steps = int($s*$d);\n\tfloat rv = 0.0;\n\tvec2 source_uv;\n\tfor (int i = 0; i < steps; ++i) {\n\t\tsource_uv = uv+float(i)*e;\n\t\tif ($in(source_uv) > 0.5) {\n\t\t\trv = 1.0-float(i)*e.x/$d;\n\t\t\tbreak;\n\t\t}\n\t\tsource_uv = uv-float(i)*e;\n\t\tif ($in(source_uv) > 0.5) {\n\t\t\trv = 1.0-float(i)*e.x/$d;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn vec3(rv, source_uv);\n}\n", +# "name": "Distance pass 1", +# "outputs": [ +# { +# "rgb": "$(name)_distance_h($uv)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "", +# "last": 12, +# "name": "s", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "", +# "max": 1, +# "min": 0, +# "name": "d", +# "step": 0.01, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +#} + +#---------------------- +#dilate_pass_2.mmg + +#{ +# "name": "dilate_pass_2", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "d": 0.25, +# "distance": 0, +# "s": 9 +# }, +# "seed_value": 44978, +# "shader_model": { +# "code": "", +# "global": "float dilate_distance_euclidian(float x, float y, float d) {\n\treturn 1.0-sqrt((1.0-x)*(1.0-x)+y*y/d/d);\n}\n\nfloat dilate_distance_manhattan(float x, float y, float d) {\n\treturn 1.0-(abs(1.0-x)+abs(y)/d);\n}\n\nfloat dilate_distance_chebyshev(float x, float y, float d) {\n\treturn 1.0-max(abs(1.0-x), abs(y)/d);\n}\n\n", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec3 $(name)_distance_v(vec2 uv) {\n\tvec2 e = vec2(0.0, 1.0/$s);\n\tint steps = int($s*$d);\n\tvec3 p = $in(uv);\n\tfor (int i = 0; i < steps; ++i) {\n\t\tvec2 dx = float(i)*e;\n\t\tvec3 p2 = $in(uv+dx);\n\t\tif (p2.x > p.x) {\n\t\t\tp2.x = dilate_distance_$distance(p2.x, dx.y, $d);\n\t\t\tp = mix(p, p2, step(p.x, p2.x));\n\t\t}\n\t\tp2 = $in(uv-dx);\n\t\tif (p2.x > p.x) {\n\t\t\tp2.x = dilate_distance_$distance(p2.x, dx.y, $d);\n\t\t\tp = mix(p, p2, step(p.x, p2.x));\n\t\t}\n\t}\n\treturn p;\n}\n", +# "name": "Distance pass 2", +# "outputs": [ +# { +# "rgb": "$(name)_distance_v($uv)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 6, +# "label": "", +# "last": 12, +# "name": "s", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "", +# "max": 1, +# "min": 0, +# "name": "d", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": 2, +# "label": "", +# "name": "distance", +# "type": "enum", +# "values": [ +# { +# "name": "Euclidian", +# "value": "euclidian" +# }, +# { +# "name": "Manhattan", +# "value": "manhattan" +# }, +# { +# "name": "Chebyshev", +# "value": "chebyshev" +# } +# ] +# } +# ] +# }, +# "type": "shader" +#} + +#---------------------- +#dilate_pass_3.mmg + +#{ +# "name": "distance_pass_3", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "amount": 0 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "label": "", +# "name": "distance", +# "type": "rgb" +# }, +# { +# "default": "vec3(1.0)", +# "label": "", +# "name": "source", +# "type": "rgb" +# } +# ], +# "instance": "", +# "name": "Distance pass 3", +# "outputs": [ +# { +# "rgb": "$source($distance($uv).yz)*mix($distance($uv).x, 1.0, $amount)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "", +# "max": 1, +# "min": 0, +# "name": "amount", +# "step": 0.01, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/edge_detect.gd b/game/addons/mat_maker_gd/nodes/common/edge_detect.gd new file mode 100644 index 00000000..3ea3843b --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/edge_detect.gd @@ -0,0 +1,173 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#edge_detect.mmg +#An edge detect filter that detects edges along all directions and draws them in white on a black background + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv) {\n\tvec3 e_base = vec3(1.0/$size, -1.0/$size, 0);\n\tvec3 ref = $in(uv);\n\tvec3 e = vec3(0);\n\tfloat rv = 0.0;\n\tfor (int i = 0; i < int($width); ++i) {\n\t\te += e_base;\n\t\trv += length($in(uv+e.xy)-ref);\n\t\trv += length($in(uv-e.xy)-ref);\n\t\trv += length($in(uv+e.xx)-ref);\n\t\trv += length($in(uv-e.xx)-ref);\n\t\trv += length($in(uv+e.xz)-ref);\n\t\trv += length($in(uv-e.xz)-ref);\n\t\trv += length($in(uv+e.zx)-ref);\n\t\trv += length($in(uv-e.zx)-ref);\n\t\trv *= 2.0;\n\t}\n\treturn rv*pow(2.0, -$width);\n}", +# "outputs": [ +# { +# "f": "clamp(100.0*($(name)_fct($uv)-$threshold), 0.0, 1.0)", +# "longdesc": "Shows the generated outlines", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the input image", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Width", +# "max": 5, +# "min": 1, +# "name": "width", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Threshold", +# "max": 1, +# "min": 0, +# "name": "threshold", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#edge_detect_1.mmg +#An edge detect filter that detects edges along all directions and draws them in white on a black background + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv) {\n\tvec3 e = vec3(1.0/$size, -1.0/$size, 0);\n\tvec3 rv = 8.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.xx);\n\trv -= $in(uv-e.xx);\n\trv -= $in(uv+e.xz);\n\trv -= $in(uv-e.xz);\n\trv -= $in(uv+e.zx);\n\trv -= $in(uv-e.zx);\n\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", +# "outputs": [ +# { +# "f": "clamp($(name)_fct($uv), 0.0, 1.0)", +# "longdesc": "Shows the generated outlines", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the input image", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# } +# ], + +#---------------------- +#edge_detect_2.mmg +#An edge detect filter that detects edges horizontally and vertically and draws them in white on a black background + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, 0.0);\n\tvec3 rv = 4.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\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", +# "outputs": [ +# { +# "f": "clamp($(name)_fct($uv), 0.0, 1.0)", +# "longdesc": "Shows the generated outlines", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the input image", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# } +# ], + +#---------------------- +#edge_detect_3.mmg +#An edge detect filter that detects edges along diagonals and draws them in white on a black background + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgb" +# } +# ], +# "instance": "float $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, -1.0/$size);\n\tvec3 rv = 4.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.xx);\n\trv -= $in(uv-e.xx);\n\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", +# "outputs": [ +# { +# "f": "clamp($(name)_fct($uv), 0.0, 1.0)", +# "longdesc": "Shows the generated outlines", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 9, +# "first": 4, +# "label": "Size", +# "last": 12, +# "longdesc": "The resolution of the input image", +# "name": "size", +# "shortdesc": "Size", +# "type": "size" +# } +# ], + diff --git a/game/addons/mat_maker_gd/nodes/common/mwf.gd b/game/addons/mat_maker_gd/nodes/common/mwf.gd new file mode 100644 index 00000000..7226ea67 --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/mwf.gd @@ -0,0 +1,705 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#mwf_create_map.mmg +#Creates a workflow map using a heightmap and an optional seed map. The workflow map contains height information as well as orientation and a seed for random offset for the material it will be applied to. + +# "inputs": [ +# { +# "default": "1.0", +# "label": "", +# "longdesc": "The input height map", +# "name": "h", +# "shortdesc": "Height", +# "type": "f" +# }, +# { +# "default": "0.0", +# "label": "", +# "longdesc": "The input offset seed map", +# "name": "o", +# "shortdesc": "Offset", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "The generated workflow map, to be connected to a MixMap or an ApplyMap node", +# "rgb": "vec3($height*$h($uv), $angle*0.00277777777+0.5, rand(vec2(float($seed)+$o($uv))))", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 1, +# "label": "Height", +# "longdesc": "The maximum height of the workflow map, used as multiplier for the input height map", +# "max": 1, +# "min": 0, +# "name": "height", +# "shortdesc": "Height", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Angle", +# "longdesc": "The angle stored in the workflow map", +# "max": 180, +# "min": -180, +# "name": "angle", +# "shortdesc": "Angle", +# "step": 0.1, +# "type": "float" +# } +# ], + +#---------------------- +#mwf_mix_maps.mmg +#Mixes up to 4 workflow maps, to be used with the same base material + +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "label": "", +# "longdesc": "The first workflow map", +# "name": "in1", +# "shortdesc": "Input1", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "", +# "longdesc": "The second workflow map", +# "name": "in2", +# "shortdesc": "Input2", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "", +# "longdesc": "The third input map", +# "name": "in3", +# "shortdesc": "Input3", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "", +# "longdesc": "The fourth input map", +# "name": "in4", +# "shortdesc": "Input4", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Generates a merged workflow map", +# "rgb": "matmap_mix(matmap_mix($in1($uv), $in2($uv)), matmap_mix($in3($uv), $in4($uv)))", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], + +#---------------------- +#mwf_map.mmg +#"Applies a workflow map to a base material, and generates height information as well as PBR channels for the result.\nThe height input must be connected to a Create Map or Mix Maps node. The other inputs must be connected to a base material.\nThe outputs must be connected to the Mix or the Output node, or a workflow filter node. + +# "code": "float $(name_uv)_angle = 6.28318530718*($map($uv).y-0.5);\nvec2 $(name_uv)_uv = matmap_uv($uv, $(name_uv)_angle, $map($uv).z);\n", +# "inputs": [ +# { +# "default": "vec3(1.0, 0.5, 0.0)", +# "label": "Map", +# "longdesc": "The input workflow map", +# "name": "map", +# "shortdesc": "Map", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "group_size": 4, +# "label": "Albedo", +# "longdesc": "The Albedo channel of the input base material", +# "name": "mat1", +# "shortdesc": "Albedo", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "ORM", +# "longdesc": "The ambient occlusion, roughness and metallic channels of the input material", +# "name": "mat2", +# "shortdesc": "ORM", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "Emission", +# "longdesc": "The emission channel of the input material", +# "name": "mat3", +# "shortdesc": "Emission", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.5, 0.5, 1.0)", +# "label": "Normal", +# "longdesc": "The normal map of the input material", +# "name": "mat4", +# "shortdesc": "Normal", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "f": "$map($uv).x", +# "group_size": 5, +# "longdesc": "The height map of the result", +# "shortdesc": "Height", +# "type": "f" +# }, +# { +# "longdesc": "The albedo channel of the result", +# "rgb": "$mat1($(name_uv)_uv)", +# "shortdesc": "Albedo", +# "type": "rgb" +# }, +# { +# "longdesc": "The ambient occlusion, roughness and metallic channels of the result", +# "rgb": "$mat2($(name_uv)_uv)", +# "shortdesc": "ORM", +# "type": "rgb" +# }, +# { +# "longdesc": "The emission channel of the result", +# "rgb": "$mat3($(name_uv)_uv)", +# "shortdesc": "Emission", +# "type": "rgb" +# }, +# { +# "longdesc": "The normal map of the result", +# "rgb": "matmap_rotate_nm($mat4($(name_uv)_uv), -$(name_uv)_angle)", +# "shortdesc": "Normal", +# "type": "rgb" +# } +# ], + +#---------------------- +#mwf_mix.mmg +#Combines the outputs of 2 mapped base materials (keeping the \"highest\" material). + +# "code": "float $(name_uv)_a1 = step($h1($uv), $h2($uv));", +# "inputs": [ +# { +# "default": "0.0", +# "group_size": 5, +# "label": "Height 1", +# "longdesc": "The height map of the first input", +# "name": "h1", +# "shortdesc": "Height1", +# "type": "f" +# }, +# { +# "default": "vec3(0.0)", +# "label": "Albedo 1", +# "longdesc": "The albedo channel of the first input", +# "name": "c1", +# "shortdesc": "Albedo1", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "ORM 1", +# "longdesc": "The ambient occlusion, roughness and metallic channels of the first input", +# "name": "orm1", +# "shortdesc": "ORM1", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "Emission 1", +# "longdesc": "The emission channel of the first input", +# "name": "em1", +# "shortdesc": "Emission1", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.5, 0.5, 1.0)", +# "label": "Normal 1", +# "longdesc": "The normal map of the first input", +# "name": "nm1", +# "shortdesc": "Normal1", +# "type": "rgb" +# }, +# { +# "default": "0.0", +# "group_size": 5, +# "label": "Height 2", +# "longdesc": "The height map of the second input", +# "name": "h2", +# "shortdesc": "Height2", +# "type": "f" +# }, +# { +# "default": "vec3(0.0)", +# "label": "Albedo 2", +# "longdesc": "The albedo channel of the second input", +# "name": "c2", +# "shortdesc": "Albedo2", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "ORM 2", +# "longdesc": "The ambient occlusion, roughness and metallic channels of the second input", +# "name": "orm2", +# "shortdesc": "ORM2", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.0)", +# "label": "Emission 2", +# "longdesc": "The emission channel of the second input", +# "name": "em2", +# "shortdesc": "Emission2", +# "type": "rgb" +# }, +# { +# "default": "vec3(0.5, 0.5, 1.0)", +# "label": "Normal 2", +# "longdesc": "The normal map of the second input", +# "name": "nm2", +# "shortdesc": "Normal2", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "f": "max($h1($uv), $h2($uv))", +# "group_size": 5, +# "longdesc": "Generates the height of the result", +# "shortdesc": "Height", +# "type": "f" +# }, +# { +# "longdesc": "Shows the output albedo channel", +# "rgb": "mix($c1($uv), $c2($uv), $(name_uv)_a1)", +# "shortdesc": "Albedo", +# "type": "rgb" +# }, +# { +# "longdesc": "Shows the output ambient occlusion, roughness and metallic channels", +# "rgb": "mix($orm1($uv), $orm2($uv), $(name_uv)_a1)", +# "shortdesc": "ORM", +# "type": "rgb" +# }, +# { +# "longdesc": "Shows the output emission channel", +# "rgb": "mix($em1($uv), $em2($uv), $(name_uv)_a1)", +# "shortdesc": "Emission", +# "type": "rgb" +# }, +# { +# "longdesc": "Shows the output normal map", +# "rgb": "mix($nm1($uv), $nm2($uv), $(name_uv)_a1)", +# "shortdesc": "Normal", +# "type": "rgb" +# } +# ], + + +#---------------------- +#mwf_output.mmg + +#{ +# "connections": [ +# { +# "from": "colorize_3", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 6 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "colorize_3", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "occlusion", +# "to_port": 0 +# }, +# { +# "from": "occlusion", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 5 +# }, +# { +# "from": "gen_inputs", +# "from_port": 2, +# "to": "decompose", +# "to_port": 0 +# }, +# { +# "from": "decompose", +# "from_port": 1, +# "to": "gen_outputs", +# "to_port": 2 +# }, +# { +# "from": "decompose", +# "from_port": 2, +# "to": "gen_outputs", +# "to_port": 1 +# }, +# { +# "from": "blend_2", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 4 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 3, +# "to": "gen_outputs", +# "to_port": 3 +# }, +# { +# "from": "brightness_contrast", +# "from_port": 0, +# "to": "blend_2", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 4, +# "to": "brightness_contrast", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "normal_map_2", +# "to_port": 0 +# }, +# { +# "from": "normal_map_2", +# "from_port": 0, +# "to": "blend_2", +# "to_port": 1 +# } +# ], +# "label": "Output", +# "longdesc": "Converts a workflow mapped material (from an Apply Map or a Mix node) for a Material node", +# "name": "mwf_output", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "colorize_3", +# "node_position": { +# "x": -939.637451, +# "y": 871.842407 +# }, +# "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" +# } +# }, +# "type": "colorize" +# }, +# { +# "name": "occlusion", +# "node_position": { +# "x": -994.845825, +# "y": 786.968262 +# }, +# "parameters": { +# "param0": 10, +# "param2": 1 +# }, +# "type": "occlusion" +# }, +# { +# "name": "decompose", +# "node_position": { +# "x": -924.371338, +# "y": 570.25 +# }, +# "parameters": { +# +# }, +# "type": "decompose" +# }, +# { +# "name": "blend_2", +# "node_position": { +# "x": -931.305542, +# "y": 677.328491 +# }, +# "parameters": { +# "amount": 1, +# "blend_type": 4 +# }, +# "type": "blend" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -1626.805542, +# "y": 608.758606 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 5, +# "name": "Height", +# "type": "f" +# }, +# { +# "group_size": 0, +# "name": "Albedo", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "name": "ORM", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "name": "Emission", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "name": "Normal", +# "type": "rgb" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": -635.305542, +# "y": 597.758606 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 7, +# "longdesc": "", +# "name": "Albedo", +# "shortdesc": "Albedo", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Metallic", +# "shortdesc": "Metallic", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Roughness", +# "shortdesc": "Roughness", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Emission", +# "shortdesc": "Emission", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Normal", +# "shortdesc": "Normal", +# "type": "rgb" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Occlusion", +# "shortdesc": "Occlusion", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "Depth", +# "shortdesc": "Depth", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -1104.881836, +# "y": 425.25 +# }, +# "parameters": { +# "param0": 1, +# "param2": 1 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Occlusion", +# "linked_widgets": [ +# { +# "node": "occlusion", +# "widget": "param2" +# } +# ], +# "longdesc": "The strength of the calculated occlusion effect", +# "name": "param2", +# "shortdesc": "Occlusion", +# "type": "linked_control" +# }, +# { +# "label": "Mat Normal", +# "linked_widgets": [ +# { +# "node": "blend_2", +# "widget": "amount" +# } +# ], +# "longdesc": "The strength of normals from the base materials (compared to the normal generated from height information))", +# "name": "param0", +# "shortdesc": "MatNormal", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "brightness_contrast", +# "node_position": { +# "x": -1177.223877, +# "y": 677.062317 +# }, +# "parameters": { +# "brightness": 0, +# "contrast": 1 +# }, +# "type": "brightness_contrast" +# }, +# { +# "name": "normal_map_2", +# "node_position": { +# "x": -1152.5, +# "y": 544.75 +# }, +# "parameters": { +# "param0": 10, +# "param1": 1.02, +# "param2": 0, +# "param4": 1 +# }, +# "type": "normal_map" +# } +# ], +# "parameters": { +# "param0": 1, +# "param2": 1 +# }, +# "shortdesc": "Output", +# "type": "graph" +#} + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + +#---------------------- +#edge_detect.mmg + + +#vec3 matmap_mix(vec3 in1, vec3 in2) {\n\t +# float is_in1 = step(in2.x, in1.x);\n\t +# //return vec3(max(in1.x, in2.x), in1.yz*is_in1+in2.yz*(1.0-is_in1));\n\t +# return vec3(max(in1.x, in2.x), mix(in2.yz, in1.yz, is_in1));\n +#} + +#vec2 matmap_uv(vec2 uv, float angle, float seed) {\n\t +# uv -= vec2(0.5);\n\tvec2 rv;\n\t +# rv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\t +# rv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\t +# return fract(rv + rand2(vec2(seed)));\n +#} + +#vec3 matmap_rotate_nm(vec3 input, float angle) {\n\t +# vec2 uv = input.xy - vec2(0.5);\n\t +# vec2 rv;\n\t +# rv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\t +# rv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\t +# return vec3(rv + vec2(0.5), input.z);\n +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/sdf2d.gd b/game/addons/mat_maker_gd/nodes/common/sdf2d.gd index 1c1eaa8a..0fffde78 100644 --- a/game/addons/mat_maker_gd/nodes/common/sdf2d.gd +++ b/game/addons/mat_maker_gd/nodes/common/sdf2d.gd @@ -972,6 +972,1326 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") # } # ], +#---------------------- +#curve.mmg + +# "code": "vec2 $(name_uv)_bezier = sdBezier($uv, vec2($ax+0.5, $ay+0.5), vec2($bx+0.5, $by+0.5), vec2($cx+0.5, $cy+0.5));\nvec2 $(name_uv)_uv = vec2($(name_uv)_bezier.x, $(name_uv)_bezier.y/$width+0.5);\nvec2 $(name_uv)_uvtest = step(vec2(0.5), abs($(name_uv)_uv-vec2(0.5)));\n$(name_uv)_uv = mix(vec2(fract($repeat*$(name_uv)_uv.x), $(name_uv)_uv.y), vec2(0.0), max($(name_uv)_uvtest.x, $(name_uv)_uvtest.y));\n", +# "inputs": [ +# { +# "default": "vec4(vec3(step(abs($uv.y-0.5), 0.4999)), 1.0)", +# "label": "", +# "longdesc": "Input pattern to be drawn along the curve", +# "name": "in", +# "shortdesc": "Pattern", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "An image showing the specified curve", +# "rgba": "$in($(name_uv)_uv)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": -0.3, +# "label": "AX", +# "longdesc": "Position on X axis of the first control point", +# "max": 0.5, +# "min": -0.5, +# "name": "ax", +# "shortdesc": "A.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": -0.1, +# "label": "AY", +# "longdesc": "Position on Y axis of the first control point", +# "max": 0.5, +# "min": -0.5, +# "name": "ay", +# "shortdesc": "A.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "P3.x", +# "default": -0, +# "label": "BX", +# "longdesc": "Position on X axis of the second control point", +# "max": 0.5, +# "min": -0.5, +# "name": "bx", +# "shortdesc": "B.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "P3.y", +# "default": 0.2, +# "label": "BY", +# "longdesc": "Position on Y axis of the second control point", +# "max": 0.5, +# "min": -0.5, +# "name": "by", +# "shortdesc": "B.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "P2.x", +# "default": 0.3, +# "label": "CX", +# "longdesc": "Position on X axis of the third control point", +# "max": 0.5, +# "min": -0.5, +# "name": "cx", +# "shortdesc": "C.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "P2.y", +# "default": -0.1, +# "label": "CY", +# "longdesc": "Position on Y axis of the third control point", +# "max": 0.5, +# "min": -0.5, +# "name": "cy", +# "shortdesc": "C.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.1, +# "label": "Width", +# "longdesc": "Width of the curve pattern", +# "max": 0.5, +# "min": 0, +# "name": "width", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Repeat", +# "longdesc": "Number of repetitions of the input pattern", +# "max": 16, +# "min": 1, +# "name": "repeat", +# "shortdesc": "Repeat", +# "step": 1, +# "type": "float" +# } +# ] + +#---------------------- +#sdannularshape.mmg +#Creates an annular shape from a shape described as a signed distance function + +# "inputs": [ +# { +# "default": "0.0", +# "label": "", +# "longdesc": "The input shape, defined as a signed distance function", +# "name": "in", +# "shortdesc": "Input", +# "type": "sdf2d" +# } +# ], +# "outputs": [ +# { +# "longdesc": "The generated layered shape", +# "sdf2d": "sdRipples($in($uv), $r, int($ripples))", +# "shortdesc": "Output", +# "type": "sdf2d" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "Width", +# "longdesc": "The width of each generated ripple", +# "max": 1, +# "min": 0, +# "name": "r", +# "shortdesc": "Width", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Ripples", +# "longdesc": "The number of generated ripples", +# "max": 16, +# "min": 0, +# "name": "ripples", +# "shortdesc": "Ripples", +# "step": 1, +# "type": "float" +# } +# ], + +#---------------------- +#sd_mask_to_sdf.mmg + +#{ +# "connections": [ +# { +# "from": "6520", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "edge_detect", +# "from_port": 0, +# "to": "1823", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "6520", +# "to_port": 1 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "tones_step", +# "to_port": 0 +# }, +# { +# "from": "tones_step", +# "from_port": 0, +# "to": "edge_detect", +# "to_port": 0 +# }, +# { +# "from": "1823", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 0 +# }, +# { +# "from": "2434_8", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 1 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 0, +# "to": "6520", +# "to_port": 0 +# }, +# { +# "from": "24282_2", +# "from_port": 0, +# "to": "2434_8", +# "to_port": 0 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 1, +# "to": "24282_2", +# "to_port": 0 +# } +# ], +# "label": "Mask to SDF", +# "longdesc": "", +# "name": "sd_mask_to_sdf", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "iterate_buffer", +# "node_position": { +# "x": 76.700005, +# "y": -249.817047 +# }, +# "parameters": { +# "filter": false, +# "iterations": 30, +# "mipmap": false, +# "size": 10 +# }, +# "seed_value": 29168, +# "type": "iterate_buffer" +# }, +# { +# "name": "2434_8", +# "node_position": { +# "x": 91.099991, +# "y": -9.031479 +# }, +# "parameters": { +# "distance": 0, +# "size": 10 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(-1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec3 $(name)_jump_flood(vec2 uv, float size) {\n\tivec2 int_uv = ivec2(uv * size);\n\tfloat best_distance = 9999.9;\n\tvec2 best_coord;\n\tfloat iter = $in(uv).b;\n\titer += 0.01;\n\tfloat step_width = size / 4.0 / (iter * 100.0);\n\t\n\tfor (int x = -1; x <= 1; x++) {\n\t\tfor (int y = -1; y <= 1; y++) {\n\t\t\tivec2 offsetUV = int_uv + ivec2(x, y) * int(step_width);\n\t\t\tvec2 float_uv = vec2(offsetUV) / size;\n\t\t\tvec2 offset_pos = $in(float_uv).rg;\n\t\t\t\n\t\t\tif (offset_pos.x != 0.0 && offset_pos.y != 0.0) {\n\t\t\t\tvec2 diff = offset_pos - uv;\n\t\t\t\t//float dist = dot(diff, diff);\n\t\t\t\t$distance\n\t\t\t\tif (dist < best_distance) {\n\t\t\t\t\tbest_distance = dist;\n\t\t\t\t\tbest_coord = offset_pos;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn vec3(best_coord, iter);\n}", +# "name": "Jump Flood", +# "outputs": [ +# { +# "rgb": "$(name)_jump_flood($uv, $size)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 10, +# "first": 0, +# "label": "", +# "last": 13, +# "name": "size", +# "type": "size" +# }, +# { +# "default": 0, +# "label": "", +# "name": "distance", +# "type": "enum", +# "values": [ +# { +# "name": "Euclidean", +# "value": "float dist = dot(diff, diff);" +# }, +# { +# "name": "Manhattan", +# "value": "float dist = abs(diff.x) + abs(diff.y);" +# }, +# { +# "name": "Chebyshev", +# "value": "float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" +# } +# ] +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "1823", +# "node_position": { +# "x": -269.899872, +# "y": -18.741766 +# }, +# "parameters": { +# +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "1.0", +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "Mask to UV Mask", +# "outputs": [ +# { +# "rgb": "$in($uv) < .5 ? vec3(0.0) : vec3($uv, 0.0)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "edge_detect", +# "node_position": { +# "x": -286.951447, +# "y": -137.078964 +# }, +# "parameters": { +# "size": 10, +# "threshold": 0.4, +# "width": 1 +# }, +# "type": "edge_detect" +# }, +# { +# "name": "6520", +# "node_position": { +# "x": 364.156525, +# "y": -261.873169 +# }, +# "parameters": { +# "distance": 0, +# "tiled": false +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# }, +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "name": "mask", +# "type": "f" +# } +# ], +# "instance": "float $(name)_distance(vec2 uv, bool tiled) {\n\tif (tiled) {\n\t\tuv = fract(uv);\n\t}\n\tvec2 custom_uv = $in(uv).xy;\n\tvec2 diff = custom_uv != vec2(0.0) ? custom_uv - uv : vec2(1.0);\n\t$distance\n\tif (!tiled) {\n\t\tuv = clamp(uv, 0.0, 1.0);\n\t}\n\treturn $mask(uv) < 0.5 ? distance : -distance;\n}", +# "name": "Calculate Distance", +# "outputs": [ +# { +# "sdf2d": "$(name)_distance($uv, $tiled)", +# "type": "sdf2d" +# } +# ], +# "parameters": [ +# { +# "default": false, +# "label": "Tiled", +# "name": "tiled", +# "type": "boolean" +# }, +# { +# "default": 0, +# "label": "", +# "name": "distance", +# "type": "enum", +# "values": [ +# { +# "name": "Euclidean", +# "value": "float distance = length(diff);" +# }, +# { +# "name": "Manhattan", +# "value": "float distance = abs(diff.x) + abs(diff.y);" +# }, +# { +# "name": "Chebyshev", +# "value": "float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" +# } +# ] +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -735.85144, +# "y": -352.006775 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The greyscale mask to be converted", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 646.256348, +# "y": -263.285461 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The genrated distance field", +# "name": "sdf", +# "shortdesc": "Output", +# "type": "sdf2d" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -47.67952, +# "y": -541.979187 +# }, +# "parameters": { +# "param0": 10, +# "param1": 30, +# "param2": false, +# "param3": 0 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Size", +# "linked_widgets": [ +# { +# "node": "iterate_buffer", +# "widget": "size" +# }, +# { +# "node": "2434_8", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# }, +# { +# "node": "edge_detect", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution used for the operation", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "Iterations", +# "linked_widgets": [ +# { +# "node": "iterate_buffer", +# "widget": "iterations" +# } +# ], +# "longdesc": "The number of iterations the jump flood algorithm performs to calculate the distances", +# "name": "param1", +# "shortdesc": "Iterations", +# "type": "linked_control" +# }, +# { +# "label": "Tiled", +# "linked_widgets": [ +# { +# "node": "24282_2", +# "widget": "tiled" +# }, +# { +# "node": "6520", +# "widget": "tiled" +# } +# ], +# "longdesc": "Controls whether the resulting ditance field will be tiled. Useful for patterns that extend over the texture bounds", +# "name": "param2", +# "shortdesc": "Tiled", +# "type": "linked_control" +# }, +# { +# "label": "Distance", +# "linked_widgets": [ +# { +# "node": "2434_8", +# "widget": "distance" +# }, +# { +# "node": "6520", +# "widget": "distance" +# } +# ], +# "name": "param3", +# "shortdesc": "Distance function", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -297.702789, +# "y": -348.41391 +# }, +# "parameters": { +# "size": 10 +# }, +# "type": "buffer", +# "version": 1 +# }, +# { +# "name": "tones_step", +# "node_position": { +# "x": -294.947968, +# "y": -258.84549 +# }, +# "parameters": { +# "invert": false, +# "value": 0.5, +# "width": 0 +# }, +# "type": "tones_step" +# }, +# { +# "name": "24282_2", +# "node_position": { +# "x": 114.391708, +# "y": -90.765732 +# }, +# "parameters": { +# "tiled": false +# }, +# "shader_model": { +# "code": "vec3 $(name_uv)_in = $in(fract($uv));\nvec3 $(name_uv)_tiled = $(name_uv)_in.xy != vec2(0.0) ? $(name_uv)_in + vec3(floor($uv), 0.0) : $(name_uv)_in;", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "", +# "name": "Tiling", +# "outputs": [ +# { +# "rgb": "$tiled ? $(name_uv)_tiled : $(name_uv)_in", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": false, +# "label": "Tiled", +# "name": "tiled", +# "type": "boolean" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "connections": [ +# { +# "from": "edge_detect", +# "from_port": 0, +# "to": "1823", +# "to_port": 0 +# }, +# { +# "from": "tones_step", +# "from_port": 0, +# "to": "edge_detect", +# "to_port": 0 +# }, +# { +# "from": "1823", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 0 +# }, +# { +# "from": "2434_8", +# "from_port": 0, +# "to": "iterate_buffer", +# "to_port": 1 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 0, +# "to": "6520", +# "to_port": 0 +# }, +# { +# "from": "24282_2", +# "from_port": 0, +# "to": "2434_8", +# "to_port": 0 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 1, +# "to": "24282_2", +# "to_port": 0 +# }, +# { +# "from": "iterate_buffer", +# "from_port": 0, +# "to": "2153", +# "to_port": 1 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "tones_step", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "2153", +# "to_port": 0 +# }, +# { +# "from": "2153", +# "from_port": 0, +# "to": "11582", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "11582", +# "to_port": 2 +# }, +# { +# "from": "11582", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "8064", +# "from_port": 0, +# "to": "2153", +# "to_port": 2 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "8064", +# "to_port": 0 +# }, +# { +# "from": "8064", +# "from_port": 0, +# "to": "buffer_2", +# "to_port": 0 +# }, +# { +# "from": "buffer_2", +# "from_port": 0, +# "to": "6520", +# "to_port": 1 +# }, +# { +# "from": "6520", +# "from_port": 0, +# "to": "11582", +# "to_port": 0 +# } +# ], +# "label": "Dilate 2", +# "longdesc": "", +# "name": "graph_3", +# "node_position": { +# "x": 515.555786, +# "y": -545.049744 +# }, +# "nodes": [ +# { +# "name": "iterate_buffer", +# "node_position": { +# "x": 64.900002, +# "y": -259.215881 +# }, +# "parameters": { +# "filter": false, +# "iterations": 30, +# "mipmap": false, +# "size": 9 +# }, +# "seed_value": 29168, +# "type": "iterate_buffer" +# }, +# { +# "name": "2434_8", +# "node_position": { +# "x": 102.099998, +# "y": 15.367363 +# }, +# "parameters": { +# "distance": 0, +# "size": 9 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(-1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "vec3 $(name)_jump_flood(vec2 uv, float size) {\n\tivec2 int_uv = ivec2(uv * size);\n\tfloat best_distance = 9999.9;\n\tvec2 best_coord;\n\tfloat iter = $in(uv).b;\n\titer += 0.01;\n\tfloat step_width = size / 4.0 / (iter * 100.0);\n\t\n\tfor (int x = -1; x <= 1; x++) {\n\t\tfor (int y = -1; y <= 1; y++) {\n\t\t\tivec2 offsetUV = int_uv + ivec2(x, y) * int(step_width);\n\t\t\tvec2 float_uv = vec2(offsetUV) / size;\n\t\t\tvec2 offset_pos = $in(float_uv).rg;\n\t\t\t\n\t\t\tif (offset_pos.x != 0.0 && offset_pos.y != 0.0) {\n\t\t\t\tvec2 diff = offset_pos - uv;\n\t\t\t\t//float dist = dot(diff, diff);\n\t\t\t\t//float dist = abs(diff.x) + abs(diff.y);\n\t\t\t\t//float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);\n\t\t\t\t$distance\n\t\t\t\tif (dist < best_distance) {\n\t\t\t\t\tbest_distance = dist;\n\t\t\t\t\tbest_coord = offset_pos;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn vec3(best_coord, iter);\n}", +# "name": "Jump Flood", +# "outputs": [ +# { +# "rgb": "$(name)_jump_flood($uv, $size)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": 10, +# "first": 0, +# "label": "", +# "last": 13, +# "name": "size", +# "type": "size" +# }, +# { +# "default": 2, +# "label": "", +# "name": "distance", +# "type": "enum", +# "values": [ +# { +# "name": "Euclidean", +# "value": "float dist = dot(diff, diff);" +# }, +# { +# "name": "Manhattan", +# "value": "float dist = abs(diff.x) + abs(diff.y);" +# }, +# { +# "name": "Chebyshev", +# "value": "float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" +# } +# ] +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "1823", +# "node_position": { +# "x": -269.899872, +# "y": -17.741766 +# }, +# "parameters": { +# +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "1.0", +# "label": "", +# "name": "in", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "Mask to UV Mask", +# "outputs": [ +# { +# "rgb": "$in($uv) < .5 ? vec3(0.0) : vec3($uv, 0.0)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "edge_detect", +# "node_position": { +# "x": -286.951447, +# "y": -137.078964 +# }, +# "parameters": { +# "size": 9, +# "threshold": 0.4, +# "width": 1 +# }, +# "type": "edge_detect" +# }, +# { +# "name": "6520", +# "node_position": { +# "x": 347.356567, +# "y": -346.449127 +# }, +# "parameters": { +# "distance": 0, +# "length": 0.1 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# }, +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "name": "mask", +# "type": "f" +# } +# ], +# "instance": "float $(name)_distance(vec2 uv, float length) {\n\tvec2 custom_uv = $in(fract(uv)).xy;\n\tvec2 diff = custom_uv != vec2(0.0) ? custom_uv - fract(uv) : vec2(1.0);\n\t//float distance = length(diff);\n\t//float distance = abs(diff.x) + abs(diff.y);\n\t//float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);\n\t$distance\n\tif (length >= 0.0) {\n\t\treturn $mask(uv) < 0.5 ? clamp(1.0 - (distance / length), 0.0, 1.0) : 1.0;\n\t} else {\n\t\treturn $mask(uv) > 0.5 ? clamp((distance / -length), 0.0, 1.0) : 0.0;\n\t}\n}", +# "name": "Calculate Distance", +# "outputs": [ +# { +# "f": "$(name)_distance($uv, $length)", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.1, +# "label": "Length", +# "max": 1, +# "min": -1, +# "name": "length", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": 2, +# "label": "", +# "name": "distance", +# "type": "enum", +# "values": [ +# { +# "name": "Euclidean", +# "value": "float distance = length(diff);" +# }, +# { +# "name": "Manhattan", +# "value": "float distance = abs(diff.x) + abs(diff.y);" +# }, +# { +# "name": "Chebyshev", +# "value": "float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" +# } +# ] +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -793.451477, +# "y": -236.812195 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "The greyscale mask to be converted", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# }, +# { +# "group_size": 0, +# "longdesc": "", +# "name": "source", +# "shortdesc": "Source", +# "type": "rgb" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": 885.056335, +# "y": -247.896317 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "longdesc": "Shows the dilated image", +# "name": "out", +# "shortdesc": "Output", +# "type": "rgb" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": 61.520477, +# "y": -639.339172 +# }, +# "parameters": { +# "param0": 9, +# "param1": 0.1, +# "param2": 0, +# "param3": 0, +# "param4": 30 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "iterate_buffer", +# "widget": "size" +# }, +# { +# "node": "2434_8", +# "widget": "size" +# }, +# { +# "node": "buffer_2", +# "widget": "size" +# }, +# { +# "node": "edge_detect", +# "widget": "size" +# } +# ], +# "longdesc": "The resolution of the input images", +# "name": "param0", +# "shortdesc": "Size", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "6520", +# "widget": "length" +# } +# ], +# "longdesc": "The length of the dilate effect", +# "name": "param1", +# "shortdesc": "Length", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "11582", +# "widget": "fill" +# } +# ], +# "longdesc": "0 to generate a gradient to black while dilating, 1 to fill with input color", +# "name": "param2", +# "shortdesc": "Fill", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "2434_8", +# "widget": "distance" +# }, +# { +# "node": "6520", +# "widget": "distance" +# } +# ], +# "name": "param3", +# "shortdesc": "Distance Function", +# "type": "linked_control" +# }, +# { +# "label": "", +# "linked_widgets": [ +# { +# "node": "iterate_buffer", +# "widget": "iterations" +# } +# ], +# "longdesc": "The number of iterations the jump flood algorithm performs to calculate the distances", +# "name": "param4", +# "shortdesc": "Iterations", +# "type": "linked_control" +# } +# ] +# }, +# { +# "name": "buffer_2", +# "node_position": { +# "x": -294.502808, +# "y": -340.816589 +# }, +# "parameters": { +# "size": 9 +# }, +# "type": "buffer", +# "version": 1 +# }, +# { +# "name": "tones_step", +# "node_position": { +# "x": -285.347992, +# "y": -253.248215 +# }, +# "parameters": { +# "invert": false, +# "value": 0.5, +# "width": 0 +# }, +# "type": "tones_step" +# }, +# { +# "name": "24282_2", +# "node_position": { +# "x": 109.591705, +# "y": -88.567284 +# }, +# "parameters": { +# "tiled": true +# }, +# "shader_model": { +# "code": "vec3 $(name_uv)_in = $in(fract($uv));\nvec3 $(name_uv)_tiled = $(name_uv)_in.xy != vec2(0.0) ? $(name_uv)_in + vec3(floor($uv), 0.0) : $(name_uv)_in;", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(1.0)", +# "function": true, +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "", +# "name": "Tiling", +# "outputs": [ +# { +# "rgb": "$tiled ? $(name_uv)_tiled : $(name_uv)_in", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "default": false, +# "label": "Tiled", +# "name": "tiled", +# "type": "boolean" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "2153", +# "node_position": { +# "x": 368.85202, +# "y": -157.100906 +# }, +# "parameters": { +# +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(1.0)", +# "label": "Source", +# "name": "source", +# "type": "rgb" +# }, +# { +# "default": "$uv", +# "label": "Custom UV", +# "name": "custom_uv", +# "type": "rgb" +# }, +# { +# "default": "0.0", +# "label": "Mask", +# "name": "mask", +# "type": "f" +# } +# ], +# "instance": "", +# "name": "Dilate UV", +# "outputs": [ +# { +# "rgb": "$mask($uv) < 0.5 ? $source($custom_uv($uv).xy) : $source($uv)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "11582", +# "node_position": { +# "x": 609.343445, +# "y": -239.746399 +# }, +# "parameters": { +# "fill": 0 +# }, +# "shader_model": { +# "code": "float $(name_uv)_dist = $distance($uv);\nvec3 $(name_uv)_color = mix($source(fract($uv)), $fill_raw(fract($uv)), float( $(name_uv)_dist != 0.0 ) );\nvec3 $(name_uv)_mix = mix($(name_uv)_color * $(name_uv)_dist, $(name_uv)_color, $fill);", +# "global": "", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "Distance", +# "name": "distance", +# "type": "f" +# }, +# { +# "default": "vec3(1.0)", +# "function": true, +# "label": "Fill Raw", +# "name": "fill_raw", +# "type": "rgb" +# }, +# { +# "default": "vec3(1.0)", +# "function": true, +# "label": "Source", +# "name": "source", +# "type": "rgb" +# } +# ], +# "instance": "", +# "name": "Dilate Combine", +# "outputs": [ +# { +# "rgb": "$(name_uv)_mix", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "Fill", +# "max": 1, +# "min": 0, +# "name": "fill", +# "step": 0.01, +# "type": "float" +# } +# ] +# }, +# "type": "shader" +# }, +# { +# "name": "8064", +# "node_position": { +# "x": -282.533325, +# "y": -433.011169 +# }, +# "parameters": { +# +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "vec3(0.0)", +# "label": "", +# "name": "in", +# "type": "rgb" +# } +# ], +# "instance": "", +# "name": "Default Value", +# "outputs": [ +# { +# "rgb": "$in($uv)", +# "type": "rgb" +# } +# ], +# "parameters": [ +# +# ] +# }, +# "type": "shader" +# } +# ], +# "parameters": { +# "param0": 9, +# "param1": 0.1, +# "param2": 0, +# "param3": 0, +# "param4": 30 +# }, +# "shortdesc": "", +# "type": "graph" +# } +# ], +# "parameters": { +# "param0": 10, +# "param1": 30, +# "param2": false, +# "param3": 0 +# }, +# "shortdesc": "", +# "type": "graph" +#} + static func sdf_show(val : float, bevel : float) -> Color: var f : float = clamp(-val / max(bevel, 0.00001), 0.0, 1.0); @@ -1137,6 +2457,59 @@ static func sdf2d_rotate(uv : Vector2, a : float) -> Vector2: rv.y = -uv.x*s+uv.y*c; return rv+Vector2(0.5, 0.5); +#float cross2( in vec2 a, in vec2 b ) { +# return a.x*b.y - a.y*b.x; +#} + +#// signed distance to a quadratic bezier\n +#vec2 sdBezier( in vec2 pos, in vec2 A, in vec2 B, in vec2 C ) { \n +# vec2 a = B - A;\n +# vec2 b = A - 2.0*B + C;\n +# vec2 c = a * 2.0;\n +# vec2 d = A - pos;\n\n +# float kk = 1.0/dot(b,b);\n +# float kx = kk * dot(a,b);\n +# float ky = kk * (2.0*dot(a,a)+dot(d,b))/3.0;\n +# float kz = kk * dot(d,a); \n\n +# float res = 0.0;\n +# float sgn = 0.0;\n\n +# float p = ky - kx*kx;\n +# float p3 = p*p*p;\n +# float q = kx*(2.0*kx*kx - 3.0*ky) + kz;\n +# float h = q*q + 4.0*p3;\n\t +# float rvx;\n\n +# +# if( h>=0.0 ) { +# // 1 root\n +# h = sqrt(h);\n +# vec2 x = (vec2(h,-h)-q)/2.0;\n +# vec2 uv = sign(x)*pow(abs(x), vec2(1.0/3.0));\n\t\trvx = uv.x+uv.y-kx;\n +# float t = clamp(rvx, 0.0, 1.0);\n +# vec2 q2 = d+(c+b*t)*t;\n +# res = dot(q2, q2);\n \t +# sgn = cross2(c+2.0*b*t, q2);\n +# } else { +# // 3 roots\n +# float z = sqrt(-p);\n +# float v = acos(q/(p*z*2.0))/3.0;\n +# float m = cos(v);\n +# float n = sin(v)*1.732050808;\n +# vec3 t = clamp(vec3(m+m,-n-m,n-m)*z-kx, 0.0, 1.0);\n +# vec2 qx=d+(c+b*t.x)*t.x; +# float dx=dot(qx, qx), sx = cross2(c+2.0*b*t.x,qx);\n +# vec2 qy=d+(c+b*t.y)*t.y; +# float dy=dot(qy, qy), sy = cross2(c+2.0*b*t.y,qy);\n +# +# if( dx Vector2: var a : Vector2 = B - A; @@ -1278,3 +2651,12 @@ static func sdSmoothIntersection(d1 : float, d2 : float, k : float) -> float: return 0.0 +#float sdRipples(float d, float w, int r) {\n\t +# for (int i = 0; i < r; ++i) {\n\t\t +# d = abs(d)-w;\n\t +# }\n\t +# +# return d;\n +#} + + diff --git a/game/addons/mat_maker_gd/nodes/common/shapes.gd b/game/addons/mat_maker_gd/nodes/common/shapes.gd index eae51796..3a3501e1 100644 --- a/game/addons/mat_maker_gd/nodes/common/shapes.gd +++ b/game/addons/mat_maker_gd/nodes/common/shapes.gd @@ -29,6 +29,128 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") #radius, float, min: 0, max: 1, default: 1, step:0.01 (universal input) #edge, float, min: 0, max: 1, default: 0.2, step:0.01 (universal input) +#---------------------- +#box.mmg +#A heightmap of the specified box + +# "outputs": [ +# { +# "f": "1.0-box($uv, vec3($cx, $cy, $cz), vec3($sx, $sy, $sz), 0.01745329251*vec3($rx, $ry, $rz))", +# "longdesc": "A heightmap of the specified box", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0.5, +# "label": "Center X", +# "longdesc": "X coordinate of the center of the box", +# "max": 1, +# "min": 0, +# "name": "cx", +# "shortdesc": "Center.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Center Y", +# "longdesc": "Y coordinate of the center of the box", +# "max": 1, +# "min": 0, +# "name": "cy", +# "shortdesc": "Center.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Center Z", +# "longdesc": "Z coordinate of the center of the box", +# "max": 0.5, +# "min": -0.5, +# "name": "cz", +# "shortdesc": "Center.z", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Size X", +# "longdesc": "Size along X axis", +# "max": 1, +# "min": 0, +# "name": "sx", +# "shortdesc": "Size.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Size Y", +# "longdesc": "Size along Y axis", +# "max": 1, +# "min": 0, +# "name": "sy", +# "shortdesc": "Size.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Size Z", +# "longdesc": "Size along Z axis", +# "max": 1, +# "min": 0, +# "name": "sz", +# "shortdesc": "Size.z", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rot X", +# "longdesc": "Rotation angle around X axis", +# "max": 180, +# "min": -180, +# "name": "rx", +# "shortdesc": "Rot.x", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rot Y", +# "longdesc": "Rotation angle around Y axis", +# "max": 180, +# "min": -180, +# "name": "ry", +# "shortdesc": "Rot.y", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rot Z", +# "longdesc": "Rotation angle around Y axis", +# "max": 180, +# "min": -180, +# "name": "rz", +# "shortdesc": "Rot.z", +# "step": 0.1, +# "type": "float" +# } +# ] #float sphere(vec2 uv, vec2 c, float r) { # uv -= c; @@ -144,3 +266,27 @@ static func shape_rays(uv : Vector2, sides : float, size : float, edge : float) var angle : float = Commons.modf(atan(uv.y / uv.x) + 3.14159265359, slice) / slice return clamp(min((size - angle) / edge, angle / edge), 0.0, 1.0); + +#float box(vec2 uv, vec3 center, vec3 rad, vec3 rot) {\n\t +# vec3 ro = vec3(uv, 1.0)-center;\n\t +# vec3 rd = vec3(0.0000001, 0.0000001, -1.0);\n\t +# mat3 r = mat3(vec3(1, 0, 0), vec3(0, cos(rot.x), -sin(rot.x)), vec3(0, sin(rot.x), cos(rot.x)));\n\t +# +# r *= mat3(vec3(cos(rot.y), 0, -sin(rot.y)), vec3(0, 1, 0), vec3(sin(rot.y), 0, cos(rot.y)));\n\t +# r *= mat3(vec3(cos(rot.z), -sin(rot.z), 0), vec3(sin(rot.z), cos(rot.z), 0), vec3(0, 0, 1));\n\t +# ro = r * ro;\n\t +# rd = r * rd;\n +# vec3 m = 1.0/rd;\n +# vec3 n = m*ro;\n +# vec3 k = abs(m)*rad;\n +# vec3 t1 = -n - k;\n +# vec3 t2 = -n + k;\n\n +# +# float tN = max(max(t1.x, t1.y), t1.z);\n +# float tF = min(min(t2.x, t2.y), t2.z);\n +# +# if(tN>tF || tF<0.0) return 1.0;\n +# +# return tN;\n +#} + diff --git a/game/addons/mat_maker_gd/nodes/common/transforms.gd b/game/addons/mat_maker_gd/nodes/common/transforms.gd new file mode 100644 index 00000000..3eac6671 --- /dev/null +++ b/game/addons/mat_maker_gd/nodes/common/transforms.gd @@ -0,0 +1,1837 @@ +tool +extends Reference + +const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd") + +#---------------------- +#transform.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" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for translation along the X axis", +# "name": "tx", +# "shortdesc": "TranslateMap.x", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for translation along the Y axis", +# "name": "ty", +# "shortdesc": "TranslateMap.y", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for rotation", +# "name": "r", +# "shortdesc": "RotateMap", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for scaling along the X axis", +# "name": "sx", +# "shortdesc": "ScaleMap.x", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for scaling along the Y axis", +# "name": "sy", +# "shortdesc": "ScaleMap.y", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the transformed image", +# "rgba": "$i(transform($uv, vec2($translate_x*(2.0*$tx($uv)-1.0), $translate_y*(2.0*$ty($uv)-1.0)), $rotate*0.01745329251*(2.0*$r($uv)-1.0), vec2($scale_x*(2.0*$sx($uv)-1.0), $scale_y*(2.0*$sy($uv)-1.0)), $repeat))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": 0, +# "label": "2:Translate X:", +# "longdesc": "The translation along the X axis", +# "max": 1, +# "min": -1, +# "name": "translate_x", +# "shortdesc": "Translate.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": 0, +# "label": "Translate Y:", +# "longdesc": "The translation along the Y axis", +# "max": 1, +# "min": -1, +# "name": "translate_y", +# "shortdesc": "Translate.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Radius1.a", +# "default": 0, +# "label": "Rotate:", +# "longdesc": "The rotation angle", +# "max": 720, +# "min": -720, +# "name": "rotate", +# "shortdesc": "Rotate", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.x", +# "default": 1, +# "label": "Scale X:", +# "longdesc": "The scaling factor along the X axis", +# "max": 50, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.y", +# "default": 1, +# "label": "Scale Y:", +# "longdesc": "The scaling factor along the Y axis", +# "max": 50, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "default": false, +# "label": "Repeat:", +# "longdesc": "Repeat the input if checked, clamps otherwise", +# "name": "repeat", +# "shortdesc": "Repeat", +# "type": "boolean" +# } +# ] + +#---------------------- +#transform2.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" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for translation along the X axis", +# "name": "tx", +# "shortdesc": "TranslateMap.x", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for translation along the Y axis", +# "name": "ty", +# "shortdesc": "TranslateMap.y", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for rotation", +# "name": "r", +# "shortdesc": "RotateMap", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for scaling along the X axis", +# "name": "sx", +# "shortdesc": "ScaleMap.x", +# "type": "f" +# }, +# { +# "default": "1.0", +# "label": "", +# "longdesc": "An optional map for scaling along the Y axis", +# "name": "sy", +# "shortdesc": "ScaleMap.y", +# "type": "f" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the transformed image", +# "rgba": "$i($mode(transform2($uv, vec2($translate_x*(2.0*$tx($uv)-1.0), $translate_y*(2.0*$ty($uv)-1.0)), $rotate*0.01745329251*(2.0*$r($uv)-1.0), vec2($scale_x*(2.0*$sx($uv)-1.0), $scale_y*(2.0*$sy($uv)-1.0)))))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": 0, +# "label": "2:Translate X:", +# "longdesc": "The translation along the X axis", +# "max": 1, +# "min": -1, +# "name": "translate_x", +# "shortdesc": "Translate.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": 0, +# "label": "Translate Y:", +# "longdesc": "The translation along the Y axis", +# "max": 1, +# "min": -1, +# "name": "translate_y", +# "shortdesc": "Translate.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Radius1.a", +# "default": 0, +# "label": "Rotate:", +# "longdesc": "The rotation angle", +# "max": 720, +# "min": -720, +# "name": "rotate", +# "shortdesc": "Rotate", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.x", +# "default": 1, +# "label": "Scale X:", +# "longdesc": "The scaling factor along the X axis", +# "max": 50, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.y", +# "default": 1, +# "label": "Scale Y:", +# "longdesc": "The scaling factor along the Y axis", +# "max": 50, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "default": 0, +# "label": "Mode", +# "longdesc": "Defines the behavior beyond the limits or the input image:\n- Clamp stretches the edges\n- Repeat tiles the input\n- Extend shows parts of the input that are beyond the edges", +# "name": "mode", +# "shortdesc": "Mode", +# "type": "enum", +# "values": [ +# { +# "name": "Clamp", +# "value": "transform2_clamp" +# }, +# { +# "name": "Repeat", +# "value": "fract" +# }, +# { +# "name": "Extend", +# "value": "" +# } +# ] +# } +# ] + +#---------------------- +#translate.mmg +#Translates its input + +# "inputs": [ +# { +# "default": "vec4($uv, 0.0, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the translated image", +# "rgba": "$i($uv-vec2($translate_x, $translate_y))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": 0, +# "label": "Translate X:", +# "longdesc": "The translation along the X axis", +# "max": 1, +# "min": -1, +# "name": "translate_x", +# "shortdesc": "Translate.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": 0, +# "label": "Translate Y:", +# "longdesc": "The translation along the Y axis", +# "max": 1, +# "min": -1, +# "name": "translate_y", +# "shortdesc": "Translate.y", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#rotate.mmg +#Rotates its input + +# "inputs": [ +# { +# "default": "vec4($uv, 0.0, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the rotated image", +# "rgba": "$i(rotate($uv, vec2(0.5+$cx, 0.5+$cy), $rotate*0.01745329251))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": 0, +# "label": "Center X:", +# "longdesc": "The position of the rotation center", +# "max": 1, +# "min": -1, +# "name": "cx", +# "shortdesc": "Center.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": 0, +# "label": "Center Y:", +# "longdesc": "The position of the rotation center", +# "max": 1, +# "min": -1, +# "name": "cy", +# "shortdesc": "Center.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Radius1.a", +# "default": 0, +# "label": "Rotate:", +# "longdesc": "The angle of the rotation", +# "max": 720, +# "min": -720, +# "name": "rotate", +# "shortdesc": "Angle", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#scale.mmg +#Scales its input + +# "inputs": [ +# { +# "default": "vec4($uv, 0.0, 1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the scaled image", +# "rgba": "$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y)))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "P1.x", +# "default": 0, +# "label": "Center X:", +# "longdesc": "The position of the scale center", +# "max": 1, +# "min": -1, +# "name": "cx", +# "shortdesc": "Center.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "P1.y", +# "default": 0, +# "label": "Center Y:", +# "longdesc": "The poisition of the scale center", +# "max": 1, +# "min": -1, +# "name": "cy", +# "shortdesc": "Center.y", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.x", +# "default": 1, +# "label": "Scale X:", +# "longdesc": "The scale amount along the X axis", +# "max": 50, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "Scale1.y", +# "default": 1, +# "label": "Scale Y:", +# "longdesc": "The scale amount along the Y axis", +# "max": 50, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#shear.mmg +#Performs a shear stress transform on its input + +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the transformed image", +# "rgba": "$in($uv+$amount*($uv.yx-vec2($center))*vec2($direction))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 1, +# "label": "", +# "longdesc": "The direction of the shear transform (horizontal or vertical)", +# "name": "direction", +# "shortdesc": "Direction", +# "type": "enum", +# "values": [ +# { +# "name": "Horizontal", +# "value": "1.0, 0.0" +# }, +# { +# "name": "Vertical", +# "value": "0.0, 1.0" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The amount of the transform", +# "max": 1, +# "min": -1, +# "name": "amount", +# "shortdesc": "Amount", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The position of the shear center", +# "max": 1, +# "min": 0, +# "name": "center", +# "shortdesc": "Center", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#mirror.mmg +#Mirrors its input while applying an offset from the center + +# "inputs": [ +# { +# "default": "vec4($uv, 0, 1)", +# "label": "", +# "longdesc": "The input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the mirrored image", +# "rgba": "$i(uvmirror_$direction($uv, $offset))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "The mirror direction (horizontal or vertical)", +# "name": "direction", +# "shortdesc": "Direction", +# "type": "enum", +# "values": [ +# { +# "name": "Horizontal", +# "value": "h" +# }, +# { +# "name": "Vertical", +# "value": "v" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The offset from the center", +# "max": 1, +# "min": 0, +# "name": "offset", +# "shortdesc": "Offset", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#kaleidoscope.mmg +#Replicated an angle of the input image several times around the center. + +# "inputs": [ +# { +# "default": "vec4($uv, 0, 1)", +# "label": "", +# "longdesc": "The input image", +# "name": "i", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the transformed image", +# "rgba": "$i(kal_rotate($uv, $count, $offset))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The number of replications of an angle of the input", +# "max": 10, +# "min": 2, +# "name": "count", +# "shortdesc": "Count", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The angular offset of the replicated angle of the input", +# "max": 180, +# "min": -180, +# "name": "offset", +# "shortdesc": "Offset", +# "step": 0.1, +# "type": "float" +# } +# ], + +#---------------------- +#warp.mmg +#Warps its input according to a heightmap + +# "code": "vec2 $(name_uv)_slope = $(name)_slope($uv, $eps);\nvec2 $(name_uv)_warp = $mode;", +# "global": "", +# "inputs": [ +# { +# "default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)", +# "label": "", +# "longdesc": "The input image to be warped", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The height map whose slopes are used to deform the input", +# "name": "d", +# "shortdesc": "Height map", +# "type": "f" +# } +# ], +# "instance": "vec2 $(name)_slope(vec2 uv, float epsilon) {\n\treturn vec2($d(fract(uv+vec2(epsilon, 0.0)))-$d(fract(uv-vec2(epsilon, 0.0))), $d(fract(uv+vec2(0.0, epsilon)))-$d(fract(uv-vec2(0.0, epsilon))));\n}", +# "outputs": [ +# { +# "longdesc": "Shows the warped image", +# "rgba": "$in($uv+$amount*$(name_uv)_warp)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "Both warp modes extract their direction from the height map slopes:\n- Slope warp intensity only depends on the slope\n- Distance to top warp intensity depends on the slope and the distance to the top, and can be used to create mosaic-like patterns\n\nA Transform node with translate maps can produce effects similar to Slope Warp and is generally faster.", +# "name": "mode", +# "shortdesc": "Mode", +# "type": "enum", +# "values": [ +# { +# "name": "Slope", +# "value": "$(name_uv)_slope" +# }, +# { +# "name": "Distance to top", +# "value": "$(name_uv)_slope*(1.0-$d($uv))" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The strength of the warp effect", +# "max": 1, +# "min": 0, +# "name": "amount", +# "shortdesc": "Strength", +# "step": 0.005, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The offset used to measure slopes", +# "max": 0.2, +# "min": 0.005, +# "name": "eps", +# "shortdesc": "Epsilon", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#warp2.mmg +#Warps its input according to a heightmap + +# "code": "vec2 $(name_uv)_slope = $(name)_slope($uv);\nvec2 $(name_uv)_warp = $mode;", +# "inputs": [ +# { +# "default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)", +# "label": "", +# "longdesc": "The input image to be warped", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The height map whose slopes are used to deform the input", +# "name": "d", +# "shortdesc": "Height map", +# "type": "f" +# } +# ], +# "instance": "vec2 $(name)_slope(vec2 uv) {\n vec2 e = vec2(0.001, 0.0);\n return 0.5*vec2($d(uv+e)-$d(uv-e), $d(uv+e.yx)-$d(uv-e.yx))/e.x;\n}", +# "outputs": [ +# { +# "longdesc": "Shows the warped image", +# "rgba": "$in($uv+$amount*$(name_uv)_warp)", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "", +# "longdesc": "Both warp modes extract their direction from the height map slopes:\n- Slope warp intensity only depends on the slope\n- Distance to top warp intensity depends on the slope and the distance to the top, and can be used to create mosaic-like patterns\n\nA Transform node with translate maps can produce effects similar to Slope Warp and is generally faster.", +# "name": "mode", +# "shortdesc": "Mode", +# "type": "enum", +# "values": [ +# { +# "name": "Slope", +# "value": "$(name_uv)_slope" +# }, +# { +# "name": "Distance to top", +# "value": "$(name_uv)_slope*(1.0-$d($uv))" +# } +# ] +# }, +# { +# "control": "None", +# "default": 0, +# "label": "", +# "longdesc": "The strength of the warp effect", +# "max": 1, +# "min": 0, +# "name": "amount", +# "shortdesc": "Strength", +# "step": 0.005, +# "type": "float" +# } +# ], + +#---------------------- +#circle_map.mmg +#Maps its input into a circle + +# "inputs": [ +# { +# "default": "vec4($uv, 0.0, 1.0)", +# "label": "", +# "longdesc": "The input image to be remapped", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the remapped image", +# "rgba": "$in(vec2(fract($repeat*atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), min(0.99999, 2.0/$radius*length($uv-vec2(0.5)))))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 1, +# "label": "Radius", +# "longdesc": "The radius of the circle where the input is mapped", +# "max": 1.5, +# "min": 0, +# "name": "radius", +# "shortdesc": "Radius", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Repeat", +# "longdesc": "The number of repetitions of the input image around the circle", +# "max": 16, +# "min": 0, +# "name": "repeat", +# "shortdesc": "Repeat", +# "step": 1, +# "type": "float" +# } +# ], + +#---------------------- +#custom_uv.mmg +#Remaps an Input image using a custom UV map. + +# "code": "vec3 $(name_uv)_map = $map($uv);\nfloat $(name_uv)_rnd = float($seed)+$(name_uv)_map.z;\n", +# "inputs": [ +# { +# "default": "vec4(1.0)", +# "label": "Input", +# "longdesc": "The image or atlas of images to be remapped.", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "default": "vec3(1.0)", +# "label": "UV", +# "longdesc": "The custom UV map to be used for remapping.", +# "name": "map", +# "shortdesc": "Map", +# "type": "rgb" +# } +# ], +# "outputs": [ +# { +# "longdesc": "Shows the remapped image", +# "rgba": "$in(get_from_tileset($inputs, $(name_uv)_rnd, custom_uv_transform($(name_uv)_map.xy, vec2($sx, $sy), $rotate*0.01745329251, $scale, vec2($(name_uv)_map.z, float($seed)))))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "Inputs", +# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", +# "name": "inputs", +# "shortdesc": "Inputs", +# "type": "enum", +# "values": [ +# { +# "name": "1", +# "value": "1.0" +# }, +# { +# "name": "4", +# "value": "2.0" +# }, +# { +# "name": "16", +# "value": "4.0" +# } +# ] +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale X", +# "longdesc": "The scale of the input image along the X axis.", +# "max": 5, +# "min": 0, +# "name": "sx", +# "shortdesc": "Scale.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale Y", +# "longdesc": "The scale of the input image along the Y axis.", +# "max": 5, +# "min": 0, +# "name": "sy", +# "shortdesc": "Scale.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Rotate", +# "longdesc": "The random rotation applied to each remapped instance.", +# "max": 180, +# "min": 0, +# "name": "rotate", +# "shortdesc": "RndRotate", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Rnd Scale", +# "longdesc": "The random scale applied to each remapped instance.", +# "max": 1, +# "min": 0, +# "name": "scale", +# "shortdesc": "RndScale", +# "step": 0.01, +# "type": "float" +# } +# ], + +#---------------------- +#splatter.mmg +#Spreads several occurences of an input image randomly. + +# "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), vec2(float($seed)));", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The input image or atlas of 4 or 16 input images", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "longdesc": "The mask applied to the pattern", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\trc1 = rand3(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tvec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\tif (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", +# "outputs": [ +# { +# "f": "$(name_uv)_rch.a", +# "longdesc": "Shows the generated pattern", +# "shortdesc": "Output", +# "type": "f" +# }, +# { +# "longdesc": "Shows a random color for each instance of the input image", +# "rgb": "$(name_uv)_rch.rgb", +# "shortdesc": "Instance map", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 10, +# "label": "Count", +# "longdesc": "The number of occurences of the input image", +# "max": 100, +# "min": 1, +# "name": "count", +# "shortdesc": "Count", +# "step": 1, +# "type": "float" +# }, +# { +# "default": 0, +# "label": "Inputs", +# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", +# "name": "select_inputs", +# "shortdesc": "Input", +# "type": "enum", +# "values": [ +# { +# "name": "1", +# "value": " " +# }, +# { +# "name": "4", +# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" +# }, +# { +# "name": "16", +# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" +# } +# ] +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale X", +# "longdesc": "The scale of input images on the X axis", +# "max": 2, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale Y", +# "longdesc": "The scale of input images on the Y axis", +# "max": 2, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Rotate", +# "longdesc": "The random rotation applied to each image instance", +# "max": 180, +# "min": 0, +# "name": "rotate", +# "shortdesc": "RndRotate", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Scale", +# "longdesc": "The random scale applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "scale", +# "shortdesc": "RndScale", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Rnd Value", +# "longdesc": "The random greyscale value applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "value", +# "shortdesc": "RndValue", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": false, +# "label": "Variations", +# "longdesc": "Check to splat variations of the input", +# "name": "variations", +# "shortdesc": "Variations", +# "type": "boolean" +# } +# ] + +#---------------------- +#splatter_color.mmg +#preads several occurences of an input image randomly. + +# "inputs": [ +# { +# "default": "vec4(0.0, 0.0, 0.0, 0.0)", +# "function": true, +# "label": "", +# "longdesc": "The input image or atlas of 4 or 16 input images", +# "name": "in", +# "shortdesc": "Input", +# "type": "rgba" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "longdesc": "The mask applied to the pattern", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tvec4 c = vec4(0.0);\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\tc = mix(c, n, na);\n\t\t}\n\t}\n\treturn c;\n}\n", +# "outputs": [ +# { +# "longdesc": "Shows the generated pattern", +# "rgba": "splatter_$(name)($uv, int($count), vec2(float($seed)))", +# "shortdesc": "Output", +# "type": "rgba" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 10, +# "label": "Count", +# "longdesc": "The number of occurences of the input image", +# "max": 100, +# "min": 1, +# "name": "count", +# "shortdesc": "Count", +# "step": 1, +# "type": "float" +# }, +# { +# "default": 0, +# "label": "Inputs", +# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", +# "name": "select_inputs", +# "shortdesc": "Input", +# "type": "enum", +# "values": [ +# { +# "name": "1", +# "value": " " +# }, +# { +# "name": "4", +# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" +# }, +# { +# "name": "16", +# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" +# } +# ] +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale X", +# "longdesc": "The scale of input images on the X axis", +# "max": 2, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale Y", +# "longdesc": "The scale of input images on the Y axis", +# "max": 2, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Rotate", +# "longdesc": "The random rotation applied to each image instance", +# "max": 180, +# "min": 0, +# "name": "rotate", +# "shortdesc": "RndRotate", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Scale", +# "longdesc": "The random scale applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "scale", +# "shortdesc": "RndScale", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Rnd Opacity", +# "longdesc": "The random opacity applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "opacity", +# "shortdesc": "RndOpacity", +# "step": 0.01, +# "type": "float" +# }, +# { +# "default": false, +# "label": "Variations", +# "longdesc": "Check to splat variations of the input", +# "name": "variations", +# "shortdesc": "Variations", +# "type": "boolean" +# } +# ] + +#---------------------- +#circle_splatter.mmg +#Spreads several occurences of an input image in a circle or spiral pattern. + +# "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), int($rings), vec2(float($seed)));", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The input image or atlas of 4 or 16 input images", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# }, +# { +# "default": "1.0", +# "function": true, +# "label": "", +# "longdesc": "The mask applied to the pattern", +# "name": "mask", +# "shortdesc": "Mask", +# "type": "f" +# } +# ], +# "instance": "vec4 splatter_$(name)(vec2 uv, int count, int rings, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tseed = rand2(seed);\n\tfor (int i = 0; i < count; ++i) {\n\t\tfloat a = -1.57079632679+6.28318530718*float(i)*$rings/float(count);\n\t\tfloat rings_distance = ceil(float(i+1)*float(rings)/float(count))/float(rings);\n\t\tfloat spiral_distance = float(i+1)/float(count);\n\t\tvec2 pos = $radius*mix(rings_distance, spiral_distance, $spiral)*vec2(cos(a), sin(a));\n\t\tfloat mask = $mask(fract(pos-vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = uv-0.5-pos;\n\t\t\trc1 = rand3(seed);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251 + (a+1.57079632679) * $i_rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv /= mix(1.0, float(i+1)/float(count+1), $i_scale);\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in(pv)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", +# "outputs": [ +# { +# "f": "$(name_uv)_rch.a", +# "longdesc": "Shows the generated pattern", +# "shortdesc": "Output", +# "type": "f" +# }, +# { +# "longdesc": "Shows a random color for each instance of the input image", +# "rgb": "$(name_uv)_rch.rgb", +# "shortdesc": "Instance map", +# "type": "rgb" +# } +# ], +# "parameters": [ +# { +# "control": "None", +# "default": 10, +# "label": "Count", +# "longdesc": "The number of occurences of the input image", +# "max": 256, +# "min": 1, +# "name": "count", +# "shortdesc": "Count", +# "step": 1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Rings", +# "longdesc": "The number of rings of the circle pattern", +# "max": 16, +# "min": 1, +# "name": "rings", +# "shortdesc": "Rings", +# "step": 1, +# "type": "float" +# }, +# { +# "default": 0, +# "label": "Inputs", +# "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", +# "name": "select_inputs", +# "shortdesc": "Input", +# "type": "enum", +# "values": [ +# { +# "name": "1", +# "value": " " +# }, +# { +# "name": "4", +# "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" +# }, +# { +# "name": "16", +# "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" +# } +# ] +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale X", +# "longdesc": "The scale of input images on the X axis", +# "max": 2, +# "min": 0, +# "name": "scale_x", +# "shortdesc": "Scale.x", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 1, +# "label": "Scale Y", +# "longdesc": "The scale of input images on the Y axis", +# "max": 2, +# "min": 0, +# "name": "scale_y", +# "shortdesc": "Scale.y", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.25, +# "label": "Radius", +# "longdesc": "The radius of the outer circle pattern", +# "max": 0.5, +# "min": 0, +# "name": "radius", +# "shortdesc": "Radius", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Spiral", +# "longdesc": "The type of pattern:\n- 0: circles\n- 1: spiral", +# "max": 1, +# "min": 0, +# "name": "spiral", +# "shortdesc": "Spiral", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Inc Rotate", +# "longdesc": "The rotate increment along the pattern", +# "max": 1, +# "min": 0, +# "name": "i_rotate", +# "shortdesc": "IncRotate", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Inc Scale", +# "longdesc": "The scale increment of the pattern", +# "max": 1, +# "min": 0, +# "name": "i_scale", +# "shortdesc": "IncScale", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Rotate", +# "longdesc": "The random rotation applied to each image instance", +# "max": 180, +# "min": 0, +# "name": "rotate", +# "shortdesc": "RndRotate", +# "step": 0.1, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Rnd Scale", +# "longdesc": "The random scale applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "scale", +# "shortdesc": "RndScale", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0.5, +# "label": "Rnd Value", +# "longdesc": "The random greyscale value applied to each image instance", +# "max": 1, +# "min": 0, +# "name": "value", +# "shortdesc": "RndValue", +# "step": 0.01, +# "type": "float" +# } +# ] + +#---------------------- +#warp_dilation.mmg + +#{ +# "connections": [ +# { +# "from": "warp_dilation", +# "from_port": 0, +# "to": "buffer_5", +# "to_port": 0 +# }, +# { +# "from": "buffer_5", +# "from_port": 0, +# "to": "gen_outputs", +# "to_port": 0 +# }, +# { +# "from": "gen_inputs", +# "from_port": 1, +# "to": "buffer_6", +# "to_port": 0 +# }, +# { +# "from": "buffer_6", +# "from_port": 0, +# "to": "warp_dilation", +# "to_port": 1 +# }, +# { +# "from": "gen_inputs", +# "from_port": 0, +# "to": "buffer_7", +# "to_port": 0 +# }, +# { +# "from": "buffer_7", +# "from_port": 0, +# "to": "warp_dilation", +# "to_port": 0 +# } +# ], +# "label": "Warp Dilation", +# "longdesc": "", +# "name": "warp_dilation", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "nodes": [ +# { +# "name": "buffer_5", +# "node_position": { +# "x": -387.923584, +# "y": -38 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "buffer_6", +# "node_position": { +# "x": -636.189514, +# "y": -90.757477 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "buffer_7", +# "node_position": { +# "x": -635.189514, +# "y": -199.757477 +# }, +# "parameters": { +# "lod": 0, +# "size": 9 +# }, +# "type": "buffer" +# }, +# { +# "name": "warp_dilation", +# "node_position": { +# "x": -404.125, +# "y": -172.25 +# }, +# "parameters": { +# "a": 0, +# "d": 0.5, +# "mode": 0, +# "s": 9 +# }, +# "type": "warp_dilation_nobuf" +# }, +# { +# "name": "gen_inputs", +# "node_position": { +# "x": -1127.189453, +# "y": -144.691238 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port1", +# "type": "f" +# }, +# { +# "group_size": 0, +# "name": "port0", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_outputs", +# "node_position": { +# "x": -70.923584, +# "y": -122.691238 +# }, +# "parameters": { +# +# }, +# "ports": [ +# { +# "group_size": 0, +# "name": "port0", +# "type": "f" +# } +# ], +# "type": "ios" +# }, +# { +# "name": "gen_parameters", +# "node_position": { +# "x": -463.856934, +# "y": -398.757477 +# }, +# "parameters": { +# "a": 0, +# "d": 0.5, +# "mode": 0, +# "s": 9 +# }, +# "type": "remote", +# "widgets": [ +# { +# "label": "Mode", +# "linked_widgets": [ +# { +# "node": "warp_dilation", +# "widget": "mode" +# } +# ], +# "name": "mode", +# "type": "linked_control" +# }, +# { +# "label": "Resolution", +# "linked_widgets": [ +# { +# "node": "warp_dilation", +# "widget": "s" +# }, +# { +# "node": "buffer_7", +# "widget": "size" +# }, +# { +# "node": "buffer_6", +# "widget": "size" +# }, +# { +# "node": "buffer_5", +# "widget": "size" +# } +# ], +# "name": "s", +# "type": "linked_control" +# }, +# { +# "label": "Distance", +# "linked_widgets": [ +# { +# "node": "warp_dilation", +# "widget": "d" +# } +# ], +# "name": "d", +# "type": "linked_control" +# }, +# { +# "label": "Attenuation", +# "linked_widgets": [ +# { +# "node": "warp_dilation", +# "widget": "a" +# } +# ], +# "name": "a", +# "type": "linked_control" +# } +# ] +# } +# ], +# "parameters": { +# "a": 0, +# "d": 0.5, +# "mode": 0, +# "s": 9 +# }, +# "shortdesc": "", +# "type": "graph" +#} + +#---------------------- +#warp_dilation_nobuf.mmg + +#{ +# "name": "warp_dilation", +# "node_position": { +# "x": 0, +# "y": 0 +# }, +# "parameters": { +# "a": 0, +# "d": 0.5, +# "mode": 0, +# "s": 9 +# }, +# "shader_model": { +# "code": "", +# "global": "", +# "inputs": [ +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The input image", +# "name": "in", +# "shortdesc": "Input", +# "type": "f" +# }, +# { +# "default": "0.0", +# "function": true, +# "label": "", +# "longdesc": "The height map whose contours or slopes are followed", +# "name": "hm", +# "shortdesc": "Height map", +# "type": "f" +# } +# ], +# "instance": "vec2 $(name)_slope(vec2 uv, float epsilon) {\n\tfloat dx = $hm(fract(uv+vec2(epsilon, 0.0)))-$hm(fract(uv-vec2(epsilon, 0.0)));\n\tfloat dy = $hm(fract(uv+vec2(0.0, epsilon)))-$hm(fract(uv-vec2(0.0, epsilon)));\n\treturn vec2($mode);\n}\n\nfloat $(name)_dilate(vec2 uv, vec2 slope) {\n\tfloat e = 1.0/$s;\n\tfloat v = 0.0;\n\tfor (float x = 0.0; x <= $d; x += e) {\n\t\tv = max(v, $in(fract(uv))*(1.0-x/$d*$a));\n\t\tuv += e*normalize($(name)_slope(uv, 0.0001));\n\t}\n\treturn v;\n}", +# "longdesc": "Dilates its input following the contours or slope of an input heightmap", +# "name": "Warp Dilation", +# "outputs": [ +# { +# "f": "$(name)_dilate($uv, normalize($(name)_slope($uv, 0.001)))", +# "longdesc": "The dilated image", +# "shortdesc": "Output", +# "type": "f" +# } +# ], +# "parameters": [ +# { +# "default": 0, +# "label": "Mode", +# "longdesc": "The dilate mode (clockwise contour, counter clockwise contour or slope)", +# "name": "mode", +# "shortdesc": "Mode", +# "type": "enum", +# "values": [ +# { +# "name": "Contour (cw)", +# "value": "-dy,dx" +# }, +# { +# "name": "Contour (ccw)", +# "value": "dy, -dx" +# }, +# { +# "name": "Slope", +# "value": "dx,dy" +# } +# ] +# }, +# { +# "default": 9, +# "first": 6, +# "label": "Resolution", +# "last": 12, +# "longdesc": "The resolution at which the contours or slopes are followed (higher values will be more precise but rendering time will be higher)", +# "name": "s", +# "shortdesc": "Resolution", +# "type": "size" +# }, +# { +# "control": "None", +# "default": 0.1, +# "label": "Distance", +# "longdesc": "The distance along which the contours or slopes are followed", +# "max": 0.5, +# "min": 0, +# "name": "d", +# "shortdesc": "Distance", +# "step": 0.01, +# "type": "float" +# }, +# { +# "control": "None", +# "default": 0, +# "label": "Attenuation", +# "longdesc": "The attenuation applied along the path", +# "max": 1, +# "min": 0, +# "name": "a", +# "shortdesc": "Attenuation", +# "step": 0.01, +# "type": "float" +# } +# ], +# "shortdesc": "Warp Dilation" +# }, +# "type": "shader" +#} + +#vec2 transform(vec2 uv, vec2 translate, float rotate, vec2 scale, bool repeat) {\n \t +# vec2 rv;\n\t +# uv -= translate;\n\t +# uv -= vec2(0.5);\n\t +# rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\t +# rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\t +# rv /= scale;\n\t +# rv += vec2(0.5);\n +# +# if (repeat) {\n\t\t +# return fract(rv);\n\t +# } else {\n\t\t +# return clamp(rv, vec2(0.0), vec2(1.0));\n\t +# }\t\n +#} + + +#vec2 transform2_clamp(vec2 uv) {\n\t +# return clamp(uv, vec2(0.0), vec2(1.0));\n +#} + +#vec2 transform2(vec2 uv, vec2 translate, float rotate, vec2 scale) {\n \t +# vec2 rv;\n\tuv -= translate;\n\t +# uv -= vec2(0.5);\n\t +# rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\t +# rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\t +# rv /= scale;\n\t +# rv += vec2(0.5);\n\t +# return rv;\t\n +#} + +#vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \t +# vec2 rv;\n\t +# uv -= center;\n\t +# rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\t +# rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\t +# rv += center;\n +# return rv;\t\n +#} + +#vec2 scale(vec2 uv, vec2 center, vec2 scale) {\n\t +# uv -= center;\n\t +# uv /= scale;\n\t +# uv += center;\n +# return uv;\n +#} + +#vec2 uvmirror_v(vec2 uv, float offset) {\n\t +# return vec2(uv.x, max(0, abs(uv.y-0.5)-0.5*offset)+0.5);\n +#} + +#vec2 kal_rotate(vec2 uv, float count, float offset) {\n\t +# float pi = 3.14159265359;\n\t +# offset *= pi/180.0;\n\t +# offset += pi*(1.0/count+0.5);\n\t +# uv -= vec2(0.5);\n\t +# +# float l = length(uv);\n\t +# float a = mod(atan(uv.y, uv.x)+offset, 2.0*pi/count)-offset;\n\t +# +# return vec2(0.5)+l*vec2(cos(a), sin(a));\n +#} + + +#vec2 get_from_tileset(float count, float seed, vec2 uv) {\n\t +# return clamp((uv+floor(rand2(vec2(seed))*count))/count, vec2(0.0), vec2(1.0));\n +#} + +#vec2 custom_uv_transform(vec2 uv, vec2 cst_scale, float rnd_rotate, float rnd_scale, vec2 seed) {\n\t +# seed = rand2(seed);\n\tuv -= vec2(0.5);\n\t +# float angle = (seed.x * 2.0 - 1.0) * rnd_rotate;\n\t +# float ca = cos(angle);\n\t +# float sa = sin(angle);\n\t +# uv = vec2(ca*uv.x+sa*uv.y, -sa*uv.x+ca*uv.y);\n\t +# uv *= (seed.y-0.5)*2.0*rnd_scale+1.0;\n\t +# uv /= cst_scale;\n\t +# uv += vec2(0.5);\n\t +# +# return uv;\n +#} + + + diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/box.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/box.mmg deleted file mode 100644 index 26aaf5bb..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/box.mmg +++ /dev/null @@ -1,146 +0,0 @@ -{ - "name": "box", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "cx": 0.5, - "cy": 0.5, - "cz": 0.5, - "rx": 0, - "ry": 0, - "rz": 0, - "sx": 0.25, - "sy": 0.25, - "sz": 0.25 - }, - "shader_model": { - "code": "", - "global": "float box(vec2 uv, vec3 center, vec3 rad, vec3 rot) {\n\tvec3 ro = vec3(uv, 1.0)-center;\n\tvec3 rd = vec3(0.0000001, 0.0000001, -1.0);\n\tmat3 r = mat3(vec3(1, 0, 0), vec3(0, cos(rot.x), -sin(rot.x)), vec3(0, sin(rot.x), cos(rot.x)));\n\tr *= mat3(vec3(cos(rot.y), 0, -sin(rot.y)), vec3(0, 1, 0), vec3(sin(rot.y), 0, cos(rot.y)));\n\tr *= mat3(vec3(cos(rot.z), -sin(rot.z), 0), vec3(sin(rot.z), cos(rot.z), 0), vec3(0, 0, 1));\n\tro = r * ro;\n\trd = r * rd;\n vec3 m = 1.0/rd;\n vec3 n = m*ro;\n vec3 k = abs(m)*rad;\n vec3 t1 = -n - k;\n vec3 t2 = -n + k;\n\n float tN = max(max(t1.x, t1.y), t1.z);\n float tF = min(min(t2.x, t2.y), t2.z);\n if(tN>tF || tF<0.0) return 1.0;\n return tN;\n}", - "inputs": [ - - ], - "instance": "", - "name": "Box", - "outputs": [ - { - "f": "1.0-box($uv, vec3($cx, $cy, $cz), vec3($sx, $sy, $sz), 0.01745329251*vec3($rx, $ry, $rz))", - "longdesc": "A heightmap of the specified box", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.5, - "label": "Center X", - "longdesc": "X coordinate of the center of the box", - "max": 1, - "min": 0, - "name": "cx", - "shortdesc": "Center.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Center Y", - "longdesc": "Y coordinate of the center of the box", - "max": 1, - "min": 0, - "name": "cy", - "shortdesc": "Center.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Center Z", - "longdesc": "Z coordinate of the center of the box", - "max": 0.5, - "min": -0.5, - "name": "cz", - "shortdesc": "Center.z", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Size X", - "longdesc": "Size along X axis", - "max": 1, - "min": 0, - "name": "sx", - "shortdesc": "Size.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Size Y", - "longdesc": "Size along Y axis", - "max": 1, - "min": 0, - "name": "sy", - "shortdesc": "Size.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Size Z", - "longdesc": "Size along Z axis", - "max": 1, - "min": 0, - "name": "sz", - "shortdesc": "Size.z", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rot X", - "longdesc": "Rotation angle around X axis", - "max": 180, - "min": -180, - "name": "rx", - "shortdesc": "Rot.x", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rot Y", - "longdesc": "Rotation angle around Y axis", - "max": 180, - "min": -180, - "name": "ry", - "shortdesc": "Rot.y", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rot Z", - "longdesc": "Rotation angle around Y axis", - "max": 180, - "min": -180, - "name": "rz", - "shortdesc": "Rot.z", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_map.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_map.mmg deleted file mode 100644 index fa0b634f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_map.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "circle_map", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "radius": 1, - "repeat": 1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image to be remapped", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Maps its input into a circle", - "name": "CircleMap", - "outputs": [ - { - "longdesc": "Shows the remapped image", - "rgba": "$in(vec2(fract($repeat*atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), min(0.99999, 2.0/$radius*length($uv-vec2(0.5)))))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 1, - "label": "Radius", - "longdesc": "The radius of the circle where the input is mapped", - "max": 1.5, - "min": 0, - "name": "radius", - "shortdesc": "Radius", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Repeat", - "longdesc": "The number of repetitions of the input image around the circle", - "max": 16, - "min": 0, - "name": "repeat", - "shortdesc": "Repeat", - "step": 1, - "type": "float" - } - ], - "shortdesc": "CircleMap" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter.mmg deleted file mode 100644 index 39313f2f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter.mmg +++ /dev/null @@ -1,219 +0,0 @@ -{ - "name": "circle_splatter", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 20, - "i_rotate": 0, - "i_scale": 0, - "radius": 0.4, - "rings": 2, - "rotate": 0, - "scale": 0, - "scale_x": 1, - "scale_y": 1, - "select_inputs": 0, - "spiral": 0, - "value": 0 - }, - "shader_model": { - "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), int($rings), vec2(float($seed)));", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The input image or atlas of 4 or 16 input images", - "name": "in", - "shortdesc": "Input", - "type": "f" - }, - { - "default": "1.0", - "function": true, - "label": "", - "longdesc": "The mask applied to the pattern", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "vec4 splatter_$(name)(vec2 uv, int count, int rings, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tseed = rand2(seed);\n\tfor (int i = 0; i < count; ++i) {\n\t\tfloat a = -1.57079632679+6.28318530718*float(i)*$rings/float(count);\n\t\tfloat rings_distance = ceil(float(i+1)*float(rings)/float(count))/float(rings);\n\t\tfloat spiral_distance = float(i+1)/float(count);\n\t\tvec2 pos = $radius*mix(rings_distance, spiral_distance, $spiral)*vec2(cos(a), sin(a));\n\t\tfloat mask = $mask(fract(pos-vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = uv-0.5-pos;\n\t\t\trc1 = rand3(seed);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251 + (a+1.57079632679) * $i_rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv /= mix(1.0, float(i+1)/float(count+1), $i_scale);\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in(pv)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", - "longdesc": "Spreads several occurences of an input image in a circle or spiral pattern.", - "name": "Circle Splatter", - "outputs": [ - { - "f": "$(name_uv)_rch.a", - "longdesc": "Shows the generated pattern", - "shortdesc": "Output", - "type": "f" - }, - { - "longdesc": "Shows a random color for each instance of the input image", - "rgb": "$(name_uv)_rch.rgb", - "shortdesc": "Instance map", - "type": "rgb" - } - ], - "parameters": [ - { - "control": "None", - "default": 10, - "label": "Count", - "longdesc": "The number of occurences of the input image", - "max": 256, - "min": 1, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Rings", - "longdesc": "The number of rings of the circle pattern", - "max": 16, - "min": 1, - "name": "rings", - "shortdesc": "Rings", - "step": 1, - "type": "float" - }, - { - "default": 0, - "label": "Inputs", - "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", - "name": "select_inputs", - "shortdesc": "Input", - "type": "enum", - "values": [ - { - "name": "1", - "value": " " - }, - { - "name": "4", - "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" - }, - { - "name": "16", - "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" - } - ] - }, - { - "control": "None", - "default": 1, - "label": "Scale X", - "longdesc": "The scale of input images on the X axis", - "max": 2, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Scale Y", - "longdesc": "The scale of input images on the Y axis", - "max": 2, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.25, - "label": "Radius", - "longdesc": "The radius of the outer circle pattern", - "max": 0.5, - "min": 0, - "name": "radius", - "shortdesc": "Radius", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Spiral", - "longdesc": "The type of pattern:\n- 0: circles\n- 1: spiral", - "max": 1, - "min": 0, - "name": "spiral", - "shortdesc": "Spiral", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Inc Rotate", - "longdesc": "The rotate increment along the pattern", - "max": 1, - "min": 0, - "name": "i_rotate", - "shortdesc": "IncRotate", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Inc Scale", - "longdesc": "The scale increment of the pattern", - "max": 1, - "min": 0, - "name": "i_scale", - "shortdesc": "IncScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Rotate", - "longdesc": "The random rotation applied to each image instance", - "max": 180, - "min": 0, - "name": "rotate", - "shortdesc": "RndRotate", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Scale", - "longdesc": "The random scale applied to each image instance", - "max": 1, - "min": 0, - "name": "scale", - "shortdesc": "RndScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Rnd Value", - "longdesc": "The random greyscale value applied to each image instance", - "max": 1, - "min": 0, - "name": "value", - "shortdesc": "RndValue", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter_color.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter_color.mmg deleted file mode 100644 index 158fefeb..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/circle_splatter_color.mmg +++ /dev/null @@ -1,213 +0,0 @@ -{ - "name": "circle_splatter_color", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 20, - "i_rotate": 0, - "i_scale": 0, - "opacity": 0, - "radius": 0.4, - "rings": 2, - "rotate": 0, - "scale": 0, - "scale_x": 1, - "scale_y": 1, - "select_inputs": 0, - "spiral": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(0.0, 0.0, 0.0, 1.0)", - "function": true, - "label": "", - "longdesc": "The input image or atlas of 4 or 16 input images", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "1.0", - "function": true, - "label": "", - "longdesc": "The mask applied to the pattern", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "vec4 splatter_$(name)(vec2 uv, int count, int rings, vec2 seed) {\n\tvec4 c = vec4(0.0);\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tseed = rand2(seed);\n\tfor (int i = 0; i < count; ++i) {\n\t\tfloat a = -1.57079632679+6.28318530718*float(i)*$rings/float(count);\n\t\tfloat rings_distance = ceil(float(i+1)*float(rings)/float(count))/float(rings);\n\t\tfloat spiral_distance = float(i+1)/float(count);\n\t\tvec2 pos = $radius*mix(rings_distance, spiral_distance, $spiral)*vec2(cos(a), sin(a));\n\t\tfloat mask = $mask(fract(pos-vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = uv-0.5-pos;\n\t\t\trc1 = rand3(seed);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251 + (a+1.57079632679) * $i_rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv /= mix(1.0, float(i+1)/float(count+1), $i_scale);\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tvec4 n = $in(pv);\n\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\tc = mix(c, n, na);\n\t\t}\n\t}\n\treturn c;\n}\n", - "longdesc": "Spreads several occurences of an input image in a circle or spiral pattern.", - "name": "Color Circle Splatter", - "outputs": [ - { - "longdesc": "Shows the generated pattern", - "rgba": "splatter_$(name)($uv, int($count), int($rings), vec2(float($seed)))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 10, - "label": "Count", - "longdesc": "The number of occurences of the input image", - "max": 256, - "min": 1, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Rings", - "longdesc": "The number of rings of the circle pattern", - "max": 16, - "min": 1, - "name": "rings", - "shortdesc": "Rings", - "step": 1, - "type": "float" - }, - { - "default": 0, - "label": "Inputs", - "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", - "name": "select_inputs", - "shortdesc": "Input", - "type": "enum", - "values": [ - { - "name": "1", - "value": " " - }, - { - "name": "4", - "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" - }, - { - "name": "16", - "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" - } - ] - }, - { - "control": "None", - "default": 1, - "label": "Scale X", - "longdesc": "The scale of input images on the X axis", - "max": 2, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Scale Y", - "longdesc": "The scale of input images on the Y axis", - "max": 2, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.25, - "label": "Radius", - "longdesc": "The radius of the outer circle pattern", - "max": 0.5, - "min": 0, - "name": "radius", - "shortdesc": "Radius", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Spiral", - "longdesc": "The type of pattern:\n- 0: circles\n- 1: spiral", - "max": 1, - "min": 0, - "name": "spiral", - "shortdesc": "Spiral", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Inc Rotate", - "longdesc": "The rotate increment along the pattern", - "max": 1, - "min": 0, - "name": "i_rotate", - "shortdesc": "IncRotate", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Inc Scale", - "longdesc": "The scale increment of the pattern", - "max": 1, - "min": 0, - "name": "i_scale", - "shortdesc": "IncScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Rotate", - "longdesc": "The random rotation applied to each image instance", - "max": 180, - "min": 0, - "name": "rotate", - "shortdesc": "RndRotate", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Scale", - "longdesc": "The random scale applied to each image instance", - "max": 1, - "min": 0, - "name": "scale", - "shortdesc": "RndScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Rnd Opacity", - "longdesc": "The random opacity applied to each image instance", - "max": 1, - "min": 0, - "name": "opacity", - "shortdesc": "RndOpacity", - "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/colorize.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/colorize.mmg deleted file mode 100644 index 6fc9f528..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/colorize.mmg +++ /dev/null @@ -1,85 +0,0 @@ -{ - "name": "colorize", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "gradient": { - "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" - } - }, - "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 to a custom gradient", - "name": "Colorize", - "outputs": [ - { - "longdesc": "The remapped RGBA image", - "rgba": "$gradient($input($uv))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "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": "The gradient to which the input is remapped", - "name": "gradient", - "shortdesc": "Gradient", - "type": "gradient" - } - ], - "shortdesc": "Colorize" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/curve.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/curve.mmg deleted file mode 100644 index 5e7121c3..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/curve.mmg +++ /dev/null @@ -1,140 +0,0 @@ -{ - "name": "curve", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "ax": -0.4, - "ay": -0.3, - "bx": 0, - "by": 0.5, - "cx": 0.4, - "cy": -0.3, - "repeat": 1, - "width": 0.05 - }, - "shader_model": { - "code": "vec2 $(name_uv)_bezier = sdBezier($uv, vec2($ax+0.5, $ay+0.5), vec2($bx+0.5, $by+0.5), vec2($cx+0.5, $cy+0.5));\nvec2 $(name_uv)_uv = vec2($(name_uv)_bezier.x, $(name_uv)_bezier.y/$width+0.5);\nvec2 $(name_uv)_uvtest = step(vec2(0.5), abs($(name_uv)_uv-vec2(0.5)));\n$(name_uv)_uv = mix(vec2(fract($repeat*$(name_uv)_uv.x), $(name_uv)_uv.y), vec2(0.0), max($(name_uv)_uvtest.x, $(name_uv)_uvtest.y));\n", - "global": "float cross2( in vec2 a, in vec2 b ) { return a.x*b.y - a.y*b.x; }\n\n// signed distance to a quadratic bezier\nvec2 sdBezier( in vec2 pos, in vec2 A, in vec2 B, in vec2 C ) { \n vec2 a = B - A;\n vec2 b = A - 2.0*B + C;\n vec2 c = a * 2.0;\n vec2 d = A - pos;\n\n float kk = 1.0/dot(b,b);\n float kx = kk * dot(a,b);\n float ky = kk * (2.0*dot(a,a)+dot(d,b))/3.0;\n float kz = kk * dot(d,a); \n\n float res = 0.0;\n float sgn = 0.0;\n\n float p = ky - kx*kx;\n float p3 = p*p*p;\n float q = kx*(2.0*kx*kx - 3.0*ky) + kz;\n float h = q*q + 4.0*p3;\n\tfloat rvx;\n\n if( h>=0.0 ) { // 1 root\n h = sqrt(h);\n vec2 x = (vec2(h,-h)-q)/2.0;\n vec2 uv = sign(x)*pow(abs(x), vec2(1.0/3.0));\n\t\trvx = uv.x+uv.y-kx;\n float t = clamp(rvx, 0.0, 1.0);\n vec2 q2 = d+(c+b*t)*t;\n res = dot(q2, q2);\n \tsgn = cross2(c+2.0*b*t, q2);\n } else { // 3 roots\n float z = sqrt(-p);\n float v = acos(q/(p*z*2.0))/3.0;\n float m = cos(v);\n float n = sin(v)*1.732050808;\n vec3 t = clamp(vec3(m+m,-n-m,n-m)*z-kx, 0.0, 1.0);\n vec2 qx=d+(c+b*t.x)*t.x; float dx=dot(qx, qx), sx = cross2(c+2.0*b*t.x,qx);\n vec2 qy=d+(c+b*t.y)*t.y; float dy=dot(qy, qy), sy = cross2(c+2.0*b*t.y,qy);\n if( dx 0.5) {\n\t\t\trv = 1.0-float(i)*e.x/$d;\n\t\t\tbreak;\n\t\t}\n\t\tsource_uv = uv-float(i)*e;\n\t\tif ($in(source_uv) > 0.5) {\n\t\t\trv = 1.0-float(i)*e.x/$d;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn vec3(rv, source_uv);\n}\n", - "name": "Distance pass 1", - "outputs": [ - { - "rgb": "$(name)_distance_h($uv)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "", - "last": 12, - "name": "s", - "type": "size" - }, - { - "control": "None", - "default": 0.5, - "label": "", - "max": 1, - "min": 0, - "name": "d", - "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/dilate_pass_2.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/dilate_pass_2.mmg deleted file mode 100644 index 5b587d40..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/dilate_pass_2.mmg +++ /dev/null @@ -1,75 +0,0 @@ -{ - "name": "dilate_pass_2", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "d": 0.25, - "distance": 0, - "s": 9 - }, - "seed_value": 44978, - "shader_model": { - "code": "", - "global": "float dilate_distance_euclidian(float x, float y, float d) {\n\treturn 1.0-sqrt((1.0-x)*(1.0-x)+y*y/d/d);\n}\n\nfloat dilate_distance_manhattan(float x, float y, float d) {\n\treturn 1.0-(abs(1.0-x)+abs(y)/d);\n}\n\nfloat dilate_distance_chebyshev(float x, float y, float d) {\n\treturn 1.0-max(abs(1.0-x), abs(y)/d);\n}\n\n", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec3 $(name)_distance_v(vec2 uv) {\n\tvec2 e = vec2(0.0, 1.0/$s);\n\tint steps = int($s*$d);\n\tvec3 p = $in(uv);\n\tfor (int i = 0; i < steps; ++i) {\n\t\tvec2 dx = float(i)*e;\n\t\tvec3 p2 = $in(uv+dx);\n\t\tif (p2.x > p.x) {\n\t\t\tp2.x = dilate_distance_$distance(p2.x, dx.y, $d);\n\t\t\tp = mix(p, p2, step(p.x, p2.x));\n\t\t}\n\t\tp2 = $in(uv-dx);\n\t\tif (p2.x > p.x) {\n\t\t\tp2.x = dilate_distance_$distance(p2.x, dx.y, $d);\n\t\t\tp = mix(p, p2, step(p.x, p2.x));\n\t\t}\n\t}\n\treturn p;\n}\n", - "name": "Distance pass 2", - "outputs": [ - { - "rgb": "$(name)_distance_v($uv)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 9, - "first": 6, - "label": "", - "last": 12, - "name": "s", - "type": "size" - }, - { - "control": "None", - "default": 0.5, - "label": "", - "max": 1, - "min": 0, - "name": "d", - "step": 0.01, - "type": "float" - }, - { - "default": 2, - "label": "", - "name": "distance", - "type": "enum", - "values": [ - { - "name": "Euclidian", - "value": "euclidian" - }, - { - "name": "Manhattan", - "value": "manhattan" - }, - { - "name": "Chebyshev", - "value": "chebyshev" - } - ] - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/dilate_pass_3.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/dilate_pass_3.mmg deleted file mode 100644 index 7564e906..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/dilate_pass_3.mmg +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "distance_pass_3", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "amount": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "distance", - "type": "rgb" - }, - { - "default": "vec3(1.0)", - "label": "", - "name": "source", - "type": "rgb" - } - ], - "instance": "", - "name": "Distance pass 3", - "outputs": [ - { - "rgb": "$source($distance($uv).yz)*mix($distance($uv).x, 1.0, $amount)", - "type": "rgb" - } - ], - "parameters": [ - { - "control": "None", - "default": 0, - "label": "", - "max": 1, - "min": 0, - "name": "amount", - "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/directional_blur.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/directional_blur.mmg deleted file mode 100644 index 54e0e47e..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/directional_blur.mmg +++ /dev/null @@ -1,234 +0,0 @@ -{ - "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": "edge_detect_3_3_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "edge_detect_3_3_2", - "to_port": 1 - } - ], - "label": "Directional Blur", - "longdesc": "Applies a directional gaussian blur to its input", - "name": "directional_blur", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -381.25, - "y": -270.75 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -436.666626, - "y": -413.666656 - }, - "parameters": { - "param0": 9, - "param1": 50, - "param2": 45 - }, - "type": "remote", - "widgets": [ - { - "label": "Grid size:", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "edge_detect_3_3_2", - "widget": "size" - } - ], - "longdesc": "The resolution of the input", - "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" - }, - { - "label": "Angle", - "linked_widgets": [ - { - "node": "edge_detect_3_3_2", - "widget": "angle" - } - ], - "longdesc": "The angle of the directional blur effect", - "name": "param2", - "shortdesc": "Angle", - "type": "linked_control" - } - ] - }, - { - "name": "gen_inputs", - "node_position": { - "x": -779.666626, - "y": -247.392853 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - }, - { - "group_size": 0, - "longdesc": "A map that controls the strength of the blur filter", - "name": "amount", - "shortdesc": "Strength 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": -376.725464, - "y": -184.178955 - }, - "parameters": { - "angle": 45, - "sigma": 50, - "size": 9 - }, - "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": "Label", - "name": "amount", - "type": "f" - } - ], - "instance": "vec4 $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(cos($angle*0.01745329251), -sin($angle*0.01745329251))/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = $sigma*$amount(uv);\n\tfor (float i = -50.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": "Directional 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" - }, - { - "control": "None", - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - } - ], - "parameters": { - "param0": 9, - "param1": 50, - "param2": 45 - }, - "shortdesc": "Directional blur", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect.mmg deleted file mode 100644 index c3dab20f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect.mmg +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "edge_detect", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "size": 9, - "threshold": 0.4, - "width": 2 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgb" - } - ], - "instance": "float $(name)_fct(vec2 uv) {\n\tvec3 e_base = vec3(1.0/$size, -1.0/$size, 0);\n\tvec3 ref = $in(uv);\n\tvec3 e = vec3(0);\n\tfloat rv = 0.0;\n\tfor (int i = 0; i < int($width); ++i) {\n\t\te += e_base;\n\t\trv += length($in(uv+e.xy)-ref);\n\t\trv += length($in(uv-e.xy)-ref);\n\t\trv += length($in(uv+e.xx)-ref);\n\t\trv += length($in(uv-e.xx)-ref);\n\t\trv += length($in(uv+e.xz)-ref);\n\t\trv += length($in(uv-e.xz)-ref);\n\t\trv += length($in(uv+e.zx)-ref);\n\t\trv += length($in(uv-e.zx)-ref);\n\t\trv *= 2.0;\n\t}\n\treturn rv*pow(2.0, -$width);\n}", - "longdesc": "An edge detect filter that detects edges along all directions and draws them in white on a black background", - "name": "Edge detect", - "outputs": [ - { - "f": "clamp(100.0*($(name)_fct($uv)-$threshold), 0.0, 1.0)", - "longdesc": "Shows the generated outlines", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 4, - "label": "Size", - "last": 12, - "longdesc": "The resolution of the input image", - "name": "size", - "shortdesc": "Size", - "type": "size" - }, - { - "control": "None", - "default": 1, - "label": "Width", - "max": 5, - "min": 1, - "name": "width", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Threshold", - "max": 1, - "min": 0, - "name": "threshold", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Edge detect" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_1.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_1.mmg deleted file mode 100644 index 2ba400a1..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_1.mmg +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "edge_detect_1", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "size": 6 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgb" - } - ], - "instance": "float $(name)_fct(vec2 uv) {\n\tvec3 e = vec3(1.0/$size, -1.0/$size, 0);\n\tvec3 rv = 8.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.xx);\n\trv -= $in(uv-e.xx);\n\trv -= $in(uv+e.xz);\n\trv -= $in(uv-e.xz);\n\trv -= $in(uv+e.zx);\n\trv -= $in(uv-e.zx);\n\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", - "longdesc": "An edge detect filter that detects edges along all directions and draws them in white on a black background", - "name": "Edge detect 1", - "outputs": [ - { - "f": "clamp($(name)_fct($uv), 0.0, 1.0)", - "longdesc": "Shows the generated outlines", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 4, - "label": "Size", - "last": 12, - "longdesc": "The resolution of the input image", - "name": "size", - "shortdesc": "Size", - "type": "size" - } - ], - "shortdesc": "Edge detect" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_2.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_2.mmg deleted file mode 100644 index 12b07104..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_2.mmg +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "edge_detect_2", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "size": 6 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgb" - } - ], - "instance": "float $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, 0.0);\n\tvec3 rv = 4.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\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", - "longdesc": "An edge detect filter that detects edges horizontally and vertically and draws them in white on a black background", - "name": "Edge detect 2", - "outputs": [ - { - "f": "clamp($(name)_fct($uv), 0.0, 1.0)", - "longdesc": "Shows the generated outlines", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 4, - "label": "Size", - "last": 12, - "longdesc": "The resolution of the input image", - "name": "size", - "shortdesc": "Size", - "type": "size" - } - ], - "shortdesc": "Edge detect" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_3.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_3.mmg deleted file mode 100644 index 69c4172b..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/edge_detect_3.mmg +++ /dev/null @@ -1,50 +0,0 @@ -{ - "name": "edge_detect_3", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "size": 6 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgb" - } - ], - "instance": "float $(name)_fct(vec2 uv) {\n\tvec2 e = vec2(1.0/$size, -1.0/$size);\n\tvec3 rv = 4.0*$in(uv);\n\trv -= $in(uv+e.xy);\n\trv -= $in(uv-e.xy);\n\trv -= $in(uv+e.xx);\n\trv -= $in(uv-e.xx);\n\trv = abs(rv);\n\treturn max(rv.x, max(rv.y ,rv.z))*$size;\n}", - "longdesc": "An edge detect filter that detects edges along diagonals and draws them in white on a black background", - "name": "Edge detect 3", - "outputs": [ - { - "f": "clamp($(name)_fct($uv), 0.0, 1.0)", - "longdesc": "Shows the generated outlines", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 9, - "first": 4, - "label": "Size", - "last": 12, - "longdesc": "The resolution of the input image", - "name": "size", - "shortdesc": "Size", - "type": "size" - } - ], - "shortdesc": "Edge detect" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur.mmg deleted file mode 100644 index de9bad34..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur.mmg +++ /dev/null @@ -1,156 +0,0 @@ -{ - "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": 0, - "y": 0 - }, - "nodes": [ - { - "name": "fast_blur_shader", - "node_position": { - "x": -168, - "y": 120 - }, - "parameters": { - "quality": 1, - "sigma": 100 - }, - "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, - "longdesc": "The input image", - "name": "input", - "shortdesc": "Input", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 88, - "y": 61.75 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The generated blurred image", - "name": "output", - "shortdesc": "Output", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -254.5, - "y": -122.5 - }, - "parameters": { - "param0": 11, - "param1": 100, - "param2": 1 - }, - "type": "remote", - "widgets": [ - { - "label": "Resolution", - "linked_widgets": [ - { - "node": "buffer_2", - "widget": "size" - } - ], - "longdesc": "The resolution used to sample the input image", - "name": "param0", - "shortdesc": "Resolution", - "type": "linked_control" - }, - { - "label": "Sigma", - "linked_widgets": [ - { - "node": "fast_blur_shader", - "widget": "sigma" - } - ], - "longdesc": "The standard deviation of the gaussian distribution", - "name": "param1", - "shortdesc": "Sigma", - "type": "linked_control" - }, - { - "label": "Quality", - "linked_widgets": [ - { - "node": "fast_blur_shader", - "widget": "quality" - } - ], - "longdesc": "The quality of the effect (increasing quality increases compute time)", - "name": "param2", - "shortdesc": "Quality", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "param0": 11, - "param1": 100, - "param2": 1 - }, - "shortdesc": "", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur_shader.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur_shader.mmg deleted file mode 100644 index ed332ab9..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/fast_blur_shader.mmg +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "fast_blur_shader", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "quality": 1, - "sigma": 100 - }, - "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" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur.mmg deleted file mode 100644 index e1a957c5..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur.mmg +++ /dev/null @@ -1,343 +0,0 @@ -{ - "connections": [ - { - "from": "switch", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "switch", - "from_port": 0, - "to": "switch_2", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "switch", - "to_port": 1 - }, - { - "from": "buffer", - "from_port": 0, - "to": "gaussian_blur_x", - "to_port": 0 - }, - { - "from": "gaussian_blur_x", - "from_port": 0, - "to": "switch", - "to_port": 0 - }, - { - "from": "gaussian_blur_y", - "from_port": 0, - "to": "switch_2", - "to_port": 0 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "gaussian_blur_y", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "gaussian_blur_x", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "gaussian_blur_y", - "to_port": 1 - }, - { - "from": "buffer_3", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "switch_2", - "from_port": 0, - "to": "buffer_3", - "to_port": 0 - } - ], - "label": "Gaussian Blur", - "longdesc": "Applys a gaussian blur on its input", - "name": "gaussian_blur", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "buffer_2", - "node_position": { - "x": -399.875, - "y": -43.625 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "switch", - "node_position": { - "x": -496.452393, - "y": -130.166656 - }, - "parameters": { - "choices": 2, - "outputs": 1, - "source": 0 - }, - "type": "switch" - }, - { - "name": "switch_2", - "node_position": { - "x": -240.452393, - "y": -133.666656 - }, - "parameters": { - "choices": 2, - "outputs": 1, - "source": 0 - }, - "type": "switch" - }, - { - "name": "buffer", - "node_position": { - "x": -402.25, - "y": -315.75 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -439.666626, - "y": -456.666656 - }, - "parameters": { - "param0": 9, - "param1": 50, - "param2": 0 - }, - "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" - }, - { - "node": "buffer_3", - "widget": "size" - } - ], - "longdesc": "The resolution of the input image", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - }, - { - "label": "Sigma:", - "linked_widgets": [ - { - "node": "gaussian_blur_x", - "widget": "sigma" - }, - { - "node": "gaussian_blur_y", - "widget": "sigma" - } - ], - "longdesc": "The strength of the blur filter", - "name": "param1", - "shortdesc": "Sigma", - "type": "linked_control" - }, - { - "configurations": { - "Both": [ - { - "node": "switch", - "value": 0, - "widget": "source" - }, - { - "node": "switch_2", - "value": 0, - "widget": "source" - } - ], - "X": [ - { - "node": "switch", - "value": 0, - "widget": "source" - }, - { - "node": "switch_2", - "value": 1, - "widget": "source" - } - ], - "Y": [ - { - "node": "switch", - "value": 1, - "widget": "source" - }, - { - "node": "switch_2", - "value": 0, - "widget": "source" - } - ] - }, - "label": "Direction:", - "linked_widgets": [ - { - "node": "switch", - "widget": "source" - }, - { - "node": "switch_2", - "widget": "source" - } - ], - "longdesc": "Apply the blur filter horizontally, vertically of in both directions", - "name": "param2", - "shortdesc": "Direction", - "type": "config_control" - } - ] - }, - { - "name": "gen_inputs", - "node_position": { - "x": -928.666626, - "y": -188.392853 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The input image", - "name": "input", - "shortdesc": "Input", - "type": "rgba" - }, - { - "group_size": 0, - "longdesc": "A map that controls the strength of the blur filter", - "name": "amount", - "shortdesc": "Strength map", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 193.547607, - "y": -135.392853 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "Shows the generated blurred image", - "name": "port0", - "shortdesc": "Output", - "type": "rgba" - } - ], - "seed_value": 77778, - "type": "ios" - }, - { - "name": "gaussian_blur_x", - "node_position": { - "x": -412.993408, - "y": -221.281738 - }, - "parameters": { - "sigma": 50, - "size": 9 - }, - "type": "gaussian_blur_x" - }, - { - "name": "gaussian_blur_y", - "node_position": { - "x": -405.993408, - "y": 38.718262 - }, - "parameters": { - "sigma": 50, - "size": 9 - }, - "seed_value": 12279, - "type": "gaussian_blur_y" - }, - { - "name": "buffer_3", - "node_position": { - "x": -50.246796, - "y": -133.96936 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - } - ], - "parameters": { - "param0": 9, - "param1": 50, - "param2": 0 - }, - "shortdesc": "Gaussian blur", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_x.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_x.mmg deleted file mode 100644 index e6342add..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_x.mmg +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "gaussian_blur_x", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "sigma": 35.700001, - "size": 9 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgba" - }, - { - "default": "1.0", - "function": true, - "label": "", - "name": "amount", - "type": "f" - } - ], - "instance": "vec4 $(name)_fct(vec2 uv) {\n\tfloat e = 1.0/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = max(0.000001, $sigma*$amount(uv));\n\tfor (float i = -50.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+vec2(i*e, 0.0))*coef;\n\t\tsum += coef;\n\t}\n\treturn rv/sum;\n}", - "name": "Gaussian blur X", - "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" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_y.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_y.mmg deleted file mode 100644 index c59848da..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/gaussian_blur_y.mmg +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "gaussian_blur_y", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "sigma": 35.700001, - "size": 9 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgba" - }, - { - "default": "1.0", - "function": true, - "label": "", - "name": "amount", - "type": "f" - } - ], - "instance": "vec4 $(name)_fct(vec2 uv) {\n\tfloat e = 1.0/$size;\n\tvec4 rv = vec4(0.0);\n\tfloat sum = 0.0;\n\tfloat sigma = max(0.000001, $sigma*$amount(uv));\n\tfor (float i = -50.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+vec2(0.0, i*e))*coef;\n\t\tsum += coef;\n\t}\n\treturn rv/sum;\n}", - "name": "Gaussian blur Y", - "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" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/godot.tres.tmpl b/game/addons/mat_maker_gd/nodes/material_maker_nodes/godot.tres.tmpl deleted file mode 100644 index 35283e15..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/godot.tres.tmpl +++ /dev/null @@ -1,64 +0,0 @@ -[gd_resource type="SpatialMaterial" load_steps=5 format=2] - -$if $(connected:albedo_tex) -[ext_resource path="$(file_prefix)_albedo.png" type="Texture" id=1] -$fi -$if $(connected:ao_tex) or $(connected:roughness_tex) or $(connected:metallic_tex) -[ext_resource path="$(file_prefix)_orm.png" type="Texture" id=2] -$fi -$if $(connected:normal_tex) -[ext_resource path="$(file_prefix)_normal.png" type="Texture" id=3] -$fi -$if $(connected:depth_tex) -[ext_resource path="$(file_prefix)_depth.png" type="Texture" id=4] -$fi -$if $(connected:emission_tex) -[ext_resource path="$(file_prefix)_emission.png" type="Texture" id=5] -$fi - - -[resource] -albedo_color = Color($(param:albedo_color.r), $(param:albedo_color.g), $(param:albedo_color.b), $(param:albedo_color.a)) -$if $(connected:albedo_tex) -albedo_texture = ExtResource( 1 ) -$fi -metallic = $(param:metallic) -$if $(connected:metallic_tex) -metallic_texture = ExtResource( 2 ) -metallic_texture_channel = 2 -$fi -roughness = $(param:roughness) -$if $(connected:ao_tex) or $(connected:roughness_tex) or $(connected:metallic_tex) -roughness_texture = ExtResource( 2 ) -roughness_texture_channel = 1 -$fi -$if $(connected:normal_tex) -normal_enabled = true -normal_scale = $(param:normal) -normal_texture = ExtResource( 3 ) -$fi -$if $(connected:emission_tex) -emission_enabled = true -emission = Color( 0, 0, 0, 1 ) -emission_energy = $(param:emission_energy) -emission_operator = 0 -emission_on_uv2 = false -emission_texture = ExtResource( 5 ) -$fi -$if $(connected:ao_tex) -ao_enabled = true -ao_light_affect = $(param:ao) -ao_texture = ExtResource( 2 ) -ao_on_uv2 = false -ao_texture_channel = 0 -$fi -$if $(connected:depth_tex) -depth_enabled = true -depth_scale = $(expr:0.2*$(param:depth_scale)) -depth_deep_parallax = true -depth_min_layers = 8 -depth_max_layers = 32 -depth_flip_tangent = false -depth_flip_binormal = false -depth_texture = ExtResource( 4 ) -$fi diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/kaleidoscope.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/kaleidoscope.mmg deleted file mode 100644 index dde275df..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/kaleidoscope.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "kaleidoscope", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 5, - "offset": 0 - }, - "shader_model": { - "code": "", - "global": "vec2 kal_rotate(vec2 uv, float count, float offset) {\n\tfloat pi = 3.14159265359;\n\toffset *= pi/180.0;\n\toffset += pi*(1.0/count+0.5);\n\tuv -= vec2(0.5);\n\tfloat l = length(uv);\n\tfloat a = mod(atan(uv.y, uv.x)+offset, 2.0*pi/count)-offset;\n\treturn vec2(0.5)+l*vec2(cos(a), sin(a));\n}", - "inputs": [ - { - "default": "vec4($uv, 0, 1)", - "label": "", - "longdesc": "The input image", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Replicated an angle of the input image several times around the center.", - "name": "Kaleidoscope", - "outputs": [ - { - "longdesc": "Shows the transformed image", - "rgba": "$i(kal_rotate($uv, $count, $offset))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The number of replications of an angle of the input", - "max": 10, - "min": 2, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The angular offset of the replicated angle of the input", - "max": 180, - "min": -180, - "name": "offset", - "shortdesc": "Offset", - "step": 0.1, - "type": "float" - } - ], - "shortdesc": "Kaleidoscope" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mirror.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mirror.mmg deleted file mode 100644 index 36546245..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mirror.mmg +++ /dev/null @@ -1,70 +0,0 @@ -{ - "name": "mirror", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "direction": 0, - "offset": 0 - }, - "shader_model": { - "code": "", - "global": "vec2 uvmirror_h(vec2 uv, float offset) {\n\treturn vec2(max(0, abs(uv.x-0.5)-0.5*offset)+0.5, uv.y);\n}\nvec2 uvmirror_v(vec2 uv, float offset) {\n\treturn vec2(uv.x, max(0, abs(uv.y-0.5)-0.5*offset)+0.5);\n}", - "inputs": [ - { - "default": "vec4($uv, 0, 1)", - "label": "", - "longdesc": "The input image", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Mirrors its input while applying an offset from the center", - "name": "Mirror", - "outputs": [ - { - "longdesc": "Shows the mirrored image", - "rgba": "$i(uvmirror_$direction($uv, $offset))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "longdesc": "The mirror direction (horizontal or vertical)", - "name": "direction", - "shortdesc": "Direction", - "type": "enum", - "values": [ - { - "name": "Horizontal", - "value": "h" - }, - { - "name": "Vertical", - "value": "v" - } - ] - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The offset from the center", - "max": 1, - "min": 0, - "name": "offset", - "shortdesc": "Offset", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Mirror" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_create_map.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_create_map.mmg deleted file mode 100644 index f9a5ac32..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_create_map.mmg +++ /dev/null @@ -1,72 +0,0 @@ -{ - "name": "mwf_create_map", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "angle": 0, - "height": 0.5 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "1.0", - "label": "", - "longdesc": "The input height map", - "name": "h", - "shortdesc": "Height", - "type": "f" - }, - { - "default": "0.0", - "label": "", - "longdesc": "The input offset seed map", - "name": "o", - "shortdesc": "Offset", - "type": "f" - } - ], - "instance": "", - "longdesc": "Creates a workflow map using a heightmap and an optional seed map. The workflow map contains height information as well as orientation and a seed for random offset for the material it will be applied to.", - "name": "Create Map", - "outputs": [ - { - "longdesc": "The generated workflow map, to be connected to a MixMap or an ApplyMap node", - "rgb": "vec3($height*$h($uv), $angle*0.00277777777+0.5, rand(vec2(float($seed)+$o($uv))))", - "shortdesc": "Output", - "type": "rgb" - } - ], - "parameters": [ - { - "control": "None", - "default": 1, - "label": "Height", - "longdesc": "The maximum height of the workflow map, used as multiplier for the input height map", - "max": 1, - "min": 0, - "name": "height", - "shortdesc": "Height", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Angle", - "longdesc": "The angle stored in the workflow map", - "max": 180, - "min": -180, - "name": "angle", - "shortdesc": "Angle", - "step": 0.1, - "type": "float" - } - ], - "shortdesc": "Create map" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_map.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_map.mmg deleted file mode 100644 index e67463a6..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_map.mmg +++ /dev/null @@ -1,98 +0,0 @@ -{ - "name": "mwf_map", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "float $(name_uv)_angle = 6.28318530718*($map($uv).y-0.5);\nvec2 $(name_uv)_uv = matmap_uv($uv, $(name_uv)_angle, $map($uv).z);\n", - "global": "vec2 matmap_uv(vec2 uv, float angle, float seed) {\n\tuv -= vec2(0.5);\n\tvec2 rv;\n\trv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\trv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\treturn fract(rv + rand2(vec2(seed)));\n}\n\nvec3 matmap_rotate_nm(vec3 input, float angle) {\n\tvec2 uv = input.xy - vec2(0.5);\n\tvec2 rv;\n\trv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\trv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\treturn vec3(rv + vec2(0.5), input.z);\n}\n", - "inputs": [ - { - "default": "vec3(1.0, 0.5, 0.0)", - "label": "Map", - "longdesc": "The input workflow map", - "name": "map", - "shortdesc": "Map", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "group_size": 4, - "label": "Albedo", - "longdesc": "The Albedo channel of the input base material", - "name": "mat1", - "shortdesc": "Albedo", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "ORM", - "longdesc": "The ambient occlusion, roughness and metallic channels of the input material", - "name": "mat2", - "shortdesc": "ORM", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "Emission", - "longdesc": "The emission channel of the input material", - "name": "mat3", - "shortdesc": "Emission", - "type": "rgb" - }, - { - "default": "vec3(0.5, 0.5, 1.0)", - "label": "Normal", - "longdesc": "The normal map of the input material", - "name": "mat4", - "shortdesc": "Normal", - "type": "rgb" - } - ], - "instance": "", - "longdesc": "Applies a workflow map to a base material, and generates height information as well as PBR channels for the result.\nThe height input must be connected to a Create Map or Mix Maps node. The other inputs must be connected to a base material.\nThe outputs must be connected to the Mix or the Output node, or a workflow filter node.", - "name": "Apply Map", - "outputs": [ - { - "f": "$map($uv).x", - "group_size": 5, - "longdesc": "The height map of the result", - "shortdesc": "Height", - "type": "f" - }, - { - "longdesc": "The albedo channel of the result", - "rgb": "$mat1($(name_uv)_uv)", - "shortdesc": "Albedo", - "type": "rgb" - }, - { - "longdesc": "The ambient occlusion, roughness and metallic channels of the result", - "rgb": "$mat2($(name_uv)_uv)", - "shortdesc": "ORM", - "type": "rgb" - }, - { - "longdesc": "The emission channel of the result", - "rgb": "$mat3($(name_uv)_uv)", - "shortdesc": "Emission", - "type": "rgb" - }, - { - "longdesc": "The normal map of the result", - "rgb": "matmap_rotate_nm($mat4($(name_uv)_uv), -$(name_uv)_angle)", - "shortdesc": "Normal", - "type": "rgb" - } - ], - "parameters": [ - - ], - "shortdesc": "Apply Map" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix.mmg deleted file mode 100644 index 0a36a154..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix.mmg +++ /dev/null @@ -1,139 +0,0 @@ -{ - "name": "mwf_mix", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "float $(name_uv)_a1 = step($h1($uv), $h2($uv));", - "global": "", - "inputs": [ - { - "default": "0.0", - "group_size": 5, - "label": "Height 1", - "longdesc": "The height map of the first input", - "name": "h1", - "shortdesc": "Height1", - "type": "f" - }, - { - "default": "vec3(0.0)", - "label": "Albedo 1", - "longdesc": "The albedo channel of the first input", - "name": "c1", - "shortdesc": "Albedo1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "ORM 1", - "longdesc": "The ambient occlusion, roughness and metallic channels of the first input", - "name": "orm1", - "shortdesc": "ORM1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "Emission 1", - "longdesc": "The emission channel of the first input", - "name": "em1", - "shortdesc": "Emission1", - "type": "rgb" - }, - { - "default": "vec3(0.5, 0.5, 1.0)", - "label": "Normal 1", - "longdesc": "The normal map of the first input", - "name": "nm1", - "shortdesc": "Normal1", - "type": "rgb" - }, - { - "default": "0.0", - "group_size": 5, - "label": "Height 2", - "longdesc": "The height map of the second input", - "name": "h2", - "shortdesc": "Height2", - "type": "f" - }, - { - "default": "vec3(0.0)", - "label": "Albedo 2", - "longdesc": "The albedo channel of the second input", - "name": "c2", - "shortdesc": "Albedo2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "ORM 2", - "longdesc": "The ambient occlusion, roughness and metallic channels of the second input", - "name": "orm2", - "shortdesc": "ORM2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "Emission 2", - "longdesc": "The emission channel of the second input", - "name": "em2", - "shortdesc": "Emission2", - "type": "rgb" - }, - { - "default": "vec3(0.5, 0.5, 1.0)", - "label": "Normal 2", - "longdesc": "The normal map of the second input", - "name": "nm2", - "shortdesc": "Normal2", - "type": "rgb" - } - ], - "instance": "", - "longdesc": "Combines the outputs of 2 mapped base materials (keeping the \"highest\" material).", - "name": "Mix", - "outputs": [ - { - "f": "max($h1($uv), $h2($uv))", - "group_size": 5, - "longdesc": "Generates the height of the result", - "shortdesc": "Height", - "type": "f" - }, - { - "longdesc": "Shows the output albedo channel", - "rgb": "mix($c1($uv), $c2($uv), $(name_uv)_a1)", - "shortdesc": "Albedo", - "type": "rgb" - }, - { - "longdesc": "Shows the output ambient occlusion, roughness and metallic channels", - "rgb": "mix($orm1($uv), $orm2($uv), $(name_uv)_a1)", - "shortdesc": "ORM", - "type": "rgb" - }, - { - "longdesc": "Shows the output emission channel", - "rgb": "mix($em1($uv), $em2($uv), $(name_uv)_a1)", - "shortdesc": "Emission", - "type": "rgb" - }, - { - "longdesc": "Shows the output normal map", - "rgb": "mix($nm1($uv), $nm2($uv), $(name_uv)_a1)", - "shortdesc": "Normal", - "type": "rgb" - } - ], - "parameters": [ - - ], - "shortdesc": "Mix" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix_maps.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix_maps.mmg deleted file mode 100644 index 90a62e2f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_mix_maps.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "mwf_mix_maps", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "vec3 matmap_mix(vec3 in1, vec3 in2) {\n\tfloat is_in1 = step(in2.x, in1.x);\n\t//return vec3(max(in1.x, in2.x), in1.yz*is_in1+in2.yz*(1.0-is_in1));\n\treturn vec3(max(in1.x, in2.x), mix(in2.yz, in1.yz, is_in1));\n}", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "longdesc": "The first workflow map", - "name": "in1", - "shortdesc": "Input1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "longdesc": "The second workflow map", - "name": "in2", - "shortdesc": "Input2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "longdesc": "The third input map", - "name": "in3", - "shortdesc": "Input3", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "longdesc": "The fourth input map", - "name": "in4", - "shortdesc": "Input4", - "type": "rgb" - } - ], - "instance": "", - "longdesc": "Mixes up to 4 workflow maps, to be used with the same base material", - "name": "Mix maps", - "outputs": [ - { - "longdesc": "Generates a merged workflow map", - "rgb": "matmap_mix(matmap_mix($in1($uv), $in2($uv)), matmap_mix($in3($uv), $in4($uv)))", - "shortdesc": "Output", - "type": "rgb" - } - ], - "parameters": [ - - ], - "shortdesc": "Mix maps" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_output.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_output.mmg deleted file mode 100644 index 78285011..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/mwf_output.mmg +++ /dev/null @@ -1,334 +0,0 @@ -{ - "connections": [ - { - "from": "colorize_3", - "from_port": 0, - "to": "gen_outputs", - "to_port": 6 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "colorize_3", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "occlusion", - "to_port": 0 - }, - { - "from": "occlusion", - "from_port": 0, - "to": "gen_outputs", - "to_port": 5 - }, - { - "from": "gen_inputs", - "from_port": 2, - "to": "decompose", - "to_port": 0 - }, - { - "from": "decompose", - "from_port": 1, - "to": "gen_outputs", - "to_port": 2 - }, - { - "from": "decompose", - "from_port": 2, - "to": "gen_outputs", - "to_port": 1 - }, - { - "from": "blend_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 4 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 3, - "to": "gen_outputs", - "to_port": 3 - }, - { - "from": "brightness_contrast", - "from_port": 0, - "to": "blend_2", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 4, - "to": "brightness_contrast", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "normal_map_2", - "to_port": 0 - }, - { - "from": "normal_map_2", - "from_port": 0, - "to": "blend_2", - "to_port": 1 - } - ], - "label": "Output", - "longdesc": "Converts a workflow mapped material (from an Apply Map or a Mix node) for a Material node", - "name": "mwf_output", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "colorize_3", - "node_position": { - "x": -939.637451, - "y": 871.842407 - }, - "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" - } - }, - "type": "colorize" - }, - { - "name": "occlusion", - "node_position": { - "x": -994.845825, - "y": 786.968262 - }, - "parameters": { - "param0": 10, - "param2": 1 - }, - "type": "occlusion" - }, - { - "name": "decompose", - "node_position": { - "x": -924.371338, - "y": 570.25 - }, - "parameters": { - - }, - "type": "decompose" - }, - { - "name": "blend_2", - "node_position": { - "x": -931.305542, - "y": 677.328491 - }, - "parameters": { - "amount": 1, - "blend_type": 4 - }, - "type": "blend" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -1626.805542, - "y": 608.758606 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 5, - "name": "Height", - "type": "f" - }, - { - "group_size": 0, - "name": "Albedo", - "type": "rgb" - }, - { - "group_size": 0, - "name": "ORM", - "type": "rgb" - }, - { - "group_size": 0, - "name": "Emission", - "type": "rgb" - }, - { - "group_size": 0, - "name": "Normal", - "type": "rgb" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": -635.305542, - "y": 597.758606 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 7, - "longdesc": "", - "name": "Albedo", - "shortdesc": "Albedo", - "type": "rgb" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Metallic", - "shortdesc": "Metallic", - "type": "f" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Roughness", - "shortdesc": "Roughness", - "type": "f" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Emission", - "shortdesc": "Emission", - "type": "rgb" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Normal", - "shortdesc": "Normal", - "type": "rgb" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Occlusion", - "shortdesc": "Occlusion", - "type": "f" - }, - { - "group_size": 0, - "longdesc": "", - "name": "Depth", - "shortdesc": "Depth", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -1104.881836, - "y": 425.25 - }, - "parameters": { - "param0": 1, - "param2": 1 - }, - "type": "remote", - "widgets": [ - { - "label": "Occlusion", - "linked_widgets": [ - { - "node": "occlusion", - "widget": "param2" - } - ], - "longdesc": "The strength of the calculated occlusion effect", - "name": "param2", - "shortdesc": "Occlusion", - "type": "linked_control" - }, - { - "label": "Mat Normal", - "linked_widgets": [ - { - "node": "blend_2", - "widget": "amount" - } - ], - "longdesc": "The strength of normals from the base materials (compared to the normal generated from height information))", - "name": "param0", - "shortdesc": "MatNormal", - "type": "linked_control" - } - ] - }, - { - "name": "brightness_contrast", - "node_position": { - "x": -1177.223877, - "y": 677.062317 - }, - "parameters": { - "brightness": 0, - "contrast": 1 - }, - "type": "brightness_contrast" - }, - { - "name": "normal_map_2", - "node_position": { - "x": -1152.5, - "y": 544.75 - }, - "parameters": { - "param0": 10, - "param1": 1.02, - "param2": 0, - "param4": 1 - }, - "type": "normal_map" - } - ], - "parameters": { - "param0": 1, - "param2": 1 - }, - "shortdesc": "Output", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/rotate.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/rotate.mmg deleted file mode 100644 index 6dda441a..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/rotate.mmg +++ /dev/null @@ -1,77 +0,0 @@ -{ - "name": "rotate", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "cx": 0, - "cy": 0, - "rotate": 0 - }, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Rotates its input", - "name": "Rotate", - "outputs": [ - { - "longdesc": "Shows the rotated image", - "rgba": "$i(rotate($uv, vec2(0.5+$cx, 0.5+$cy), $rotate*0.01745329251))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "Center X:", - "longdesc": "The position of the rotation center", - "max": 1, - "min": -1, - "name": "cx", - "shortdesc": "Center.x", - "step": 0.005, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Center Y:", - "longdesc": "The position of the rotation center", - "max": 1, - "min": -1, - "name": "cy", - "shortdesc": "Center.y", - "step": 0.005, - "type": "float" - }, - { - "control": "Radius1.a", - "default": 0, - "label": "Rotate:", - "longdesc": "The angle of the rotation", - "max": 720, - "min": -720, - "name": "rotate", - "shortdesc": "Angle", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Rotate" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/scale.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/scale.mmg deleted file mode 100644 index 351d4151..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/scale.mmg +++ /dev/null @@ -1,90 +0,0 @@ -{ - "name": "scale", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "cx": 0, - "cy": 0, - "scale_x": 1, - "scale_y": 1 - }, - "shader_model": { - "code": "", - "global": "vec2 scale(vec2 uv, vec2 center, vec2 scale) {\n\tuv -= center;\n\tuv /= scale;\n\tuv += center;\n return uv;\n}", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Scales its input", - "name": "Scale", - "outputs": [ - { - "longdesc": "Shows the scaled image", - "rgba": "$i(scale($uv, vec2(0.5+$cx, 0.5+$cy), vec2($scale_x, $scale_y)))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "Center X:", - "longdesc": "The position of the scale center", - "max": 1, - "min": -1, - "name": "cx", - "shortdesc": "Center.x", - "step": 0.005, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Center Y:", - "longdesc": "The poisition of the scale center", - "max": 1, - "min": -1, - "name": "cy", - "shortdesc": "Center.y", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.x", - "default": 1, - "label": "Scale X:", - "longdesc": "The scale amount along the X axis", - "max": 50, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.y", - "default": 1, - "label": "Scale Y:", - "longdesc": "The scale amount along the Y axis", - "max": 50, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Scale" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/sd_mask_to_sdf.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/sd_mask_to_sdf.mmg deleted file mode 100644 index ce94f4a8..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/sd_mask_to_sdf.mmg +++ /dev/null @@ -1,1146 +0,0 @@ -{ - "connections": [ - { - "from": "6520", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "edge_detect", - "from_port": 0, - "to": "1823", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "6520", - "to_port": 1 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "tones_step", - "to_port": 0 - }, - { - "from": "tones_step", - "from_port": 0, - "to": "edge_detect", - "to_port": 0 - }, - { - "from": "1823", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 0 - }, - { - "from": "2434_8", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 1 - }, - { - "from": "iterate_buffer", - "from_port": 0, - "to": "6520", - "to_port": 0 - }, - { - "from": "24282_2", - "from_port": 0, - "to": "2434_8", - "to_port": 0 - }, - { - "from": "iterate_buffer", - "from_port": 1, - "to": "24282_2", - "to_port": 0 - } - ], - "label": "Mask to SDF", - "longdesc": "", - "name": "sd_mask_to_sdf", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "iterate_buffer", - "node_position": { - "x": 76.700005, - "y": -249.817047 - }, - "parameters": { - "filter": false, - "iterations": 30, - "mipmap": false, - "size": 10 - }, - "seed_value": 29168, - "type": "iterate_buffer" - }, - { - "name": "2434_8", - "node_position": { - "x": 91.099991, - "y": -9.031479 - }, - "parameters": { - "distance": 0, - "size": 10 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(-1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec3 $(name)_jump_flood(vec2 uv, float size) {\n\tivec2 int_uv = ivec2(uv * size);\n\tfloat best_distance = 9999.9;\n\tvec2 best_coord;\n\tfloat iter = $in(uv).b;\n\titer += 0.01;\n\tfloat step_width = size / 4.0 / (iter * 100.0);\n\t\n\tfor (int x = -1; x <= 1; x++) {\n\t\tfor (int y = -1; y <= 1; y++) {\n\t\t\tivec2 offsetUV = int_uv + ivec2(x, y) * int(step_width);\n\t\t\tvec2 float_uv = vec2(offsetUV) / size;\n\t\t\tvec2 offset_pos = $in(float_uv).rg;\n\t\t\t\n\t\t\tif (offset_pos.x != 0.0 && offset_pos.y != 0.0) {\n\t\t\t\tvec2 diff = offset_pos - uv;\n\t\t\t\t//float dist = dot(diff, diff);\n\t\t\t\t$distance\n\t\t\t\tif (dist < best_distance) {\n\t\t\t\t\tbest_distance = dist;\n\t\t\t\t\tbest_coord = offset_pos;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn vec3(best_coord, iter);\n}", - "name": "Jump Flood", - "outputs": [ - { - "rgb": "$(name)_jump_flood($uv, $size)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 10, - "first": 0, - "label": "", - "last": 13, - "name": "size", - "type": "size" - }, - { - "default": 0, - "label": "", - "name": "distance", - "type": "enum", - "values": [ - { - "name": "Euclidean", - "value": "float dist = dot(diff, diff);" - }, - { - "name": "Manhattan", - "value": "float dist = abs(diff.x) + abs(diff.y);" - }, - { - "name": "Chebyshev", - "value": "float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" - } - ] - } - ] - }, - "type": "shader" - }, - { - "name": "1823", - "node_position": { - "x": -269.899872, - "y": -18.741766 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "1.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "Mask to UV Mask", - "outputs": [ - { - "rgb": "$in($uv) < .5 ? vec3(0.0) : vec3($uv, 0.0)", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "edge_detect", - "node_position": { - "x": -286.951447, - "y": -137.078964 - }, - "parameters": { - "size": 10, - "threshold": 0.4, - "width": 1 - }, - "type": "edge_detect" - }, - { - "name": "6520", - "node_position": { - "x": 364.156525, - "y": -261.873169 - }, - "parameters": { - "distance": 0, - "tiled": false - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - }, - { - "default": "0.0", - "function": true, - "label": "", - "name": "mask", - "type": "f" - } - ], - "instance": "float $(name)_distance(vec2 uv, bool tiled) {\n\tif (tiled) {\n\t\tuv = fract(uv);\n\t}\n\tvec2 custom_uv = $in(uv).xy;\n\tvec2 diff = custom_uv != vec2(0.0) ? custom_uv - uv : vec2(1.0);\n\t$distance\n\tif (!tiled) {\n\t\tuv = clamp(uv, 0.0, 1.0);\n\t}\n\treturn $mask(uv) < 0.5 ? distance : -distance;\n}", - "name": "Calculate Distance", - "outputs": [ - { - "sdf2d": "$(name)_distance($uv, $tiled)", - "type": "sdf2d" - } - ], - "parameters": [ - { - "default": false, - "label": "Tiled", - "name": "tiled", - "type": "boolean" - }, - { - "default": 0, - "label": "", - "name": "distance", - "type": "enum", - "values": [ - { - "name": "Euclidean", - "value": "float distance = length(diff);" - }, - { - "name": "Manhattan", - "value": "float distance = abs(diff.x) + abs(diff.y);" - }, - { - "name": "Chebyshev", - "value": "float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" - } - ] - } - ] - }, - "type": "shader" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -735.85144, - "y": -352.006775 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The greyscale mask to be converted", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 646.256348, - "y": -263.285461 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The genrated distance field", - "name": "sdf", - "shortdesc": "Output", - "type": "sdf2d" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -47.67952, - "y": -541.979187 - }, - "parameters": { - "param0": 10, - "param1": 30, - "param2": false, - "param3": 0 - }, - "type": "remote", - "widgets": [ - { - "label": "Size", - "linked_widgets": [ - { - "node": "iterate_buffer", - "widget": "size" - }, - { - "node": "2434_8", - "widget": "size" - }, - { - "node": "buffer_2", - "widget": "size" - }, - { - "node": "edge_detect", - "widget": "size" - } - ], - "longdesc": "The resolution used for the operation", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - }, - { - "label": "Iterations", - "linked_widgets": [ - { - "node": "iterate_buffer", - "widget": "iterations" - } - ], - "longdesc": "The number of iterations the jump flood algorithm performs to calculate the distances", - "name": "param1", - "shortdesc": "Iterations", - "type": "linked_control" - }, - { - "label": "Tiled", - "linked_widgets": [ - { - "node": "24282_2", - "widget": "tiled" - }, - { - "node": "6520", - "widget": "tiled" - } - ], - "longdesc": "Controls whether the resulting ditance field will be tiled. Useful for patterns that extend over the texture bounds", - "name": "param2", - "shortdesc": "Tiled", - "type": "linked_control" - }, - { - "label": "Distance", - "linked_widgets": [ - { - "node": "2434_8", - "widget": "distance" - }, - { - "node": "6520", - "widget": "distance" - } - ], - "name": "param3", - "shortdesc": "Distance function", - "type": "linked_control" - } - ] - }, - { - "name": "buffer_2", - "node_position": { - "x": -297.702789, - "y": -348.41391 - }, - "parameters": { - "size": 10 - }, - "type": "buffer", - "version": 1 - }, - { - "name": "tones_step", - "node_position": { - "x": -294.947968, - "y": -258.84549 - }, - "parameters": { - "invert": false, - "value": 0.5, - "width": 0 - }, - "type": "tones_step" - }, - { - "name": "24282_2", - "node_position": { - "x": 114.391708, - "y": -90.765732 - }, - "parameters": { - "tiled": false - }, - "shader_model": { - "code": "vec3 $(name_uv)_in = $in(fract($uv));\nvec3 $(name_uv)_tiled = $(name_uv)_in.xy != vec2(0.0) ? $(name_uv)_in + vec3(floor($uv), 0.0) : $(name_uv)_in;", - "global": "", - "inputs": [ - { - "default": "vec3(1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "Tiling", - "outputs": [ - { - "rgb": "$tiled ? $(name_uv)_tiled : $(name_uv)_in", - "type": "rgb" - } - ], - "parameters": [ - { - "default": false, - "label": "Tiled", - "name": "tiled", - "type": "boolean" - } - ] - }, - "type": "shader" - }, - { - "connections": [ - { - "from": "edge_detect", - "from_port": 0, - "to": "1823", - "to_port": 0 - }, - { - "from": "tones_step", - "from_port": 0, - "to": "edge_detect", - "to_port": 0 - }, - { - "from": "1823", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 0 - }, - { - "from": "2434_8", - "from_port": 0, - "to": "iterate_buffer", - "to_port": 1 - }, - { - "from": "iterate_buffer", - "from_port": 0, - "to": "6520", - "to_port": 0 - }, - { - "from": "24282_2", - "from_port": 0, - "to": "2434_8", - "to_port": 0 - }, - { - "from": "iterate_buffer", - "from_port": 1, - "to": "24282_2", - "to_port": 0 - }, - { - "from": "iterate_buffer", - "from_port": 0, - "to": "2153", - "to_port": 1 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "tones_step", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "2153", - "to_port": 0 - }, - { - "from": "2153", - "from_port": 0, - "to": "11582", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "11582", - "to_port": 2 - }, - { - "from": "11582", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "8064", - "from_port": 0, - "to": "2153", - "to_port": 2 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "8064", - "to_port": 0 - }, - { - "from": "8064", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "6520", - "to_port": 1 - }, - { - "from": "6520", - "from_port": 0, - "to": "11582", - "to_port": 0 - } - ], - "label": "Dilate 2", - "longdesc": "", - "name": "graph_3", - "node_position": { - "x": 515.555786, - "y": -545.049744 - }, - "nodes": [ - { - "name": "iterate_buffer", - "node_position": { - "x": 64.900002, - "y": -259.215881 - }, - "parameters": { - "filter": false, - "iterations": 30, - "mipmap": false, - "size": 9 - }, - "seed_value": 29168, - "type": "iterate_buffer" - }, - { - "name": "2434_8", - "node_position": { - "x": 102.099998, - "y": 15.367363 - }, - "parameters": { - "distance": 0, - "size": 9 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(-1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "vec3 $(name)_jump_flood(vec2 uv, float size) {\n\tivec2 int_uv = ivec2(uv * size);\n\tfloat best_distance = 9999.9;\n\tvec2 best_coord;\n\tfloat iter = $in(uv).b;\n\titer += 0.01;\n\tfloat step_width = size / 4.0 / (iter * 100.0);\n\t\n\tfor (int x = -1; x <= 1; x++) {\n\t\tfor (int y = -1; y <= 1; y++) {\n\t\t\tivec2 offsetUV = int_uv + ivec2(x, y) * int(step_width);\n\t\t\tvec2 float_uv = vec2(offsetUV) / size;\n\t\t\tvec2 offset_pos = $in(float_uv).rg;\n\t\t\t\n\t\t\tif (offset_pos.x != 0.0 && offset_pos.y != 0.0) {\n\t\t\t\tvec2 diff = offset_pos - uv;\n\t\t\t\t//float dist = dot(diff, diff);\n\t\t\t\t//float dist = abs(diff.x) + abs(diff.y);\n\t\t\t\t//float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);\n\t\t\t\t$distance\n\t\t\t\tif (dist < best_distance) {\n\t\t\t\t\tbest_distance = dist;\n\t\t\t\t\tbest_coord = offset_pos;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn vec3(best_coord, iter);\n}", - "name": "Jump Flood", - "outputs": [ - { - "rgb": "$(name)_jump_flood($uv, $size)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 10, - "first": 0, - "label": "", - "last": 13, - "name": "size", - "type": "size" - }, - { - "default": 2, - "label": "", - "name": "distance", - "type": "enum", - "values": [ - { - "name": "Euclidean", - "value": "float dist = dot(diff, diff);" - }, - { - "name": "Manhattan", - "value": "float dist = abs(diff.x) + abs(diff.y);" - }, - { - "name": "Chebyshev", - "value": "float dist = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" - } - ] - } - ] - }, - "type": "shader" - }, - { - "name": "1823", - "node_position": { - "x": -269.899872, - "y": -17.741766 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "1.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "Mask to UV Mask", - "outputs": [ - { - "rgb": "$in($uv) < .5 ? vec3(0.0) : vec3($uv, 0.0)", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "edge_detect", - "node_position": { - "x": -286.951447, - "y": -137.078964 - }, - "parameters": { - "size": 9, - "threshold": 0.4, - "width": 1 - }, - "type": "edge_detect" - }, - { - "name": "6520", - "node_position": { - "x": 347.356567, - "y": -346.449127 - }, - "parameters": { - "distance": 0, - "length": 0.1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - }, - { - "default": "0.0", - "function": true, - "label": "", - "name": "mask", - "type": "f" - } - ], - "instance": "float $(name)_distance(vec2 uv, float length) {\n\tvec2 custom_uv = $in(fract(uv)).xy;\n\tvec2 diff = custom_uv != vec2(0.0) ? custom_uv - fract(uv) : vec2(1.0);\n\t//float distance = length(diff);\n\t//float distance = abs(diff.x) + abs(diff.y);\n\t//float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);\n\t$distance\n\tif (length >= 0.0) {\n\t\treturn $mask(uv) < 0.5 ? clamp(1.0 - (distance / length), 0.0, 1.0) : 1.0;\n\t} else {\n\t\treturn $mask(uv) > 0.5 ? clamp((distance / -length), 0.0, 1.0) : 0.0;\n\t}\n}", - "name": "Calculate Distance", - "outputs": [ - { - "f": "$(name)_distance($uv, $length)", - "type": "f" - } - ], - "parameters": [ - { - "control": "None", - "default": 0.1, - "label": "Length", - "max": 1, - "min": -1, - "name": "length", - "step": 0.01, - "type": "float" - }, - { - "default": 2, - "label": "", - "name": "distance", - "type": "enum", - "values": [ - { - "name": "Euclidean", - "value": "float distance = length(diff);" - }, - { - "name": "Manhattan", - "value": "float distance = abs(diff.x) + abs(diff.y);" - }, - { - "name": "Chebyshev", - "value": "float distance = abs(diff.x) > abs(diff.y) ? abs(diff.x) : abs(diff.y);" - } - ] - } - ] - }, - "type": "shader" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -793.451477, - "y": -236.812195 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "The greyscale mask to be converted", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - }, - { - "group_size": 0, - "longdesc": "", - "name": "source", - "shortdesc": "Source", - "type": "rgb" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 885.056335, - "y": -247.896317 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "longdesc": "Shows the dilated image", - "name": "out", - "shortdesc": "Output", - "type": "rgb" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": 61.520477, - "y": -639.339172 - }, - "parameters": { - "param0": 9, - "param1": 0.1, - "param2": 0, - "param3": 0, - "param4": 30 - }, - "type": "remote", - "widgets": [ - { - "label": "", - "linked_widgets": [ - { - "node": "iterate_buffer", - "widget": "size" - }, - { - "node": "2434_8", - "widget": "size" - }, - { - "node": "buffer_2", - "widget": "size" - }, - { - "node": "edge_detect", - "widget": "size" - } - ], - "longdesc": "The resolution of the input images", - "name": "param0", - "shortdesc": "Size", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "6520", - "widget": "length" - } - ], - "longdesc": "The length of the dilate effect", - "name": "param1", - "shortdesc": "Length", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "11582", - "widget": "fill" - } - ], - "longdesc": "0 to generate a gradient to black while dilating, 1 to fill with input color", - "name": "param2", - "shortdesc": "Fill", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "2434_8", - "widget": "distance" - }, - { - "node": "6520", - "widget": "distance" - } - ], - "name": "param3", - "shortdesc": "Distance Function", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "iterate_buffer", - "widget": "iterations" - } - ], - "longdesc": "The number of iterations the jump flood algorithm performs to calculate the distances", - "name": "param4", - "shortdesc": "Iterations", - "type": "linked_control" - } - ] - }, - { - "name": "buffer_2", - "node_position": { - "x": -294.502808, - "y": -340.816589 - }, - "parameters": { - "size": 9 - }, - "type": "buffer", - "version": 1 - }, - { - "name": "tones_step", - "node_position": { - "x": -285.347992, - "y": -253.248215 - }, - "parameters": { - "invert": false, - "value": 0.5, - "width": 0 - }, - "type": "tones_step" - }, - { - "name": "24282_2", - "node_position": { - "x": 109.591705, - "y": -88.567284 - }, - "parameters": { - "tiled": true - }, - "shader_model": { - "code": "vec3 $(name_uv)_in = $in(fract($uv));\nvec3 $(name_uv)_tiled = $(name_uv)_in.xy != vec2(0.0) ? $(name_uv)_in + vec3(floor($uv), 0.0) : $(name_uv)_in;", - "global": "", - "inputs": [ - { - "default": "vec3(1.0)", - "function": true, - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "Tiling", - "outputs": [ - { - "rgb": "$tiled ? $(name_uv)_tiled : $(name_uv)_in", - "type": "rgb" - } - ], - "parameters": [ - { - "default": false, - "label": "Tiled", - "name": "tiled", - "type": "boolean" - } - ] - }, - "type": "shader" - }, - { - "name": "2153", - "node_position": { - "x": 368.85202, - "y": -157.100906 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(1.0)", - "label": "Source", - "name": "source", - "type": "rgb" - }, - { - "default": "$uv", - "label": "Custom UV", - "name": "custom_uv", - "type": "rgb" - }, - { - "default": "0.0", - "label": "Mask", - "name": "mask", - "type": "f" - } - ], - "instance": "", - "name": "Dilate UV", - "outputs": [ - { - "rgb": "$mask($uv) < 0.5 ? $source($custom_uv($uv).xy) : $source($uv)", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "11582", - "node_position": { - "x": 609.343445, - "y": -239.746399 - }, - "parameters": { - "fill": 0 - }, - "shader_model": { - "code": "float $(name_uv)_dist = $distance($uv);\nvec3 $(name_uv)_color = mix($source(fract($uv)), $fill_raw(fract($uv)), float( $(name_uv)_dist != 0.0 ) );\nvec3 $(name_uv)_mix = mix($(name_uv)_color * $(name_uv)_dist, $(name_uv)_color, $fill);", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "Distance", - "name": "distance", - "type": "f" - }, - { - "default": "vec3(1.0)", - "function": true, - "label": "Fill Raw", - "name": "fill_raw", - "type": "rgb" - }, - { - "default": "vec3(1.0)", - "function": true, - "label": "Source", - "name": "source", - "type": "rgb" - } - ], - "instance": "", - "name": "Dilate Combine", - "outputs": [ - { - "rgb": "$(name_uv)_mix", - "type": "rgb" - } - ], - "parameters": [ - { - "control": "None", - "default": 0, - "label": "Fill", - "max": 1, - "min": 0, - "name": "fill", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "8064", - "node_position": { - "x": -282.533325, - "y": -433.011169 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "Default Value", - "outputs": [ - { - "rgb": "$in($uv)", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - } - ], - "parameters": { - "param0": 9, - "param1": 0.1, - "param2": 0, - "param3": 0, - "param4": 30 - }, - "shortdesc": "", - "type": "graph" - } - ], - "parameters": { - "param0": 10, - "param1": 30, - "param2": false, - "param3": 0 - }, - "shortdesc": "", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/sdannularshape.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/sdannularshape.mmg deleted file mode 100644 index 527fa92e..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/sdannularshape.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "sdannularshape", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "r": 0.1, - "ripples": 1 - }, - "shader_model": { - "code": "", - "global": "float sdRipples(float d, float w, int r) {\n\tfor (int i = 0; i < r; ++i) {\n\t\td = abs(d)-w;\n\t}\n\treturn d;\n}\n", - "inputs": [ - { - "default": "0.0", - "label": "", - "longdesc": "The input shape, defined as a signed distance function", - "name": "in", - "shortdesc": "Input", - "type": "sdf2d" - } - ], - "instance": "", - "longdesc": "Creates an annular shape from a shape described as a signed distance function", - "name": "sdAnnularShape", - "outputs": [ - { - "longdesc": "The generated layered shape", - "sdf2d": "sdRipples($in($uv), $r, int($ripples))", - "shortdesc": "Output", - "type": "sdf2d" - } - ], - "parameters": [ - { - "control": "None", - "default": 0, - "label": "Width", - "longdesc": "The width of each generated ripple", - "max": 1, - "min": 0, - "name": "r", - "shortdesc": "Width", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Ripples", - "longdesc": "The number of generated ripples", - "max": 16, - "min": 0, - "name": "ripples", - "shortdesc": "Ripples", - "step": 1, - "type": "float" - } - ], - "shortdesc": "sdAnnularShape" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/shear.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/shear.mmg deleted file mode 100644 index c80f5b8c..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/shear.mmg +++ /dev/null @@ -1,83 +0,0 @@ -{ - "name": "shear", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "amount": 0, - "center": 0, - "direction": 1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(1.0)", - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Performs a shear stress transform on its input", - "name": "Shear", - "outputs": [ - { - "longdesc": "Shows the transformed image", - "rgba": "$in($uv+$amount*($uv.yx-vec2($center))*vec2($direction))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 1, - "label": "", - "longdesc": "The direction of the shear transform (horizontal or vertical)", - "name": "direction", - "shortdesc": "Direction", - "type": "enum", - "values": [ - { - "name": "Horizontal", - "value": "1.0, 0.0" - }, - { - "name": "Vertical", - "value": "0.0, 1.0" - } - ] - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The amount of the transform", - "max": 1, - "min": -1, - "name": "amount", - "shortdesc": "Amount", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The position of the shear center", - "max": 1, - "min": 0, - "name": "center", - "shortdesc": "Center", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Shear" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter.mmg deleted file mode 100644 index fe3742a9..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter.mmg +++ /dev/null @@ -1,162 +0,0 @@ -{ - "name": "splatter", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 25, - "rotate": 0, - "scale": 0, - "scale_x": 1, - "scale_y": 1, - "select_inputs": 0, - "value": 0 - }, - "shader_model": { - "code": "vec4 $(name_uv)_rch = splatter_$(name)($uv, int($count), vec2(float($seed)));", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The input image or atlas of 4 or 16 input images", - "name": "in", - "shortdesc": "Input", - "type": "f" - }, - { - "default": "1.0", - "function": true, - "label": "", - "longdesc": "The mask applied to the pattern", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\trc1 = rand3(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tvec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\tif (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\tc = max(c, c1);\n\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}\n", - "longdesc": "Spreads several occurences of an input image randomly.", - "name": "Splatter", - "outputs": [ - { - "f": "$(name_uv)_rch.a", - "longdesc": "Shows the generated pattern", - "shortdesc": "Output", - "type": "f" - }, - { - "longdesc": "Shows a random color for each instance of the input image", - "rgb": "$(name_uv)_rch.rgb", - "shortdesc": "Instance map", - "type": "rgb" - } - ], - "parameters": [ - { - "control": "None", - "default": 10, - "label": "Count", - "longdesc": "The number of occurences of the input image", - "max": 100, - "min": 1, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "default": 0, - "label": "Inputs", - "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", - "name": "select_inputs", - "shortdesc": "Input", - "type": "enum", - "values": [ - { - "name": "1", - "value": " " - }, - { - "name": "4", - "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" - }, - { - "name": "16", - "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" - } - ] - }, - { - "control": "None", - "default": 1, - "label": "Scale X", - "longdesc": "The scale of input images on the X axis", - "max": 2, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Scale Y", - "longdesc": "The scale of input images on the Y axis", - "max": 2, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Rotate", - "longdesc": "The random rotation applied to each image instance", - "max": 180, - "min": 0, - "name": "rotate", - "shortdesc": "RndRotate", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Scale", - "longdesc": "The random scale applied to each image instance", - "max": 1, - "min": 0, - "name": "scale", - "shortdesc": "RndScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Rnd Value", - "longdesc": "The random greyscale value applied to each image instance", - "max": 1, - "min": 0, - "name": "value", - "shortdesc": "RndValue", - "step": 0.01, - "type": "float" - }, - { - "default": false, - "label": "Variations", - "longdesc": "Check to splat variations of the input", - "name": "variations", - "shortdesc": "Variations", - "type": "boolean" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter_color.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter_color.mmg deleted file mode 100644 index 77525b32..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/splatter_color.mmg +++ /dev/null @@ -1,156 +0,0 @@ -{ - "name": "splatter_color", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "count": 25, - "opacity": 0, - "rotate": 0, - "scale": 0, - "scale_x": 1, - "scale_y": 1, - "select_inputs": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4(0.0, 0.0, 0.0, 0.0)", - "function": true, - "label": "", - "longdesc": "The input image or atlas of 4 or 16 input images", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "1.0", - "function": true, - "label": "", - "longdesc": "The mask applied to the pattern", - "name": "mask", - "shortdesc": "Mask", - "type": "f" - } - ], - "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tvec4 c = vec4(0.0);\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\tfloat mask = $mask(fract(seed+vec2(0.5)));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\tpv += vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$select_inputs\n\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\tc = mix(c, n, na);\n\t\t}\n\t}\n\treturn c;\n}\n", - "longdesc": "Spreads several occurences of an input image randomly.", - "name": "Color Splatter", - "outputs": [ - { - "longdesc": "Shows the generated pattern", - "rgba": "splatter_$(name)($uv, int($count), vec2(float($seed)))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "None", - "default": 10, - "label": "Count", - "longdesc": "The number of occurences of the input image", - "max": 100, - "min": 1, - "name": "count", - "shortdesc": "Count", - "step": 1, - "type": "float" - }, - { - "default": 0, - "label": "Inputs", - "longdesc": "The input type of the node:\n- 1: single image\n- 4: atlas of 4 images\n- 16: atlas of 16 images\nAtlases can be created using the Tile2x2 node.", - "name": "select_inputs", - "shortdesc": "Input", - "type": "enum", - "values": [ - { - "name": "1", - "value": " " - }, - { - "name": "4", - "value": "pv = clamp(0.5*(pv+floor(rand2(seed)*2.0)), vec2(0.0), vec2(1.0));" - }, - { - "name": "16", - "value": "pv = clamp(0.25*(pv+floor(rand2(seed)*4.0)), vec2(0.0), vec2(1.0));" - } - ] - }, - { - "control": "None", - "default": 1, - "label": "Scale X", - "longdesc": "The scale of input images on the X axis", - "max": 2, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 1, - "label": "Scale Y", - "longdesc": "The scale of input images on the Y axis", - "max": 2, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Rotate", - "longdesc": "The random rotation applied to each image instance", - "max": 180, - "min": 0, - "name": "rotate", - "shortdesc": "RndRotate", - "step": 0.1, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Rnd Scale", - "longdesc": "The random scale applied to each image instance", - "max": 1, - "min": 0, - "name": "scale", - "shortdesc": "RndScale", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0.5, - "label": "Rnd Opacity", - "longdesc": "The random opacity applied to each image instance", - "max": 1, - "min": 0, - "name": "opacity", - "shortdesc": "RndOpacity", - "step": 0.01, - "type": "float" - }, - { - "default": false, - "label": "Variations", - "longdesc": "Check to splat variations of the input", - "name": "variations", - "shortdesc": "Variations", - "type": "boolean" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform.mmg deleted file mode 100644 index cf2ef72b..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform.mmg +++ /dev/null @@ -1,151 +0,0 @@ -{ - "name": "transform", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "repeat": false, - "rotate": 0, - "scale_x": 1, - "scale_y": 1, - "translate_x": 0, - "translate_y": 0 - }, - "shader_model": { - "code": "", - "longdesc": "Translates, rotates and scales its input", - "global": "vec2 transform(vec2 uv, vec2 translate, float rotate, vec2 scale, bool repeat) {\n \tvec2 rv;\n\tuv -= translate;\n\tuv -= vec2(0.5);\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv /= scale;\n\trv += vec2(0.5);\n if (repeat) {\n\t\treturn fract(rv);\n\t} else {\n\t\treturn clamp(rv, vec2(0.0), vec2(1.0));\n\t}\t\n}", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image to be transformed", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for translation along the X axis", - "name": "tx", - "shortdesc": "TranslateMap.x", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for translation along the Y axis", - "name": "ty", - "shortdesc": "TranslateMap.y", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for rotation", - "name": "r", - "shortdesc": "RotateMap", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for scaling along the X axis", - "name": "sx", - "shortdesc": "ScaleMap.x", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for scaling along the Y axis", - "name": "sy", - "shortdesc": "ScaleMap.y", - "type": "f" - } - ], - "instance": "", - "name": "Transform", - "outputs": [ - { - "longdesc": "Shows the transformed image", - "rgba": "$i(transform($uv, vec2($translate_x*(2.0*$tx($uv)-1.0), $translate_y*(2.0*$ty($uv)-1.0)), $rotate*0.01745329251*(2.0*$r($uv)-1.0), vec2($scale_x*(2.0*$sx($uv)-1.0), $scale_y*(2.0*$sy($uv)-1.0)), $repeat))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "2:Translate X:", - "longdesc": "The translation along the X axis", - "max": 1, - "min": -1, - "name": "translate_x", - "shortdesc": "Translate.x", - "step": 0.005, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Translate Y:", - "longdesc": "The translation along the Y axis", - "max": 1, - "min": -1, - "name": "translate_y", - "shortdesc": "Translate.y", - "step": 0.005, - "type": "float" - }, - { - "control": "Radius1.a", - "default": 0, - "label": "Rotate:", - "longdesc": "The rotation angle", - "max": 720, - "min": -720, - "name": "rotate", - "shortdesc": "Rotate", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.x", - "default": 1, - "label": "Scale X:", - "longdesc": "The scaling factor along the X axis", - "max": 50, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.y", - "default": 1, - "label": "Scale Y:", - "longdesc": "The scaling factor along the Y axis", - "max": 50, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.005, - "type": "float" - }, - { - "default": false, - "label": "Repeat:", - "longdesc": "Repeat the input if checked, clamps otherwise", - "name": "repeat", - "shortdesc": "Repeat", - "type": "boolean" - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform2.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform2.mmg deleted file mode 100644 index e9188662..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/transform2.mmg +++ /dev/null @@ -1,165 +0,0 @@ -{ - "name": "transform2", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "mode": 0, - "rotate": 0, - "scale_x": 1, - "scale_y": 1, - "translate_x": 0, - "translate_y": 0 - }, - "shader_model": { - "code": "", - "longdesc": "Translates, rotates and scales its input", - "global": "vec2 transform2_clamp(vec2 uv) {\n\treturn clamp(uv, vec2(0.0), vec2(1.0));\n}\n\nvec2 transform2(vec2 uv, vec2 translate, float rotate, vec2 scale) {\n \tvec2 rv;\n\tuv -= translate;\n\tuv -= vec2(0.5);\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv /= scale;\n\trv += vec2(0.5);\n\treturn rv;\t\n}", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image to be transformed", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for translation along the X axis", - "name": "tx", - "shortdesc": "TranslateMap.x", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for translation along the Y axis", - "name": "ty", - "shortdesc": "TranslateMap.y", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for rotation", - "name": "r", - "shortdesc": "RotateMap", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for scaling along the X axis", - "name": "sx", - "shortdesc": "ScaleMap.x", - "type": "f" - }, - { - "default": "1.0", - "label": "", - "longdesc": "An optional map for scaling along the Y axis", - "name": "sy", - "shortdesc": "ScaleMap.y", - "type": "f" - } - ], - "instance": "", - "name": "Transform", - "outputs": [ - { - "longdesc": "Shows the transformed image", - "rgba": "$i($mode(transform2($uv, vec2($translate_x*(2.0*$tx($uv)-1.0), $translate_y*(2.0*$ty($uv)-1.0)), $rotate*0.01745329251*(2.0*$r($uv)-1.0), vec2($scale_x*(2.0*$sx($uv)-1.0), $scale_y*(2.0*$sy($uv)-1.0)))))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "2:Translate X:", - "longdesc": "The translation along the X axis", - "max": 1, - "min": -1, - "name": "translate_x", - "shortdesc": "Translate.x", - "step": 0.005, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Translate Y:", - "longdesc": "The translation along the Y axis", - "max": 1, - "min": -1, - "name": "translate_y", - "shortdesc": "Translate.y", - "step": 0.005, - "type": "float" - }, - { - "control": "Radius1.a", - "default": 0, - "label": "Rotate:", - "longdesc": "The rotation angle", - "max": 720, - "min": -720, - "name": "rotate", - "shortdesc": "Rotate", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.x", - "default": 1, - "label": "Scale X:", - "longdesc": "The scaling factor along the X axis", - "max": 50, - "min": 0, - "name": "scale_x", - "shortdesc": "Scale.x", - "step": 0.005, - "type": "float" - }, - { - "control": "Scale1.y", - "default": 1, - "label": "Scale Y:", - "longdesc": "The scaling factor along the Y axis", - "max": 50, - "min": 0, - "name": "scale_y", - "shortdesc": "Scale.y", - "step": 0.005, - "type": "float" - }, - { - "default": 0, - "label": "Mode", - "longdesc": "Defines the behavior beyond the limits or the input image:\n- Clamp stretches the edges\n- Repeat tiles the input\n- Extend shows parts of the input that are beyond the edges", - "name": "mode", - "shortdesc": "Mode", - "type": "enum", - "values": [ - { - "name": "Clamp", - "value": "transform2_clamp" - }, - { - "name": "Repeat", - "value": "fract" - }, - { - "name": "Extend", - "value": "" - } - ] - } - ] - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/translate.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/translate.mmg deleted file mode 100644 index 4c612c4f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/translate.mmg +++ /dev/null @@ -1,64 +0,0 @@ -{ - "name": "translate", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "translate_x": 0, - "translate_y": 0 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "longdesc": "The input image", - "name": "i", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Translates its input", - "name": "Translate", - "outputs": [ - { - "longdesc": "Shows the translated image", - "rgba": "$i($uv-vec2($translate_x, $translate_y))", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "control": "P1.x", - "default": 0, - "label": "Translate X:", - "longdesc": "The translation along the X axis", - "max": 1, - "min": -1, - "name": "translate_x", - "shortdesc": "Translate.x", - "step": 0.005, - "type": "float" - }, - { - "control": "P1.y", - "default": 0, - "label": "Translate Y:", - "longdesc": "The translation along the Y axis", - "max": 1, - "min": -1, - "name": "translate_y", - "shortdesc": "Translate.y", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Translate" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_color.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_color.mmg deleted file mode 100644 index f60644f7..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_color.mmg +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "variations_color", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec3(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgb" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "longdesc": "Shows a variation of the input", - "rgb": "$in.variation($uv, $seed)", - "shortdesc": "Output1", - "type": "rgb" - }, - { - "longdesc": "Shows a variation of the input", - "rgb": "$in.variation($uv, $seed+0.1)", - "shortdesc": "Output2", - "type": "rgb" - }, - { - "longdesc": "Shows a variation of the input", - "rgb": "$in.variation($uv, $seed+0.2)", - "shortdesc": "Output3", - "type": "rgb" - }, - { - "longdesc": "Shows a variation of the input", - "rgb": "$in.variation($uv, $seed+0.3)", - "shortdesc": "Output4", - "type": "rgb" - }, - { - "longdesc": "Shows a variation of the input", - "rgb": "$in.variation($uv, $seed+0.4)", - "shortdesc": "Output5", - "type": "rgb" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_greyscale.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_greyscale.mmg deleted file mode 100644 index e5eeec8f..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_greyscale.mmg +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "variations_greyscale", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "f" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "f": "$in.variation($uv, $seed)", - "longdesc": "Shows a variation of the input", - "shortdesc": "Output1", - "type": "f" - }, - { - "f": "$in.variation($uv, $seed+0.1)", - "longdesc": "Shows a variation of the input", - "shortdesc": "Output2", - "type": "f" - }, - { - "f": "$in.variation($uv, $seed+0.2)", - "longdesc": "Shows a variation of the input", - "shortdesc": "Output3", - "type": "f" - }, - { - "f": "$in.variation($uv, $seed+0.3)", - "longdesc": "Shows a variation of the input", - "shortdesc": "Output4", - "type": "f" - }, - { - "f": "$in.variation($uv, $seed+0.4)", - "longdesc": "Shows a variation of the input", - "shortdesc": "Output5", - "type": "f" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_rgba.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_rgba.mmg deleted file mode 100644 index 05946dc9..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_rgba.mmg +++ /dev/null @@ -1,65 +0,0 @@ -{ - "name": "variations_rgba", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec4(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "longdesc": "Shows a variation of the input", - "rgba": "$in.variation($uv, $seed)", - "shortdesc": "Output1", - "type": "rgba" - }, - { - "longdesc": "Shows a variation of the input", - "rgba": "$in.variation($uv, $seed+0.1)", - "shortdesc": "Output2", - "type": "rgba" - }, - { - "longdesc": "Shows a variation of the input", - "rgba": "$in.variation($uv, $seed+0.2)", - "shortdesc": "Output3", - "type": "rgba" - }, - { - "longdesc": "Shows a variation of the input", - "rgba": "$in.variation($uv, $seed+0.3)", - "shortdesc": "Output4", - "type": "rgba" - }, - { - "longdesc": "Shows a variation of the input", - "rgba": "$in.variation($uv, $seed+0.4)", - "shortdesc": "Output5", - "type": "rgba" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf2d.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf2d.mmg deleted file mode 100644 index 84cf68a1..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf2d.mmg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "variations_sdf2d", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "seed": 0.660085, - "seed_locked": false, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec4(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "sdf2d" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "longdesc": "Shows a variation of the input", - "sdf2d": "$in.variation($uv, $seed)", - "shortdesc": "Output1", - "type": "sdf2d" - }, - { - "longdesc": "Shows a variation of the input", - "sdf2d": "$in.variation($uv, $seed+0.1)", - "shortdesc": "Output2", - "type": "sdf2d" - }, - { - "longdesc": "Shows a variation of the input", - "sdf2d": "$in.variation($uv, $seed+0.2)", - "shortdesc": "Output3", - "type": "sdf2d" - }, - { - "longdesc": "Shows a variation of the input", - "sdf2d": "$in.variation($uv, $seed+0.3)", - "shortdesc": "Output4", - "type": "sdf2d" - }, - { - "longdesc": "Shows a variation of the input", - "sdf2d": "$in.variation($uv, $seed+0.4)", - "shortdesc": "Output5", - "type": "sdf2d" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf3dc.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf3dc.mmg deleted file mode 100644 index 30f940fd..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_sdf3dc.mmg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "variations_sdf3dc", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "seed": 0.846412, - "seed_locked": false, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec4(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "sdf3dc" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "longdesc": "Shows a variation of the input", - "sdf3dc": "$in.variation($uv, $seed)", - "shortdesc": "Output1", - "type": "sdf3dc" - }, - { - "longdesc": "Shows a variation of the input", - "sdf3dc": "$in.variation($uv, $seed+0.1)", - "shortdesc": "Output2", - "type": "sdf3dc" - }, - { - "longdesc": "Shows a variation of the input", - "sdf3dc": "$in.variation($uv, $seed+0.2)", - "shortdesc": "Output3", - "type": "sdf3dc" - }, - { - "longdesc": "Shows a variation of the input", - "sdf3dc": "$in.variation($uv, $seed+0.3)", - "shortdesc": "Output4", - "type": "sdf3dc" - }, - { - "longdesc": "Shows a variation of the input", - "sdf3dc": "$in.variation($uv, $seed+0.4)", - "shortdesc": "Output5", - "type": "sdf3dc" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_tex3d.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_tex3d.mmg deleted file mode 100644 index a1482428..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/variations_tex3d.mmg +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "variations_tex3d", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - - }, - "seed": 0.660085, - "seed_locked": false, - "shader_model": { - "code": "", - "global": "vec2 rotate(vec2 uv, vec2 center, float rotate) {\n \tvec2 rv;\n\tuv -= center;\n\trv.x = cos(rotate)*uv.x + sin(rotate)*uv.y;\n\trv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y;\n\trv += center;\n return rv;\t\n}", - "inputs": [ - { - "default": "vec4(0.0)", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "tex3d" - } - ], - "instance": "", - "longdesc": "Generates variations for its input", - "name": "Variations", - "outputs": [ - { - "longdesc": "Shows a variation of the input", - "shortdesc": "Output1", - "tex3d": "$in.variation($uv, $seed)", - "type": "tex3d" - }, - { - "longdesc": "Shows a variation of the input", - "shortdesc": "Output2", - "tex3d": "$in.variation($uv, $seed+0.1)", - "type": "tex3d" - }, - { - "longdesc": "Shows a variation of the input", - "shortdesc": "Output3", - "tex3d": "$in.variation($uv, $seed+0.2)", - "type": "tex3d" - }, - { - "longdesc": "Shows a variation of the input", - "shortdesc": "Output4", - "tex3d": "$in.variation($uv, $seed+0.3)", - "type": "tex3d" - }, - { - "longdesc": "Shows a variation of the input", - "shortdesc": "Output5", - "tex3d": "$in.variation($uv, $seed+0.4)", - "type": "tex3d" - } - ], - "parameters": [ - - ], - "shortdesc": "Variations" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp.mmg deleted file mode 100644 index dea232c4..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp.mmg +++ /dev/null @@ -1,92 +0,0 @@ -{ - "name": "warp", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "amount": 0.1, - "eps": 0.1, - "mode": 0 - }, - "shader_model": { - "code": "vec2 $(name_uv)_slope = $(name)_slope($uv, $eps);\nvec2 $(name_uv)_warp = $mode;", - "global": "", - "inputs": [ - { - "default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)", - "label": "", - "longdesc": "The input image to be warped", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The height map whose slopes are used to deform the input", - "name": "d", - "shortdesc": "Height map", - "type": "f" - } - ], - "instance": "vec2 $(name)_slope(vec2 uv, float epsilon) {\n\treturn vec2($d(fract(uv+vec2(epsilon, 0.0)))-$d(fract(uv-vec2(epsilon, 0.0))), $d(fract(uv+vec2(0.0, epsilon)))-$d(fract(uv-vec2(0.0, epsilon))));\n}", - "longdesc": "Warps its input according to a heightmap", - "name": "Warp", - "outputs": [ - { - "longdesc": "Shows the warped image", - "rgba": "$in($uv+$amount*$(name_uv)_warp)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "longdesc": "Both warp modes extract their direction from the height map slopes:\n- Slope warp intensity only depends on the slope\n- Distance to top warp intensity depends on the slope and the distance to the top, and can be used to create mosaic-like patterns\n\nA Transform node with translate maps can produce effects similar to Slope Warp and is generally faster.", - "name": "mode", - "shortdesc": "Mode", - "type": "enum", - "values": [ - { - "name": "Slope", - "value": "$(name_uv)_slope" - }, - { - "name": "Distance to top", - "value": "$(name_uv)_slope*(1.0-$d($uv))" - } - ] - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The strength of the warp effect", - "max": 1, - "min": 0, - "name": "amount", - "shortdesc": "Strength", - "step": 0.005, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The offset used to measure slopes", - "max": 0.2, - "min": 0.005, - "name": "eps", - "shortdesc": "Epsilon", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Warp" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp2.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp2.mmg deleted file mode 100644 index 97d209a6..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp2.mmg +++ /dev/null @@ -1,79 +0,0 @@ -{ - "name": "warp2", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "amount": 0.05, - "mode": 0 - }, - "shader_model": { - "code": "vec2 $(name_uv)_slope = $(name)_slope($uv);\nvec2 $(name_uv)_warp = $mode;", - "global": "", - "inputs": [ - { - "default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)", - "label": "", - "longdesc": "The input image to be warped", - "name": "in", - "shortdesc": "Input", - "type": "rgba" - }, - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The height map whose slopes are used to deform the input", - "name": "d", - "shortdesc": "Height map", - "type": "f" - } - ], - "instance": "vec2 $(name)_slope(vec2 uv) {\n vec2 e = vec2(0.001, 0.0);\n return 0.5*vec2($d(uv+e)-$d(uv-e), $d(uv+e.yx)-$d(uv-e.yx))/e.x;\n}", - "longdesc": "Warps its input according to a heightmap", - "name": "Warp", - "outputs": [ - { - "longdesc": "Shows the warped image", - "rgba": "$in($uv+$amount*$(name_uv)_warp)", - "shortdesc": "Output", - "type": "rgba" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "longdesc": "Both warp modes extract their direction from the height map slopes:\n- Slope warp intensity only depends on the slope\n- Distance to top warp intensity depends on the slope and the distance to the top, and can be used to create mosaic-like patterns\n\nA Transform node with translate maps can produce effects similar to Slope Warp and is generally faster.", - "name": "mode", - "shortdesc": "Mode", - "type": "enum", - "values": [ - { - "name": "Slope", - "value": "$(name_uv)_slope" - }, - { - "name": "Distance to top", - "value": "$(name_uv)_slope*(1.0-$d($uv))" - } - ] - }, - { - "control": "None", - "default": 0, - "label": "", - "longdesc": "The strength of the warp effect", - "max": 1, - "min": 0, - "name": "amount", - "shortdesc": "Strength", - "step": 0.005, - "type": "float" - } - ], - "shortdesc": "Warp" - }, - "type": "shader" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation.mmg deleted file mode 100644 index 936fb864..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation.mmg +++ /dev/null @@ -1,220 +0,0 @@ -{ - "connections": [ - { - "from": "warp_dilation", - "from_port": 0, - "to": "buffer_5", - "to_port": 0 - }, - { - "from": "buffer_5", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "buffer_6", - "to_port": 0 - }, - { - "from": "buffer_6", - "from_port": 0, - "to": "warp_dilation", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer_7", - "to_port": 0 - }, - { - "from": "buffer_7", - "from_port": 0, - "to": "warp_dilation", - "to_port": 0 - } - ], - "label": "Warp Dilation", - "longdesc": "", - "name": "warp_dilation", - "node_position": { - "x": 0, - "y": 0 - }, - "nodes": [ - { - "name": "buffer_5", - "node_position": { - "x": -387.923584, - "y": -38 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "buffer_6", - "node_position": { - "x": -636.189514, - "y": -90.757477 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "buffer_7", - "node_position": { - "x": -635.189514, - "y": -199.757477 - }, - "parameters": { - "lod": 0, - "size": 9 - }, - "type": "buffer" - }, - { - "name": "warp_dilation", - "node_position": { - "x": -404.125, - "y": -172.25 - }, - "parameters": { - "a": 0, - "d": 0.5, - "mode": 0, - "s": 9 - }, - "type": "warp_dilation_nobuf" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -1127.189453, - "y": -144.691238 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "name": "port1", - "type": "f" - }, - { - "group_size": 0, - "name": "port0", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": -70.923584, - "y": -122.691238 - }, - "parameters": { - - }, - "ports": [ - { - "group_size": 0, - "name": "port0", - "type": "f" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -463.856934, - "y": -398.757477 - }, - "parameters": { - "a": 0, - "d": 0.5, - "mode": 0, - "s": 9 - }, - "type": "remote", - "widgets": [ - { - "label": "Mode", - "linked_widgets": [ - { - "node": "warp_dilation", - "widget": "mode" - } - ], - "name": "mode", - "type": "linked_control" - }, - { - "label": "Resolution", - "linked_widgets": [ - { - "node": "warp_dilation", - "widget": "s" - }, - { - "node": "buffer_7", - "widget": "size" - }, - { - "node": "buffer_6", - "widget": "size" - }, - { - "node": "buffer_5", - "widget": "size" - } - ], - "name": "s", - "type": "linked_control" - }, - { - "label": "Distance", - "linked_widgets": [ - { - "node": "warp_dilation", - "widget": "d" - } - ], - "name": "d", - "type": "linked_control" - }, - { - "label": "Attenuation", - "linked_widgets": [ - { - "node": "warp_dilation", - "widget": "a" - } - ], - "name": "a", - "type": "linked_control" - } - ] - } - ], - "parameters": { - "a": 0, - "d": 0.5, - "mode": 0, - "s": 9 - }, - "shortdesc": "", - "type": "graph" -} \ No newline at end of file diff --git a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation_nobuf.mmg b/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation_nobuf.mmg deleted file mode 100644 index eb756323..00000000 --- a/game/addons/mat_maker_gd/nodes/material_maker_nodes/warp_dilation_nobuf.mmg +++ /dev/null @@ -1,108 +0,0 @@ -{ - "name": "warp_dilation", - "node_position": { - "x": 0, - "y": 0 - }, - "parameters": { - "a": 0, - "d": 0.5, - "mode": 0, - "s": 9 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The input image", - "name": "in", - "shortdesc": "Input", - "type": "f" - }, - { - "default": "0.0", - "function": true, - "label": "", - "longdesc": "The height map whose contours or slopes are followed", - "name": "hm", - "shortdesc": "Height map", - "type": "f" - } - ], - "instance": "vec2 $(name)_slope(vec2 uv, float epsilon) {\n\tfloat dx = $hm(fract(uv+vec2(epsilon, 0.0)))-$hm(fract(uv-vec2(epsilon, 0.0)));\n\tfloat dy = $hm(fract(uv+vec2(0.0, epsilon)))-$hm(fract(uv-vec2(0.0, epsilon)));\n\treturn vec2($mode);\n}\n\nfloat $(name)_dilate(vec2 uv, vec2 slope) {\n\tfloat e = 1.0/$s;\n\tfloat v = 0.0;\n\tfor (float x = 0.0; x <= $d; x += e) {\n\t\tv = max(v, $in(fract(uv))*(1.0-x/$d*$a));\n\t\tuv += e*normalize($(name)_slope(uv, 0.0001));\n\t}\n\treturn v;\n}", - "longdesc": "Dilates its input following the contours or slope of an input heightmap", - "name": "Warp Dilation", - "outputs": [ - { - "f": "$(name)_dilate($uv, normalize($(name)_slope($uv, 0.001)))", - "longdesc": "The dilated image", - "shortdesc": "Output", - "type": "f" - } - ], - "parameters": [ - { - "default": 0, - "label": "Mode", - "longdesc": "The dilate mode (clockwise contour, counter clockwise contour or slope)", - "name": "mode", - "shortdesc": "Mode", - "type": "enum", - "values": [ - { - "name": "Contour (cw)", - "value": "-dy,dx" - }, - { - "name": "Contour (ccw)", - "value": "dy, -dx" - }, - { - "name": "Slope", - "value": "dx,dy" - } - ] - }, - { - "default": 9, - "first": 6, - "label": "Resolution", - "last": 12, - "longdesc": "The resolution at which the contours or slopes are followed (higher values will be more precise but rendering time will be higher)", - "name": "s", - "shortdesc": "Resolution", - "type": "size" - }, - { - "control": "None", - "default": 0.1, - "label": "Distance", - "longdesc": "The distance along which the contours or slopes are followed", - "max": 0.5, - "min": 0, - "name": "d", - "shortdesc": "Distance", - "step": 0.01, - "type": "float" - }, - { - "control": "None", - "default": 0, - "label": "Attenuation", - "longdesc": "The attenuation applied along the path", - "max": 1, - "min": 0, - "name": "a", - "shortdesc": "Attenuation", - "step": 0.01, - "type": "float" - } - ], - "shortdesc": "Warp Dilation" - }, - "type": "shader" -} \ No newline at end of file