mirror of
https://github.com/Relintai/broken_seals.git
synced 2025-01-15 02:01:09 +01:00
Turned a lot more mmg files into comments.
This commit is contained in:
parent
a25d43ae29
commit
8a907bfb6b
533
game/addons/mat_maker_gd/nodes/common/fills.gd
Normal file
533
game/addons/mat_maker_gd/nodes/common/fills.gd
Normal file
@ -0,0 +1,533 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
||||
#----------------------
|
||||
#fill.mmg
|
||||
#Fills areas defined by white outlines of its input
|
||||
|
||||
#{
|
||||
# "connections": [
|
||||
# {
|
||||
# "from": "iterate_buffer",
|
||||
# "from_port": 0,
|
||||
# "to": "gen_outputs",
|
||||
# "to_port": 0
|
||||
# },
|
||||
# {
|
||||
# "from": "iterate_buffer",
|
||||
# "from_port": 1,
|
||||
# "to": "fill_iterate",
|
||||
# "to_port": 0
|
||||
# },
|
||||
# {
|
||||
# "from": "fill_iterate",
|
||||
# "from_port": 0,
|
||||
# "to": "iterate_buffer",
|
||||
# "to_port": 1
|
||||
# },
|
||||
# {
|
||||
# "from": "gen_inputs",
|
||||
# "from_port": 0,
|
||||
# "to": "fill_preprocess",
|
||||
# "to_port": 0
|
||||
# },
|
||||
# {
|
||||
# "from": "fill_preprocess",
|
||||
# "from_port": 0,
|
||||
# "to": "iterate_buffer",
|
||||
# "to_port": 0
|
||||
# }
|
||||
# ],
|
||||
# "nodes": [
|
||||
# {
|
||||
# "name": "iterate_buffer",
|
||||
# "node_position": {
|
||||
# "x": -129.307083,
|
||||
# "y": -370.480591
|
||||
# },
|
||||
# "parameters": {
|
||||
# "iterations": 10,
|
||||
# "size": 8
|
||||
# },
|
||||
# "seed_value": 29168,
|
||||
# "type": "iterate_buffer"
|
||||
# },
|
||||
# {
|
||||
# "name": "gen_inputs",
|
||||
# "node_position": {
|
||||
# "x": -542.307068,
|
||||
# "y": -370.662445
|
||||
# },
|
||||
# "parameters": {
|
||||
#
|
||||
# },
|
||||
# "ports": [
|
||||
# {
|
||||
# "group_size": 0,
|
||||
# "longdesc": "The input image whose white outlines must be filled",
|
||||
# "name": "port0",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "type": "ios"
|
||||
# },
|
||||
# {
|
||||
# "name": "gen_outputs",
|
||||
# "node_position": {
|
||||
# "x": 198.267258,
|
||||
# "y": -362.662445
|
||||
# },
|
||||
# "parameters": {
|
||||
#
|
||||
# },
|
||||
# "ports": [
|
||||
# {
|
||||
# "group_size": 0,
|
||||
# "longdesc": "Generates fill data, to be connected to a fill companion node",
|
||||
# "name": "port0",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "type": "ios"
|
||||
# },
|
||||
# {
|
||||
# "name": "gen_parameters",
|
||||
# "node_position": {
|
||||
# "x": -171.110138,
|
||||
# "y": -541.509705
|
||||
# },
|
||||
# "parameters": {
|
||||
# "param0": 8,
|
||||
# "param1": 10
|
||||
# },
|
||||
# "type": "remote",
|
||||
# "widgets": [
|
||||
# {
|
||||
# "label": "",
|
||||
# "linked_widgets": [
|
||||
# {
|
||||
# "node": "iterate_buffer",
|
||||
# "widget": "size"
|
||||
# },
|
||||
# {
|
||||
# "node": "fill_preprocess",
|
||||
# "widget": "s"
|
||||
# },
|
||||
# {
|
||||
# "node": "fill_iterate",
|
||||
# "widget": "s"
|
||||
# }
|
||||
# ],
|
||||
# "longdesc": "The resolution of the inptu image",
|
||||
# "name": "param0",
|
||||
# "shortdesc": "Size",
|
||||
# "type": "linked_control"
|
||||
# },
|
||||
# {
|
||||
# "label": "",
|
||||
# "linked_widgets": [
|
||||
# {
|
||||
# "node": "iterate_buffer",
|
||||
# "widget": "iterations"
|
||||
# }
|
||||
# ],
|
||||
# "longdesc": "The number of iterations of the algorithm. The optimal value depends a lot on the input image.",
|
||||
# "name": "param1",
|
||||
# "shortdesc": "Iterations",
|
||||
# "type": "linked_control"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "name": "fill_iterate",
|
||||
# "node_position": {
|
||||
# "x": -92.913391,
|
||||
# "y": -290.886963
|
||||
# },
|
||||
# "parameters": {
|
||||
# "s": 8
|
||||
# },
|
||||
# "type": "fill_iterate"
|
||||
# },
|
||||
# {
|
||||
# "name": "fill_preprocess",
|
||||
# "node_position": {
|
||||
# "x": -110.443481,
|
||||
# "y": -427.202026
|
||||
# },
|
||||
# "parameters": {
|
||||
# "s": 8
|
||||
# },
|
||||
# "type": "fill_preprocess"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": {
|
||||
# "param0": 8,
|
||||
# "param1": 10
|
||||
# },
|
||||
# "shortdesc": "Fill",
|
||||
# "type": "graph"
|
||||
#}
|
||||
|
||||
#----------------------
|
||||
#fill_iterate.mmg
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "0.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "name": "in",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "instance": "vec4 $(name)_fill(vec2 uv) {\n\tfloat size = $s;\n\tint iterations = min(int(size), 256);\n\tvec4 color = $in(fract(uv));\n\tif (color.z+color.w < 1.0/size) {\n\t\treturn vec4(0.0);\n\t}\n\tvec2 offsets[8] = { vec2(1.0, 0.0), vec2(-1.0, 0.0), vec2(0.0, 1.0), vec2(0.0, -1.0), vec2(1.0, 1.0), vec2(-1.0, 1.0), vec2(-1.0, 1.0), vec2(-1.0, -1.0) };\n\tfor (int o = 0; o < 8; ++o) {\n\t\tvec2 uv2 = uv;\n\t\tvec2 offset = offsets[o]/size;\n\t\tfor (int i = 1; i < iterations; i += 1) {\n\t\t\tuv2 += offset;\n\t\t\tvec4 color2 = $in(fract(uv2));\n\t\t\tif (color2.z+color2.w == 0.0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvec2 p1 = color.xy+floor(uv-color.xy);\n\t\t\tvec2 p2 = color2.xy+floor(uv2-color2.xy);\n\t\t\tvec2 p = min(p1, p2);\n\t\t\tvec2 s = max(p1+color.zw, p2+color2.zw)-p;\n\t\t\tcolor = mix(vec4(0.0, 0.0, 1.0, 1.0), vec4(fract(p), s), step(s.xyxy, vec4(1.0)));\n\t\t}\n\t}\n\treturn floor(color*size)/size;\n}\n",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "rgba": "$(name)_fill($uv)",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 9,
|
||||
# "first": 6,
|
||||
# "label": "",
|
||||
# "last": 12,
|
||||
# "name": "s",
|
||||
# "type": "size"
|
||||
# }
|
||||
# ]
|
||||
|
||||
#----------------------
|
||||
#fill_preprocess.mmg
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "0.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "name": "in",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "rgba": "flood_fill_preprocess($uv, $in($uv), $s)",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 10,
|
||||
# "first": 0,
|
||||
# "label": "",
|
||||
# "last": 12,
|
||||
# "name": "s",
|
||||
# "type": "size"
|
||||
# }
|
||||
# ]
|
||||
|
||||
|
||||
|
||||
|
||||
#----------------------
|
||||
#fill_to_color.mmg
|
||||
#A fill companion node that fills each area with a color taken from a color map image
|
||||
|
||||
# "code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(1.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The image from which colors are taken",
|
||||
# "name": "map",
|
||||
# "shortdesc": "Color map",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated output image",
|
||||
# "rgba": "mix($edgecolor, $map(fract($(name_uv)_bb.xy+0.5*$(name_uv)_bb.zw)), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": {
|
||||
# "a": 1,
|
||||
# "b": 1,
|
||||
# "g": 1,
|
||||
# "r": 1
|
||||
# },
|
||||
# "label": "Edge Color",
|
||||
# "longdesc": "The color used to draw outlines",
|
||||
# "name": "edgecolor",
|
||||
# "shortdesc": "Outline color",
|
||||
# "type": "color"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#fill_to_position.mmg
|
||||
#A fill companion node that fills each area with a greyscale value that depends on its position
|
||||
|
||||
# "code": "vec2 $(name_uv)_c = fract($in($uv).xy+0.5*$in($uv).zw);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "f": "$axis",
|
||||
# "longdesc": "The generated output image",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 2,
|
||||
# "label": "",
|
||||
# "longdesc": "The position value to be used:\n- X for horizontal axis\n- Y for vertical axis\n- Radial for distance to center",
|
||||
# "name": "axis",
|
||||
# "shortdesc": "Position",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "X",
|
||||
# "value": "$(name_uv)_c.x"
|
||||
# },
|
||||
# {
|
||||
# "name": "Y",
|
||||
# "value": "$(name_uv)_c.y"
|
||||
# },
|
||||
# {
|
||||
# "name": "Radial",
|
||||
# "value": "length($(name_uv)_c-vec2(0.5))"
|
||||
# }
|
||||
# ]
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#fill_to_random_color.mmg
|
||||
#A fill companion node that fills each area with a random color
|
||||
|
||||
# "code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated output image",
|
||||
# "rgb": "mix($edgecolor.rgb, rand3(vec2(float($seed), rand(vec2(rand($(name_uv)_bb.xy), rand($(name_uv)_bb.zw))))), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": {
|
||||
# "a": 1,
|
||||
# "b": 1,
|
||||
# "g": 1,
|
||||
# "r": 1
|
||||
# },
|
||||
# "label": "Edge Color",
|
||||
# "longdesc": "The color used for outlines",
|
||||
# "name": "edgecolor",
|
||||
# "shortdesc": "Outline color",
|
||||
# "type": "color"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#fill_to_random_grey.mmg
|
||||
#A fill companion node that fills each area with a random greyscale value
|
||||
|
||||
# "code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "f": "mix($edgecolor, rand(vec2(float($seed), rand(vec2(rand($(name_uv)_bb.xy), rand($(name_uv)_bb.zw))))), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
# "longdesc": "The generated output image",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 1,
|
||||
# "label": "Edge color",
|
||||
# "longdesc": "The value used for the outlines",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "edgecolor",
|
||||
# "shortdesc": "Outline color",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#fill_to_size.mmg
|
||||
#A fill companion node that fills each area with a greyscale value that depends on its size
|
||||
|
||||
# "code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "f": "$formula",
|
||||
# "longdesc": "The generated output image",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "",
|
||||
# "longdesc": "The size value to be used (area, width, height or maximum between width and height)",
|
||||
# "name": "formula",
|
||||
# "shortdesc": "Size",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Area",
|
||||
# "value": "sqrt($(name_uv)_bb.z*$(name_uv)_bb.w)"
|
||||
# },
|
||||
# {
|
||||
# "name": "Width",
|
||||
# "value": "$(name_uv)_bb.z"
|
||||
# },
|
||||
# {
|
||||
# "name": "Height",
|
||||
# "value": "$(name_uv)_bb.w"
|
||||
# },
|
||||
# {
|
||||
# "name": "max(W, H)",
|
||||
# "value": "max($(name_uv)_bb.z, $(name_uv)_bb.w)"
|
||||
# }
|
||||
# ]
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#fill_to_uv.mmg
|
||||
#A fill companion node that generated an UV map that follows each filled area
|
||||
|
||||
# "code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated output UV map, to be connected to a Custom UV node",
|
||||
# "rgb": "fill_to_uv_$mode($uv, $(name_uv)_bb, float($seed))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "",
|
||||
# "longdesc": "The mode decides how the UVs are layed out on each bounding box:\n- Stretch mode where the UV layout is stretched to the bounding box. \n- Square mode where the UV layout is even and centerered based on the longest axis of the bounding box.",
|
||||
# "name": "mode",
|
||||
# "shortdesc": "Mode",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Stretch",
|
||||
# "value": "stretch"
|
||||
# },
|
||||
# {
|
||||
# "name": "Square",
|
||||
# "value": "square"
|
||||
# }
|
||||
# ]
|
||||
# }
|
||||
# ],
|
||||
|
||||
#vec4 flood_fill_preprocess(vec2 uv, float c, float s) {
|
||||
# if (c > 0.5) {
|
||||
# return vec4(0.0);
|
||||
# } else {
|
||||
# return vec4(floor(uv*s)/s, vec2(1.0/s));
|
||||
# }
|
||||
#}
|
||||
|
||||
#vec3 fill_to_uv_stretch(vec2 coord, vec4 bb, float seed) {
|
||||
# vec2 uv_islands = fract(coord-bb.xy)/bb.zw;
|
||||
# float random_value = rand(vec2(seed)+bb.xy+bb.zw);
|
||||
# return vec3(uv_islands, random_value);
|
||||
#}
|
||||
|
||||
#vec3 fill_to_uv_square(vec2 coord, vec4 bb, float seed) {
|
||||
# vec2 uv_islands;
|
||||
#
|
||||
# if (bb.z > bb.w) {
|
||||
# vec2 adjusted_coord = coord + vec2(0.0, (bb.z - bb.w) / 2.0);
|
||||
# uv_islands = fract(adjusted_coord-bb.xy)/bb.zz;
|
||||
# } else {
|
||||
# vec2 adjusted_coord = coord + vec2((bb.w - bb.z) / 2.0, 0.0);
|
||||
# uv_islands = fract(adjusted_coord-bb.xy)/bb.ww;
|
||||
# }
|
||||
#
|
||||
# float random_value = rand(vec2(seed)+bb.xy+bb.zw);
|
||||
# return vec3(uv_islands, random_value);
|
||||
#}
|
@ -214,6 +214,94 @@ const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
#in, color, default: color(1.0)
|
||||
#size, float, default: 4, min: 2, max: 64, step: 1
|
||||
|
||||
#----------------------
|
||||
#arc_pavement.mmg
|
||||
#Draws a white shape on a black background
|
||||
|
||||
# "code": "vec2 $(name_uv)_uv = fract($uv)*vec2($repeat, -1.0);\nvec2 $(name_uv)_seed;\nvec4 $(name_uv)_ap = arc_pavement($(name_uv)_uv, $rows, $bricks, $(name_uv)_seed);\n",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "f": "pavement($(name_uv)_ap.zw, $bevel, 2.0*$mortar)",
|
||||
# "longdesc": "A greyscale image that shows the bricks pattern",
|
||||
# "shortdesc": "Bricks pattern",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "A random color for each brick",
|
||||
# "rgb": "rand3($(name_uv)_seed)",
|
||||
# "shortdesc": "Random color",
|
||||
# "type": "rgb"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "An UV map output for each brick, to be connected to the Map input of a CustomUV node",
|
||||
# "rgb": "vec3($(name_uv)_ap.zw, 0.0)",
|
||||
# "shortdesc": "Brick UV",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 2,
|
||||
# "label": "Repeat:",
|
||||
# "longdesc": "The number of repetitions of the whole pattern",
|
||||
# "max": 4,
|
||||
# "min": 1,
|
||||
# "name": "repeat",
|
||||
# "shortdesc": "Repeat",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 8,
|
||||
# "label": "Rows:",
|
||||
# "longdesc": "The number of rows",
|
||||
# "max": 16,
|
||||
# "min": 4,
|
||||
# "name": "rows",
|
||||
# "shortdesc": "Rows",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 8,
|
||||
# "label": "Bricks:",
|
||||
# "longdesc": "The number of bricks per row",
|
||||
# "max": 16,
|
||||
# "min": 4,
|
||||
# "name": "bricks",
|
||||
# "shortdesc": "Bricks",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.1,
|
||||
# "label": "Mortar:",
|
||||
# "longdesc": "The width of the space between bricks",
|
||||
# "max": 0.5,
|
||||
# "min": 0,
|
||||
# "name": "mortar",
|
||||
# "shortdesc": "Mortar",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.1,
|
||||
# "label": "Bevel:",
|
||||
# "longdesc": "The width of the edge of each brick",
|
||||
# "max": 0.5,
|
||||
# "min": 0,
|
||||
# "name": "bevel",
|
||||
# "shortdesc": "Bevel",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ]
|
||||
|
||||
enum CombinerAxisType {
|
||||
SINE,
|
||||
TRIANGLE,
|
||||
@ -1009,3 +1097,47 @@ static func bricks_uneven(uv : Vector2, iterations : int, min_size : float, rand
|
||||
|
||||
static func truchet_generic_uv(uv : Vector2, pseed : float) -> Vector2:
|
||||
return Vector2()
|
||||
|
||||
|
||||
#float pavement(vec2 uv, float bevel, float mortar) {\n\t
|
||||
# uv = abs(uv-vec2(0.5));\n\t
|
||||
#
|
||||
# return clamp((0.5*(1.0-mortar)-max(uv.x, uv.y))/max(0.0001, bevel), 0.0, 1.0);
|
||||
#}
|
||||
|
||||
#vec4 arc_pavement(vec2 uv, float acount, float lcount, out vec2 seed) {\n\t
|
||||
# float PI = 3.141592654;\n\t
|
||||
# float radius = (0.5/sqrt(2.0));\n
|
||||
# float uvx = uv.x;\n
|
||||
# uv.x = 0.5*fract(uv.x+0.5)+0.25;\n
|
||||
# float center = (uv.x-0.5)/radius;\n
|
||||
# center *= center;\n
|
||||
# center = floor(acount*(uv.y-radius*sqrt(1.0-center))+0.5)/acount;\n
|
||||
#
|
||||
# vec2 v = uv-vec2(0.5, center);\n
|
||||
# float cornerangle = 0.85/acount+0.25*PI;\n
|
||||
# float acountangle = (PI-2.0*cornerangle)/(lcount+floor(mod(center*acount, 2.0)));\n
|
||||
# float angle = mod(atan(v.y, v.x), 2.0*PI);\n\t
|
||||
#
|
||||
# float base_angle;\n\t
|
||||
# float local_uvy = 0.5+acount*(length(v)-radius)*(1.54-0.71*cos(1.44*(angle-PI*0.5)));\n\t
|
||||
# vec2 local_uv;\n
|
||||
#
|
||||
# if (angle < cornerangle) {\n
|
||||
# base_angle = 0.25*PI;\n\t\t
|
||||
# local_uv = vec2((angle-0.25*PI)/cornerangle*0.38*acount+0.5, 1.0-local_uvy);\n\t\t
|
||||
# seed = vec2(fract(center), 0.0);\n
|
||||
# } else if (angle > PI-cornerangle) {\n
|
||||
# base_angle = 0.75*PI;\n\t\t
|
||||
# local_uv = vec2(local_uvy, 0.5-(0.75*PI-angle)/cornerangle*0.38*acount);\n\t\t
|
||||
# seed = vec2(fract(center), 0.0);\n
|
||||
# } else {\n
|
||||
# base_angle = cornerangle+(floor((angle-cornerangle)/acountangle)+0.5)*acountangle;\n\t\t
|
||||
# local_uv = vec2((angle-base_angle)/acountangle+0.5, 1.0-local_uvy);\n\t\t
|
||||
# seed = vec2(fract(center), base_angle);\n
|
||||
# }\n
|
||||
#
|
||||
# vec2 brick_center = vec2(0.5, center)+radius*vec2(cos(base_angle), sin(base_angle));\n
|
||||
#
|
||||
# return vec4(brick_center.x+uvx-uv.x, brick_center.y, local_uv);\n
|
||||
#}
|
||||
|
979
game/addons/mat_maker_gd/nodes/common/tex3d.gd
Normal file
979
game/addons/mat_maker_gd/nodes/common/tex3d.gd
Normal file
@ -0,0 +1,979 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply.mmg
|
||||
#Applies 3D textures to a rendered 3D signed distance function scene.
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "0.0",
|
||||
# "label": "Height",
|
||||
# "longdesc": "The height map generated by the Render node",
|
||||
# "name": "z",
|
||||
# "shortdesc": "HeightMap",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "0.0",
|
||||
# "label": "Color",
|
||||
# "longdesc": "The color map generated by the Render node",
|
||||
# "name": "c",
|
||||
# "shortdesc": "ColorMap",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(1.0)",
|
||||
# "label": "Texture",
|
||||
# "longdesc": "The 3D texture",
|
||||
# "name": "t",
|
||||
# "shortdesc": "Tex3D",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The textured 3D scene",
|
||||
# "rgb": "$t(vec4($uv, $z($uv), $c($uv)))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply_invuvmap.mmg
|
||||
#This node applies a 3D texture to an object using its inverse UV map.
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(1.0)",
|
||||
# "label": "Texture",
|
||||
# "longdesc": "The input 3D texture",
|
||||
# "name": "t",
|
||||
# "shortdesc": "Texture",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(0.0)",
|
||||
# "label": "Inv. UV Map",
|
||||
# "longdesc": "The inverse UV map of the object",
|
||||
# "name": "map",
|
||||
# "shortdesc": "InvUVMap",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated texture",
|
||||
# "rgb": "$t(vec4($map($uv), 0.0))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_blend.mmg
|
||||
#Blends its 3D texture inputs, using an optional mask
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3($uv.x, 1.0, 1.0)",
|
||||
# "label": "Source1",
|
||||
# "longdesc": "The foreground input",
|
||||
# "name": "s1",
|
||||
# "shortdesc": "Foreground",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(1.0, $uv.y, 1.0)",
|
||||
# "label": "Source2",
|
||||
# "longdesc": "The background input",
|
||||
# "name": "s2",
|
||||
# "shortdesc": "Background",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(1.0)",
|
||||
# "label": "Opacity",
|
||||
# "longdesc": "The optional opacity mask",
|
||||
# "name": "a",
|
||||
# "shortdesc": "Mask",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The 3D texture generated by the blend operation",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "blend3d_$blend_type($s1($uv).rgb, $s2($uv).rgb, $amount*dot($a($uv), vec3(1.0))/3.0)",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "",
|
||||
# "longdesc": "The algorithm used to blend the inputs",
|
||||
# "name": "blend_type",
|
||||
# "shortdesc": "Blend mode",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Normal",
|
||||
# "value": "normal"
|
||||
# },
|
||||
# {
|
||||
# "name": "Multiply",
|
||||
# "value": "multiply"
|
||||
# },
|
||||
# {
|
||||
# "name": "Screen",
|
||||
# "value": "screen"
|
||||
# },
|
||||
# {
|
||||
# "name": "Overlay",
|
||||
# "value": "overlay"
|
||||
# },
|
||||
# {
|
||||
# "name": "Hard Light",
|
||||
# "value": "hard_light"
|
||||
# },
|
||||
# {
|
||||
# "name": "Soft Light",
|
||||
# "value": "soft_light"
|
||||
# },
|
||||
# {
|
||||
# "name": "Burn",
|
||||
# "value": "burn"
|
||||
# },
|
||||
# {
|
||||
# "name": "Dodge",
|
||||
# "value": "dodge"
|
||||
# },
|
||||
# {
|
||||
# "name": "Lighten",
|
||||
# "value": "lighten"
|
||||
# },
|
||||
# {
|
||||
# "name": "Darken",
|
||||
# "value": "darken"
|
||||
# },
|
||||
# {
|
||||
# "name": "Difference",
|
||||
# "value": "difference"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "3:",
|
||||
# "longdesc": "The opacity of the blend operation",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "amount",
|
||||
# "shortdesc": "Opacity",
|
||||
# "step": 0,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_colorize.mmg
|
||||
#Remaps a greyscale 3D texture to a custom gradient
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3($uv.x+0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input greyscale 3D texture",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The remapped color 3D texture ",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "$g(dot($in($uv), vec3(1.0))/3.0).rgb",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "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": "g",
|
||||
# "shortdesc": "Gradient",
|
||||
# "type": "gradient"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_distort.mmg
|
||||
#Distorts its input 3D texture using another 3D texture
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(1.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture to be distorted",
|
||||
# "name": "in1",
|
||||
# "shortdesc": "Input1",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture used to distort Input1",
|
||||
# "name": "in2",
|
||||
# "shortdesc": "Input2",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The distorted 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "$in1(vec4($uv.xyz+($in2($uv)*$Distort*0.5-0.5), 0.0))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Distort",
|
||||
# "longdesc": "The strength of the distort effect",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "Distort",
|
||||
# "shortdesc": "Strength",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_fbm.mmg
|
||||
#Generates a 3D noise made of several octaves of a simple noise
|
||||
|
||||
# "instance": "float $(name)_fbm(vec3 coord, vec3 size, int octaves, float persistence, float seed) {\n\tfloat normalize_factor = 0.0;\n\tfloat value = 0.0;\n\tfloat scale = 1.0;\n\tfor (int i = 0; i < octaves; i++) {\n\t\tvalue += tex3d_fbm_$noise(coord*size, size, seed) * scale;\n\t\tnormalize_factor += scale;\n\t\tsize *= 2.0;\n\t\tscale *= persistence;\n\t}\n\treturn value / normalize_factor;\n}\n",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "Shows a greyscale 3D texture of the generated noise",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "vec3($(name)_fbm($(uv).xyz, vec3($(scale_x), $(scale_y), $(scale_z)), int($(iterations)), $(persistence), float($(seed))))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 2,
|
||||
# "label": "Noise",
|
||||
# "longdesc": "The simple noise type",
|
||||
# "name": "noise",
|
||||
# "shortdesc": "Noise type",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Value",
|
||||
# "value": "value"
|
||||
# },
|
||||
# {
|
||||
# "name": "Perlin",
|
||||
# "value": "perlin"
|
||||
# },
|
||||
# {
|
||||
# "name": "Cellular",
|
||||
# "value": "cellular"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Scale X",
|
||||
# "longdesc": "The scale of the first octave along the X axis",
|
||||
# "max": 32,
|
||||
# "min": 1,
|
||||
# "name": "scale_x",
|
||||
# "shortdesc": "Scale.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Scale Y",
|
||||
# "longdesc": "The scale of the first octave along the Y axis",
|
||||
# "max": 32,
|
||||
# "min": 1,
|
||||
# "name": "scale_y",
|
||||
# "shortdesc": "Scale.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Scale Z",
|
||||
# "longdesc": "The scale of the first octave along the Z axis",
|
||||
# "max": 32,
|
||||
# "min": 1,
|
||||
# "name": "scale_z",
|
||||
# "shortdesc": "Scale.z",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 3,
|
||||
# "label": "Iterations",
|
||||
# "longdesc": "The number of noise octaves",
|
||||
# "max": 10,
|
||||
# "min": 1,
|
||||
# "name": "iterations",
|
||||
# "shortdesc": "Octaves",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Persistence",
|
||||
# "longdesc": "The persistence between two consecutive octaves",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "persistence",
|
||||
# "shortdesc": "Persistence",
|
||||
# "step": 0.05,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_from2d.mmg
|
||||
#Creates a 3D texture from a 2D texture
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input 2D texture",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "$in($uv.xy+vec2(0.5))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_pattern.mmg
|
||||
#A greyscale 3D texture that combines patterns along all 3 axes
|
||||
|
||||
# "instance": "float $(name)_fct(vec3 uv) {\n\treturn mix3d_$(mix)(wave3d_$(x_wave)($(x_scale)*uv.x), wave3d_$(y_wave)($(y_scale)*uv.y), wave3d_$(z_wave)($(z_scale)*uv.z));\n}",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The generated 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "vec3($(name)_fct($(uv).xyz))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "Combiner",
|
||||
# "longdesc": "The operation used to combine the X, Y and Z patterns",
|
||||
# "name": "mix",
|
||||
# "shortdesc": "Combine",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Multiply",
|
||||
# "value": "mul"
|
||||
# },
|
||||
# {
|
||||
# "name": "Add",
|
||||
# "value": "add"
|
||||
# },
|
||||
# {
|
||||
# "name": "Max",
|
||||
# "value": "max"
|
||||
# },
|
||||
# {
|
||||
# "name": "Min",
|
||||
# "value": "min"
|
||||
# },
|
||||
# {
|
||||
# "name": "Xor",
|
||||
# "value": "xor"
|
||||
# },
|
||||
# {
|
||||
# "name": "Pow",
|
||||
# "value": "pow"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "X",
|
||||
# "longdesc": "Pattern generated along the X axis",
|
||||
# "name": "x_wave",
|
||||
# "shortdesc": "Pattern.x",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Sine",
|
||||
# "value": "sine"
|
||||
# },
|
||||
# {
|
||||
# "name": "Triangle",
|
||||
# "value": "triangle"
|
||||
# },
|
||||
# {
|
||||
# "name": "Square",
|
||||
# "value": "square"
|
||||
# },
|
||||
# {
|
||||
# "name": "Sawtooth",
|
||||
# "value": "sawtooth"
|
||||
# },
|
||||
# {
|
||||
# "name": "Constant",
|
||||
# "value": "constant"
|
||||
# },
|
||||
# {
|
||||
# "name": "Bounce",
|
||||
# "value": "bounce"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "2:",
|
||||
# "longdesc": "Repetitions of the pattern along X axis",
|
||||
# "max": 32,
|
||||
# "min": 0,
|
||||
# "name": "x_scale",
|
||||
# "shortdesc": "Repeat.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "Y",
|
||||
# "longdesc": "Pattern generated along the Y axis",
|
||||
# "name": "y_wave",
|
||||
# "shortdesc": "Pattern.y",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Sine",
|
||||
# "value": "sine"
|
||||
# },
|
||||
# {
|
||||
# "name": "Triangle",
|
||||
# "value": "triangle"
|
||||
# },
|
||||
# {
|
||||
# "name": "Square",
|
||||
# "value": "square"
|
||||
# },
|
||||
# {
|
||||
# "name": "Sawtooth",
|
||||
# "value": "sawtooth"
|
||||
# },
|
||||
# {
|
||||
# "name": "Constant",
|
||||
# "value": "constant"
|
||||
# },
|
||||
# {
|
||||
# "name": "Bounce",
|
||||
# "value": "bounce"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "3:",
|
||||
# "longdesc": "Repetitions of the pattern along Y axis",
|
||||
# "max": 32,
|
||||
# "min": 0,
|
||||
# "name": "y_scale",
|
||||
# "shortdesc": "Repeat.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "default": 0,
|
||||
# "label": "Z",
|
||||
# "longdesc": "Pattern generated along the Z axis",
|
||||
# "name": "z_wave",
|
||||
# "shortdesc": "Pattern.z",
|
||||
# "type": "enum",
|
||||
# "values": [
|
||||
# {
|
||||
# "name": "Sine",
|
||||
# "value": "sine"
|
||||
# },
|
||||
# {
|
||||
# "name": "Triangle",
|
||||
# "value": "triangle"
|
||||
# },
|
||||
# {
|
||||
# "name": "Square",
|
||||
# "value": "square"
|
||||
# },
|
||||
# {
|
||||
# "name": "Sawtooth",
|
||||
# "value": "sawtooth"
|
||||
# },
|
||||
# {
|
||||
# "name": "Constant",
|
||||
# "value": "constant"
|
||||
# },
|
||||
# {
|
||||
# "name": "Bounce",
|
||||
# "value": "bounce"
|
||||
# }
|
||||
# ]
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "4:",
|
||||
# "longdesc": "Repetitions of the pattern along Z axis",
|
||||
# "max": 32,
|
||||
# "min": 0,
|
||||
# "name": "z_scale",
|
||||
# "shortdesc": "Repeat.z",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_rotate.mmg
|
||||
#Rotates a 3D texture
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(1.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The input 3D texture",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The rotated 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "$in(vec4(tex3d_rotate($uv.xyz, -vec3($ax, $ay, $az)*0.01745329251), $uv.w))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "X",
|
||||
# "longdesc": "The rotation around the X axis",
|
||||
# "max": 180,
|
||||
# "min": -180,
|
||||
# "name": "ax",
|
||||
# "shortdesc": "Rotate.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Y",
|
||||
# "longdesc": "The rotation around the Y axis",
|
||||
# "max": 180,
|
||||
# "min": -180,
|
||||
# "name": "ay",
|
||||
# "shortdesc": "Rotate.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Z",
|
||||
# "longdesc": "The rotation around the Z axis",
|
||||
# "max": 180,
|
||||
# "min": -180,
|
||||
# "name": "az",
|
||||
# "shortdesc": "Rotate.z",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_select.mmg
|
||||
#Selects a 3D texture for a given color index. This can be used to map several textures into a single 3D scene.
|
||||
|
||||
# "code": "float $(name_uv)_d = ($uv.w-$v)/$t;",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture associated to the specified color index",
|
||||
# "name": "in1",
|
||||
# "shortdesc": "Input1",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture(s) associated to other color indices",
|
||||
# "name": "in2",
|
||||
# "shortdesc": "Input2",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The merged 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "mix($in1($uv), $in2($uv), clamp(1.0-$(name_uv)_d*$(name_uv)_d, 0.0, 1.0))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Value",
|
||||
# "longdesc": "The value of the selected color index",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "v",
|
||||
# "shortdesc": "Value",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.1,
|
||||
# "label": "Tolerance",
|
||||
# "longdesc": "The tolerance used when comparing color indices",
|
||||
# "max": 1,
|
||||
# "min": 0.01,
|
||||
# "name": "t",
|
||||
# "shortdesc": "Tolerance",
|
||||
# "step": 0.001,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_select_shape.mmg
|
||||
#Selects a 3D texture inside, and another outside a shape. This can be used to map several textures into a single 3D scene.
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec3(0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture associated to the specified color index",
|
||||
# "name": "in1",
|
||||
# "shortdesc": "Input1",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec3(0.5)",
|
||||
# "label": "",
|
||||
# "longdesc": "The 3D texture(s) associated to other color indices",
|
||||
# "name": "in2",
|
||||
# "shortdesc": "Input2",
|
||||
# "type": "tex3d"
|
||||
# },
|
||||
# {
|
||||
# "default": "0.0",
|
||||
# "label": "",
|
||||
# "longdesc": "The shape in which input1 is applied",
|
||||
# "name": "shape",
|
||||
# "shortdesc": "Shape",
|
||||
# "type": "sdf3d"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "The merged 3D texture",
|
||||
# "shortdesc": "Output",
|
||||
# "tex3d": "mix($in1($uv), $in2($uv), clamp($shape($uv.xyz)/max($d, 0.0001), 0.0, 1.0))",
|
||||
# "type": "tex3d"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Smoothness",
|
||||
# "longdesc": "The width of the transition area between both textures",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "d",
|
||||
# "shortdesc": "Smoothness",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply.mmg
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply.mmg
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply.mmg
|
||||
|
||||
#----------------------
|
||||
#tex3d_apply.mmg
|
||||
|
||||
#vec3 blend3d_normal(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*c1 + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_multiply(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*c1*c2 + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_screen(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#float blend3d_overlay_f(float c1, float c2) {\n\t
|
||||
# return (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_overlay(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*vec3(blend3d_overlay_f(c1.x, c2.x), blend3d_overlay_f(c1.y, c2.y), blend3d_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_hard_light(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*0.5*(c1*c2+blend3d_overlay(c1, c2, 1.0)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#float blend3d_soft_light_f(float c1, float c2) {\n\t
|
||||
# return (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_soft_light(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*vec3(blend3d_soft_light_f(c1.x, c2.x), blend3d_soft_light_f(c1.y, c2.y), blend3d_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#float blend3d_burn_f(float c1, float c2) {\n\t
|
||||
# return (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_burn(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*vec3(blend3d_burn_f(c1.x, c2.x), blend3d_burn_f(c1.y, c2.y), blend3d_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#float blend3d_dodge_f(float c1, float c2) {\n\t
|
||||
# return (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_dodge(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*vec3(blend3d_dodge_f(c1.x, c2.x), blend3d_dodge_f(c1.y, c2.y), blend3d_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_lighten(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*max(c1, c2) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#vec3 blend3d_darken(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*min(c1, c2) + (1.0-opacity)*c2;
|
||||
#}
|
||||
|
||||
#vec3 blend3d_difference(vec3 c1, vec3 c2, float opacity) {\n\t
|
||||
# return opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n
|
||||
#}
|
||||
|
||||
#float rand31(vec3 p) {\n\t
|
||||
# return fract(sin(dot(p,vec3(127.1,311.7, 74.7)))*43758.5453123);\n
|
||||
#}
|
||||
|
||||
#vec3 rand33(vec3 p) {\n\t
|
||||
# p = vec3( dot(p,vec3(127.1,311.7, 74.7)),
|
||||
# dot(p,vec3(269.5,183.3,246.1)),\n\t\t\t
|
||||
# dot(p,vec3(113.5,271.9,124.6)));\n\n\t
|
||||
#
|
||||
# return -1.0 + 2.0*fract(sin(p)*43758.5453123);
|
||||
#}
|
||||
|
||||
#float tex3d_fbm_value(vec3 coord, vec3 size, float seed) {\n\t
|
||||
# vec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\t
|
||||
# vec3 f = fract(coord);\n\t
|
||||
# float p000 = rand31(mod(o, size));\n\t
|
||||
# float p001 = rand31(mod(o + vec3(0.0, 0.0, 1.0), size));\n\t
|
||||
# float p010 = rand31(mod(o + vec3(0.0, 1.0, 0.0), size));\n\t
|
||||
# float p011 = rand31(mod(o + vec3(0.0, 1.0, 1.0), size));\n\t
|
||||
# float p100 = rand31(mod(o + vec3(1.0, 0.0, 0.0), size));\n\t
|
||||
# float p101 = rand31(mod(o + vec3(1.0, 0.0, 1.0), size));\n\t
|
||||
# float p110 = rand31(mod(o + vec3(1.0, 1.0, 0.0), size));\n\t
|
||||
# float p111 = rand31(mod(o + vec3(1.0, 1.0, 1.0), size));\n\t
|
||||
#
|
||||
# vec3 t = f * f * (3.0 - 2.0 * f);\n\t
|
||||
#
|
||||
# return mix(mix(mix(p000, p100, t.x), mix(p010, p110, t.x), t.y), mix(mix(p001, p101, t.x), mix(p011, p111, t.x), t.y), t.z);\n
|
||||
#}
|
||||
|
||||
#float tex3d_fbm_perlin(vec3 coord, vec3 size, float seed) {\n\t
|
||||
# vec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\t
|
||||
# vec3 f = fract(coord);\n\t
|
||||
# vec3 v000 = normalize(rand33(mod(o, size))-vec3(0.5));\n\t
|
||||
# vec3 v001 = normalize(rand33(mod(o + vec3(0.0, 0.0, 1.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v010 = normalize(rand33(mod(o + vec3(0.0, 1.0, 0.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v011 = normalize(rand33(mod(o + vec3(0.0, 1.0, 1.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v100 = normalize(rand33(mod(o + vec3(1.0, 0.0, 0.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v101 = normalize(rand33(mod(o + vec3(1.0, 0.0, 1.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v110 = normalize(rand33(mod(o + vec3(1.0, 1.0, 0.0), size))-vec3(0.5));\n\t
|
||||
# vec3 v111 = normalize(rand33(mod(o + vec3(1.0, 1.0, 1.0), size))-vec3(0.5));\n\t
|
||||
#
|
||||
# float p000 = dot(v000, f);\n\tfloat p001 = dot(v001, f - vec3(0.0, 0.0, 1.0));\n\t
|
||||
# float p010 = dot(v010, f - vec3(0.0, 1.0, 0.0));\n\t
|
||||
# float p011 = dot(v011, f - vec3(0.0, 1.0, 1.0));\n\t
|
||||
# float p100 = dot(v100, f - vec3(1.0, 0.0, 0.0));\n\t
|
||||
# float p101 = dot(v101, f - vec3(1.0, 0.0, 1.0));\n\t
|
||||
# float p110 = dot(v110, f - vec3(1.0, 1.0, 0.0));\n\t
|
||||
# float p111 = dot(v111, f - vec3(1.0, 1.0, 1.0));\n\t
|
||||
#
|
||||
# vec3 t = f * f * (3.0 - 2.0 * f);\n\t
|
||||
#
|
||||
# return 0.5 + mix(mix(mix(p000, p100, t.x), mix(p010, p110, t.x), t.y), mix(mix(p001, p101, t.x), mix(p011, p111, t.x), t.y), t.z);
|
||||
#}
|
||||
|
||||
#float tex3d_fbm_cellular(vec3 coord, vec3 size, float seed) {\n\t
|
||||
# vec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\t
|
||||
# vec3 f = fract(coord);\n\tfloat min_dist = 3.0;\n\t
|
||||
#
|
||||
# for (float x = -1.0; x <= 1.0; x++) {\n\t\t
|
||||
# for (float y = -1.0; y <= 1.0; y++) {\n\t\t\t
|
||||
# for (float z = -1.0; z <= 1.0; z++) {\n\t\t\t\t
|
||||
# vec3 node = 0.4*rand33(mod(o + vec3(x, y, z), size)) + vec3(x, y, z);\n\t\t\t\t
|
||||
# float dist = sqrt((f - node).x * (f - node).x + (f - node).y * (f - node).y + (f - node).z * (f - node).z);\n\t\t\t\t
|
||||
# min_dist = min(min_dist, dist);\n\t\t\t
|
||||
# }\n\t\t
|
||||
#
|
||||
# }\n\t
|
||||
#
|
||||
# }\n\t
|
||||
#
|
||||
# return min_dist;
|
||||
#}
|
||||
|
||||
|
||||
#float wave3d_constant(float x) {\n\t
|
||||
# return 1.0;\n
|
||||
#}
|
||||
|
||||
#float wave3d_sine(float x) {\n\t
|
||||
# return 0.5-0.5*cos(3.14159265359*2.0*x);\n
|
||||
#}
|
||||
|
||||
#float wave3d_triangle(float x) {\n\t
|
||||
# x = fract(x);\n\t
|
||||
# return min(2.0*x, 2.0-2.0*x);\n
|
||||
#}
|
||||
|
||||
#float wave3d_sawtooth(float x) {\n\t
|
||||
# return fract(x);\n
|
||||
#}
|
||||
|
||||
#float wave3d_square(float x) {\n\t
|
||||
# return (fract(x) < 0.5) ? 0.0 : 1.0;\n
|
||||
#}
|
||||
|
||||
#float wave3d_bounce(float x) {\n\t
|
||||
# x = 2.0*(fract(x)-0.5);\n\t
|
||||
# return sqrt(1.0-x*x);\n
|
||||
#}
|
||||
|
||||
#float mix3d_mul(float x, float y, float z) {\n\t
|
||||
# return x*y*z;\n
|
||||
#}
|
||||
|
||||
#float mix3d_add(float x, float y, float z) {\n\t
|
||||
# return min(x+y+z, 1.0);\n
|
||||
#}
|
||||
|
||||
#float mix3d_max(float x, float y, float z) {\n\t
|
||||
# return max(max(x, y), z);\n
|
||||
#}
|
||||
|
||||
#float mix3d_min(float x, float y, float z) {\n\t
|
||||
# return min(min(x, y), z);\n
|
||||
#}
|
||||
|
||||
#float mix3d_xor(float x, float y, float z) {\n\t
|
||||
# float xy = min(x+y, 2.0-x-y);\n\t
|
||||
# return min(xy+z, 2.0-xy-z);\n
|
||||
#}
|
||||
|
||||
#float mix3d_pow(float x, float y, float z) {\n\t
|
||||
# return pow(pow(x, y), z);\n
|
||||
#}
|
||||
|
||||
#vec3 tex3d_rotate(vec3 p, vec3 a) {\n\t
|
||||
# vec3 rv;\n\t
|
||||
# float c;\n\t
|
||||
# float s;\n\t
|
||||
# c = cos(a.x);\n\t
|
||||
# s = sin(a.x);\n\t
|
||||
# rv.x = p.x;\n\t
|
||||
# rv.y = p.y*c+p.z*s;\n\t
|
||||
# rv.z = -p.y*s+p.z*c;\n\t
|
||||
# c = cos(a.y);\n\t
|
||||
# s = sin(a.y);\n\t
|
||||
# p.x = rv.x*c+rv.z*s;\n\t
|
||||
# p.y = rv.y;\n\t
|
||||
# p.z = -rv.x*s+rv.z*c;\n\t
|
||||
# c = cos(a.z);\n\t
|
||||
# s = sin(a.z);\n\t
|
||||
# rv.x = p.x*c+p.y*s;\n\t
|
||||
# rv.y = -p.x*s+p.y*c;\n\t
|
||||
# rv.z = p.z;\n\t
|
||||
# return rv;\n
|
||||
#}
|
||||
|
935
game/addons/mat_maker_gd/nodes/common/tile.gd
Normal file
935
game/addons/mat_maker_gd/nodes/common/tile.gd
Normal file
@ -0,0 +1,935 @@
|
||||
tool
|
||||
extends Reference
|
||||
|
||||
const Commons = preload("res://addons/mat_maker_gd/nodes/common/commons.gd")
|
||||
|
||||
#----------------------
|
||||
#tile2x2.mmg
|
||||
#Places 4 input images into a single output to create an atlas of 4 images.
|
||||
#Chaining Tile2x2 nodes can be useful to create 16 images atlases.
|
||||
#Atlases are used by remapping nodes such as CustomUV, Tiler and Splatter.
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The first input",
|
||||
# "name": "in1",
|
||||
# "shortdesc": "Input1",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The second input",
|
||||
# "name": "in2",
|
||||
# "shortdesc": "Input2",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The third input",
|
||||
# "name": "in3",
|
||||
# "shortdesc": "Input3",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "label": "",
|
||||
# "longdesc": "The fourth input",
|
||||
# "name": "in4",
|
||||
# "shortdesc": "Input4",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "Shows the generated atlas",
|
||||
# "rgba": "($uv.y < 0.5) ? (($uv.x < 0.5) ? ($in1(2.0*$uv)) : ($in2(2.0*$uv-vec2(1.0, 0.0)))) : (($uv.x < 0.5) ? ($in3(2.0*$uv-vec2(0.0, 1.0))) : ($in4(2.0*$uv-vec2(1.0, 1.0))))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tile2x2_variations.mmg
|
||||
#Places 4 input images into a single output to create an atlas of 4 images.
|
||||
#Chaining Tile2x2 nodes can be useful to create 16 images atlases.
|
||||
#Atlases are used by remapping nodes such as CustomUV, Tiler and Splatter.
|
||||
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(0.0)",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "The first input",
|
||||
# "name": "in",
|
||||
# "shortdesc": "Input1",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "Shows the generated atlas",
|
||||
# "rgba": "($uv.y < 0.5) ? (($uv.x < 0.5) ? ($in.variation(2.0*$uv, $seed)) : ($in.variation(2.0*$uv-vec2(1.0, 0.0), $seed+0.1))) : (($uv.x < 0.5) ? ($in.variation(2.0*$uv-vec2(0.0, 1.0), $seed+0.2)) : ($in.variation(2.0*$uv-vec2(1.0, 1.0), $seed+0.3)))",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tiler.mmg
|
||||
#Tiles several occurences of an input image while adding randomness.
|
||||
|
||||
# "code": "vec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), 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 tiler_$(name)(vec2 uv, vec2 tile, int overlap, vec2 _seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tvec2 seed = rand2(pos+_seed);\n\t\t\trc1 = rand3(seed);\n\t\t\tpos = fract(pos+vec2($fixed_offset/tile.x, 0.0)*floor(mod(pos.y*tile.y, 2.0))+$offset*seed/tile);\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tvec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\t\tif (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$select_inputs\n\t\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\t\tc = max(c, c1);\n\t\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t\t}\n\t\t}\n\t}\n\treturn vec4(rc, c);\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": 4,
|
||||
# "label": "Tile X",
|
||||
# "longdesc": "The number of columns of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "tx",
|
||||
# "shortdesc": "Tile.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile Y",
|
||||
# "longdesc": "The number of rows of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "ty",
|
||||
# "shortdesc": "Tile.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 1,
|
||||
# "label": "Overlap",
|
||||
# "longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
# "max": 5,
|
||||
# "min": 0,
|
||||
# "name": "overlap",
|
||||
# "shortdesc": "Overlap",
|
||||
# "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.5,
|
||||
# "label": "Fixed Offset",
|
||||
# "longdesc": "The relative offset of odd rows",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "fixed_offset",
|
||||
# "shortdesc": "FixedOffset",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Rnd Offset",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "offset",
|
||||
# "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 tile variations of the input",
|
||||
# "name": "variations",
|
||||
# "shortdesc": "Variations",
|
||||
# "type": "boolean"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tiler_advanced.mmg
|
||||
#Tiles several occurences of an input image while adding randomness.
|
||||
|
||||
# "code": "vec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), 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"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(rand2($uv+vec2(float($seed))), rand2($uv-vec2(float($seed))))",
|
||||
# "label": "",
|
||||
# "longdesc": "An input color map used to generate the Instance map 1 output",
|
||||
# "name": "color1",
|
||||
# "shortdesc": "Color map 1",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(rand2(-$uv+vec2(float($seed))), rand2(-$uv-vec2(float($seed))))",
|
||||
# "label": "",
|
||||
# "longdesc": "An input color map used to generate the Instance map 2 output",
|
||||
# "name": "color2",
|
||||
# "shortdesc": "Color map 2",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "5:",
|
||||
# "longdesc": "A map for translation along the X axis",
|
||||
# "name": "tr_x",
|
||||
# "shortdesc": "Translate map X",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for translation along the Y axis",
|
||||
# "name": "tr_y",
|
||||
# "shortdesc": "Translate map Y",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for rotation",
|
||||
# "name": "r",
|
||||
# "shortdesc": "Rotate map",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for scale along the X axis",
|
||||
# "name": "sc_x",
|
||||
# "shortdesc": "Scale map X",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for scale along the Y axis",
|
||||
# "name": "sc_y",
|
||||
# "shortdesc": "Scale map Y",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "instance": "vec4 tiler_$(name)(vec2 uv, vec2 tile, int overlap, float _seed) {\n\tfloat c = 0.0;\n\tvec2 map_uv = vec2(0.0);\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tpos = fract(pos+vec2(0.5));\n\t\t\t\tpv -= vec2($translate_x*$tr_x(pos), $translate_y*$tr_y(pos))/tile;\n\t\t\t\tfloat angle = $r(pos) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv /= vec2($scale_x*$sc_x(pos), $scale_y*$sc_y(pos));\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvec2 seed = rand2(vec2(_seed)+pos);\n\t\t\t\t$select_inputs\n\t\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask;\n\t\t\t\tc = max(c, c1);\n\t\t\t\tmap_uv = mix(map_uv, pos, step(c, c1));\n\t\t\t}\n\t\t}\n\t}\n\treturn vec4(map_uv, 0.0, c);\n}",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "f": "$(name_uv)_rch.a",
|
||||
# "longdesc": "Shows the generated pattern",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "Shows a color for each instance of the input image",
|
||||
# "rgba": "$color1($(name_uv)_rch.rg)",
|
||||
# "shortdesc": "Instance map 1",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "Shows a color for each instance of the input image",
|
||||
# "rgba": "$color2($(name_uv)_rch.rg)",
|
||||
# "shortdesc": "Instance map 2",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile X",
|
||||
# "longdesc": "The number of columns of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "tx",
|
||||
# "shortdesc": "Tile.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile Y",
|
||||
# "longdesc": "The number of rows of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "ty",
|
||||
# "shortdesc": "Tile.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 1,
|
||||
# "label": "Overlap",
|
||||
# "longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
# "max": 5,
|
||||
# "min": 0,
|
||||
# "name": "overlap",
|
||||
# "shortdesc": "Overlap",
|
||||
# "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": 0,
|
||||
# "label": "Translate X",
|
||||
# "longdesc": "The translation along the X axis applied to the instances",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "translate_x",
|
||||
# "shortdesc": "Translate.x",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Translate Y",
|
||||
# "longdesc": "The translation along the Y axis applied to the instances",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "translate_y",
|
||||
# "shortdesc": "Translate.y",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Rotate",
|
||||
# "longdesc": "The angle of instances of the input",
|
||||
# "max": 180,
|
||||
# "min": 0,
|
||||
# "name": "rotate",
|
||||
# "shortdesc": "Rotate",
|
||||
# "step": 0.1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "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"
|
||||
# },
|
||||
# {
|
||||
# "default": false,
|
||||
# "label": "Variations",
|
||||
# "longdesc": "Check to tile variations of the input",
|
||||
# "name": "variations",
|
||||
# "shortdesc": "Variations",
|
||||
# "type": "boolean"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tiler_advanced_color.mmg
|
||||
#Tiles several occurences of an input image while adding randomness.
|
||||
|
||||
# "code": "vec2 $(name_uv)_mapuv;\nvec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), float($seed), $(name_uv)_mapuv);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "vec4(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"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(rand2($uv+vec2(float($seed))), rand2($uv-vec2(float($seed))))",
|
||||
# "label": "",
|
||||
# "longdesc": "An input color map used to generate the Instance map 1 output",
|
||||
# "name": "color1",
|
||||
# "shortdesc": "Color map 1",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "vec4(rand2(-$uv+vec2(float($seed))), rand2(-$uv-vec2(float($seed))))",
|
||||
# "label": "",
|
||||
# "longdesc": "An input color map used to generate the Instance map 2 output",
|
||||
# "name": "color2",
|
||||
# "shortdesc": "Color map 2",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "5:",
|
||||
# "longdesc": "A map for translation along the X axis",
|
||||
# "name": "tr_x",
|
||||
# "shortdesc": "Translate map X",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for translation along the Y axis",
|
||||
# "name": "tr_y",
|
||||
# "shortdesc": "Translate map Y",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for rotation",
|
||||
# "name": "r",
|
||||
# "shortdesc": "Rotate map",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for scale along the X axis",
|
||||
# "name": "sc_x",
|
||||
# "shortdesc": "Scale map X",
|
||||
# "type": "f"
|
||||
# },
|
||||
# {
|
||||
# "default": "1.0",
|
||||
# "function": true,
|
||||
# "label": "",
|
||||
# "longdesc": "A map for scale along the Y axis",
|
||||
# "name": "sc_y",
|
||||
# "shortdesc": "Scale map Y",
|
||||
# "type": "f"
|
||||
# }
|
||||
# ],
|
||||
# "instance": "vec4 tiler_$(name)(vec2 uv, vec2 tile, int overlap, float _seed, out vec2 outmapuv) {\n\t// $seed\n\tvec4 c = vec4(0.0);\n\toutmapuv = vec2(0.0);\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tpos = fract(pos+vec2(0.5));\n\t\t\t\tpv -= vec2($translate_x*$tr_x(pos), $translate_y*$tr_y(pos))/tile;\n\t\t\t\tfloat angle = $r(pos) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv /= vec2($scale_x*$sc_x(pos), $scale_y*$sc_y(pos));\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvec2 seed = rand2(vec2(_seed)+pos);\n\t\t\t\t$select_inputs\n\t\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\t\tfloat na = n.a*mask;\n\t\t\t\toutmapuv = mix(outmapuv, pos, step(c.a, na));\n\t\t\t\tc = mix(c, n, na);\n\t\t\t}\n\t\t}\n\t}\n\treturn c;\n}\n",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "Shows the generated pattern",
|
||||
# "rgba": "$(name_uv)_rch",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "Shows a color for each instance of the input image",
|
||||
# "rgba": "$color1($(name_uv)_mapuv)",
|
||||
# "shortdesc": "Instance map 1",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "Shows a color for each instance of the input image",
|
||||
# "rgba": "$color2($(name_uv)_mapuv)",
|
||||
# "shortdesc": "Instance map 2",
|
||||
# "type": "rgba"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile X",
|
||||
# "longdesc": "The number of columns of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "tx",
|
||||
# "shortdesc": "Tile.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile Y",
|
||||
# "longdesc": "The number of rows of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "ty",
|
||||
# "shortdesc": "Tile.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 1,
|
||||
# "label": "Overlap",
|
||||
# "longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
# "max": 5,
|
||||
# "min": 0,
|
||||
# "name": "overlap",
|
||||
# "shortdesc": "Overlap",
|
||||
# "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": 0,
|
||||
# "label": "Translate X",
|
||||
# "longdesc": "The translation along the X axis applied to the instances",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "translate_x",
|
||||
# "shortdesc": "Translate.x",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Translate Y",
|
||||
# "longdesc": "The translation along the Y axis applied to the instances",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "translate_y",
|
||||
# "shortdesc": "Translate.y",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0,
|
||||
# "label": "Rotate",
|
||||
# "longdesc": "The angle of instances of the input",
|
||||
# "max": 180,
|
||||
# "min": 0,
|
||||
# "name": "rotate",
|
||||
# "shortdesc": "Rotate",
|
||||
# "step": 0.1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "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"
|
||||
# },
|
||||
# {
|
||||
# "default": false,
|
||||
# "label": "Variations",
|
||||
# "longdesc": "Check to tile variations of the input",
|
||||
# "name": "variations",
|
||||
# "shortdesc": "Variations",
|
||||
# "type": "boolean"
|
||||
# }
|
||||
# ],
|
||||
|
||||
#----------------------
|
||||
#tiler_color.mmg
|
||||
#Tiles several occurences of an input image while adding randomness.
|
||||
|
||||
# "code": "vec3 $(name_uv)_random_color;\nvec4 $(name_uv)_tiled_output = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), vec2(float($seed)), $(name_uv)_random_color);",
|
||||
# "inputs": [
|
||||
# {
|
||||
# "default": "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 tiler_$(name)(vec2 uv, vec2 tile, int overlap, vec2 _seed, out vec3 random_color) {\n\tvec4 c = vec4(0.0);\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tvec2 seed = rand2(pos+_seed);\n\t\t\trc1 = rand3(seed);\n\t\t\tpos = fract(pos+vec2($fixed_offset/tile.x, 0.0)*floor(mod(pos.y*tile.y, 2.0))+$offset*seed/tile);\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tpv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\t\t$select_inputs\n\t\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\t\tc = mix(c, n, na);\n\t\t\t\trc = mix(rc, rc1, n.a);\n\t\t\t}\n\t\t}\n\t}\n\trandom_color = rc;\n\treturn c;\n}\n",
|
||||
# "outputs": [
|
||||
# {
|
||||
# "longdesc": "Shows the generated pattern",
|
||||
# "rgba": "$(name_uv)_tiled_output",
|
||||
# "shortdesc": "Output",
|
||||
# "type": "rgba"
|
||||
# },
|
||||
# {
|
||||
# "longdesc": "Shows a random color for each instance of the input image",
|
||||
# "rgb": "$(name_uv)_random_color",
|
||||
# "shortdesc": "Instance Map",
|
||||
# "type": "rgb"
|
||||
# }
|
||||
# ],
|
||||
# "parameters": [
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile X",
|
||||
# "longdesc": "The number of columns of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "tx",
|
||||
# "shortdesc": "Tile.x",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 4,
|
||||
# "label": "Tile Y",
|
||||
# "longdesc": "The number of rows of the tiles pattern",
|
||||
# "max": 64,
|
||||
# "min": 1,
|
||||
# "name": "ty",
|
||||
# "shortdesc": "Tile.y",
|
||||
# "step": 1,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 1,
|
||||
# "label": "Overlap",
|
||||
# "longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
# "max": 5,
|
||||
# "min": 0,
|
||||
# "name": "overlap",
|
||||
# "shortdesc": "Overlap",
|
||||
# "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.5,
|
||||
# "label": "Fixed Offset",
|
||||
# "longdesc": "The relative offset of odd rows",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "fixed_offset",
|
||||
# "shortdesc": "FixedOffset",
|
||||
# "step": 0.01,
|
||||
# "type": "float"
|
||||
# },
|
||||
# {
|
||||
# "control": "None",
|
||||
# "default": 0.5,
|
||||
# "label": "Rnd Offset",
|
||||
# "max": 1,
|
||||
# "min": 0,
|
||||
# "name": "offset",
|
||||
# "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 tile variations of the input",
|
||||
# "name": "variations",
|
||||
# "shortdesc": "Variations",
|
||||
# "type": "boolean"
|
||||
# }
|
||||
# ],
|
||||
|
||||
|
@ -1,109 +0,0 @@
|
||||
{
|
||||
"name": "arc_pavement",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"bevel": 0.2,
|
||||
"bricks": 8,
|
||||
"mortar": 0.05,
|
||||
"repeat": 2,
|
||||
"rows": 12
|
||||
},
|
||||
"seed": 0,
|
||||
"seed_locked": false,
|
||||
"shader_model": {
|
||||
"code": "vec2 $(name_uv)_uv = fract($uv)*vec2($repeat, -1.0);\nvec2 $(name_uv)_seed;\nvec4 $(name_uv)_ap = arc_pavement($(name_uv)_uv, $rows, $bricks, $(name_uv)_seed);\n",
|
||||
"global": "float pavement(vec2 uv, float bevel, float mortar) {\n\tuv = abs(uv-vec2(0.5));\n\treturn clamp((0.5*(1.0-mortar)-max(uv.x, uv.y))/max(0.0001, bevel), 0.0, 1.0);\n}\n\nvec4 arc_pavement(vec2 uv, float acount, float lcount, out vec2 seed) {\n\tfloat PI = 3.141592654;\n\tfloat radius = (0.5/sqrt(2.0));\n float uvx = uv.x;\n uv.x = 0.5*fract(uv.x+0.5)+0.25;\n float center = (uv.x-0.5)/radius;\n center *= center;\n center = floor(acount*(uv.y-radius*sqrt(1.0-center))+0.5)/acount;\n vec2 v = uv-vec2(0.5, center);\n float cornerangle = 0.85/acount+0.25*PI;\n float acountangle = (PI-2.0*cornerangle)/(lcount+floor(mod(center*acount, 2.0)));\n float angle = mod(atan(v.y, v.x), 2.0*PI);\n\tfloat base_angle;\n\tfloat local_uvy = 0.5+acount*(length(v)-radius)*(1.54-0.71*cos(1.44*(angle-PI*0.5)));\n\tvec2 local_uv;\n if (angle < cornerangle) {\n base_angle = 0.25*PI;\n\t\tlocal_uv = vec2((angle-0.25*PI)/cornerangle*0.38*acount+0.5, 1.0-local_uvy);\n\t\tseed = vec2(fract(center), 0.0);\n } else if (angle > PI-cornerangle) {\n base_angle = 0.75*PI;\n\t\tlocal_uv = vec2(local_uvy, 0.5-(0.75*PI-angle)/cornerangle*0.38*acount);\n\t\tseed = vec2(fract(center), 0.0);\n } else {\n base_angle = cornerangle+(floor((angle-cornerangle)/acountangle)+0.5)*acountangle;\n\t\tlocal_uv = vec2((angle-base_angle)/acountangle+0.5, 1.0-local_uvy);\n\t\tseed = vec2(fract(center), base_angle);\n }\n vec2 brick_center = vec2(0.5, center)+radius*vec2(cos(base_angle), sin(base_angle));\n return vec4(brick_center.x+uvx-uv.x, brick_center.y, local_uv);\n}\n",
|
||||
"inputs": [
|
||||
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Draws a white shape on a black background",
|
||||
"name": "Arc pavement",
|
||||
"outputs": [
|
||||
{
|
||||
"f": "pavement($(name_uv)_ap.zw, $bevel, 2.0*$mortar)",
|
||||
"longdesc": "A greyscale image that shows the bricks pattern",
|
||||
"shortdesc": "Bricks pattern",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"longdesc": "A random color for each brick",
|
||||
"rgb": "rand3($(name_uv)_seed)",
|
||||
"shortdesc": "Random color",
|
||||
"type": "rgb"
|
||||
},
|
||||
{
|
||||
"longdesc": "An UV map output for each brick, to be connected to the Map input of a CustomUV node",
|
||||
"rgb": "vec3($(name_uv)_ap.zw, 0.0)",
|
||||
"shortdesc": "Brick UV",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 2,
|
||||
"label": "Repeat:",
|
||||
"longdesc": "The number of repetitions of the whole pattern",
|
||||
"max": 4,
|
||||
"min": 1,
|
||||
"name": "repeat",
|
||||
"shortdesc": "Repeat",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 8,
|
||||
"label": "Rows:",
|
||||
"longdesc": "The number of rows",
|
||||
"max": 16,
|
||||
"min": 4,
|
||||
"name": "rows",
|
||||
"shortdesc": "Rows",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 8,
|
||||
"label": "Bricks:",
|
||||
"longdesc": "The number of bricks per row",
|
||||
"max": 16,
|
||||
"min": 4,
|
||||
"name": "bricks",
|
||||
"shortdesc": "Bricks",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.1,
|
||||
"label": "Mortar:",
|
||||
"longdesc": "The width of the space between bricks",
|
||||
"max": 0.5,
|
||||
"min": 0,
|
||||
"name": "mortar",
|
||||
"shortdesc": "Mortar",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.1,
|
||||
"label": "Bevel:",
|
||||
"longdesc": "The width of the edge of each brick",
|
||||
"max": 0.5,
|
||||
"min": 0,
|
||||
"name": "bevel",
|
||||
"shortdesc": "Bevel",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,172 +0,0 @@
|
||||
{
|
||||
"connections": [
|
||||
{
|
||||
"from": "iterate_buffer",
|
||||
"from_port": 0,
|
||||
"to": "gen_outputs",
|
||||
"to_port": 0
|
||||
},
|
||||
{
|
||||
"from": "iterate_buffer",
|
||||
"from_port": 1,
|
||||
"to": "fill_iterate",
|
||||
"to_port": 0
|
||||
},
|
||||
{
|
||||
"from": "fill_iterate",
|
||||
"from_port": 0,
|
||||
"to": "iterate_buffer",
|
||||
"to_port": 1
|
||||
},
|
||||
{
|
||||
"from": "gen_inputs",
|
||||
"from_port": 0,
|
||||
"to": "fill_preprocess",
|
||||
"to_port": 0
|
||||
},
|
||||
{
|
||||
"from": "fill_preprocess",
|
||||
"from_port": 0,
|
||||
"to": "iterate_buffer",
|
||||
"to_port": 0
|
||||
}
|
||||
],
|
||||
"label": "Fill",
|
||||
"longdesc": "Fills areas defined by white outlines of its input",
|
||||
"name": "fill",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"name": "iterate_buffer",
|
||||
"node_position": {
|
||||
"x": -129.307083,
|
||||
"y": -370.480591
|
||||
},
|
||||
"parameters": {
|
||||
"iterations": 10,
|
||||
"size": 8
|
||||
},
|
||||
"seed_value": 29168,
|
||||
"type": "iterate_buffer"
|
||||
},
|
||||
{
|
||||
"name": "gen_inputs",
|
||||
"node_position": {
|
||||
"x": -542.307068,
|
||||
"y": -370.662445
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"ports": [
|
||||
{
|
||||
"group_size": 0,
|
||||
"longdesc": "The input image whose white outlines must be filled",
|
||||
"name": "port0",
|
||||
"shortdesc": "Input",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"type": "ios"
|
||||
},
|
||||
{
|
||||
"name": "gen_outputs",
|
||||
"node_position": {
|
||||
"x": 198.267258,
|
||||
"y": -362.662445
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"ports": [
|
||||
{
|
||||
"group_size": 0,
|
||||
"longdesc": "Generates fill data, to be connected to a fill companion node",
|
||||
"name": "port0",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"type": "ios"
|
||||
},
|
||||
{
|
||||
"name": "gen_parameters",
|
||||
"node_position": {
|
||||
"x": -171.110138,
|
||||
"y": -541.509705
|
||||
},
|
||||
"parameters": {
|
||||
"param0": 8,
|
||||
"param1": 10
|
||||
},
|
||||
"type": "remote",
|
||||
"widgets": [
|
||||
{
|
||||
"label": "",
|
||||
"linked_widgets": [
|
||||
{
|
||||
"node": "iterate_buffer",
|
||||
"widget": "size"
|
||||
},
|
||||
{
|
||||
"node": "fill_preprocess",
|
||||
"widget": "s"
|
||||
},
|
||||
{
|
||||
"node": "fill_iterate",
|
||||
"widget": "s"
|
||||
}
|
||||
],
|
||||
"longdesc": "The resolution of the inptu image",
|
||||
"name": "param0",
|
||||
"shortdesc": "Size",
|
||||
"type": "linked_control"
|
||||
},
|
||||
{
|
||||
"label": "",
|
||||
"linked_widgets": [
|
||||
{
|
||||
"node": "iterate_buffer",
|
||||
"widget": "iterations"
|
||||
}
|
||||
],
|
||||
"longdesc": "The number of iterations of the algorithm. The optimal value depends a lot on the input image.",
|
||||
"name": "param1",
|
||||
"shortdesc": "Iterations",
|
||||
"type": "linked_control"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fill_iterate",
|
||||
"node_position": {
|
||||
"x": -92.913391,
|
||||
"y": -290.886963
|
||||
},
|
||||
"parameters": {
|
||||
"s": 8
|
||||
},
|
||||
"type": "fill_iterate"
|
||||
},
|
||||
{
|
||||
"name": "fill_preprocess",
|
||||
"node_position": {
|
||||
"x": -110.443481,
|
||||
"y": -427.202026
|
||||
},
|
||||
"parameters": {
|
||||
"s": 8
|
||||
},
|
||||
"type": "fill_preprocess"
|
||||
}
|
||||
],
|
||||
"parameters": {
|
||||
"param0": 8,
|
||||
"param1": 10
|
||||
},
|
||||
"shortdesc": "Fill",
|
||||
"type": "graph"
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "fill_iterate",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"s": 11
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "0.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"name": "in",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "vec4 $(name)_fill(vec2 uv) {\n\tfloat size = $s;\n\tint iterations = min(int(size), 256);\n\tvec4 color = $in(fract(uv));\n\tif (color.z+color.w < 1.0/size) {\n\t\treturn vec4(0.0);\n\t}\n\tvec2 offsets[8] = { vec2(1.0, 0.0), vec2(-1.0, 0.0), vec2(0.0, 1.0), vec2(0.0, -1.0), vec2(1.0, 1.0), vec2(-1.0, 1.0), vec2(-1.0, 1.0), vec2(-1.0, -1.0) };\n\tfor (int o = 0; o < 8; ++o) {\n\t\tvec2 uv2 = uv;\n\t\tvec2 offset = offsets[o]/size;\n\t\tfor (int i = 1; i < iterations; i += 1) {\n\t\t\tuv2 += offset;\n\t\t\tvec4 color2 = $in(fract(uv2));\n\t\t\tif (color2.z+color2.w == 0.0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tvec2 p1 = color.xy+floor(uv-color.xy);\n\t\t\tvec2 p2 = color2.xy+floor(uv2-color2.xy);\n\t\t\tvec2 p = min(p1, p2);\n\t\t\tvec2 s = max(p1+color.zw, p2+color2.zw)-p;\n\t\t\tcolor = mix(vec4(0.0, 0.0, 1.0, 1.0), vec4(fract(p), s), step(s.xyxy, vec4(1.0)));\n\t\t}\n\t}\n\treturn floor(color*size)/size;\n}\n",
|
||||
"name": "Fill iterate",
|
||||
"outputs": [
|
||||
{
|
||||
"rgba": "$(name)_fill($uv)",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 9,
|
||||
"first": 6,
|
||||
"label": "",
|
||||
"last": 12,
|
||||
"name": "s",
|
||||
"type": "size"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,42 +0,0 @@
|
||||
{
|
||||
"name": "fill_preprocess",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"s": 8
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "vec4 flood_fill_preprocess(vec2 uv, float c, float s) {\n\tif (c > 0.5) {\n\t\treturn vec4(0.0);\n\t} else {\n\t\treturn vec4(floor(uv*s)/s, vec2(1.0/s));\n\t}\n}",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "0.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"name": "in",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"name": "Fill preprocess",
|
||||
"outputs": [
|
||||
{
|
||||
"rgba": "flood_fill_preprocess($uv, $in($uv), $s)",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 10,
|
||||
"first": 0,
|
||||
"label": "",
|
||||
"last": 12,
|
||||
"name": "s",
|
||||
"type": "size"
|
||||
}
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_color",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"edgecolor": {
|
||||
"a": 1,
|
||||
"b": 0,
|
||||
"g": 0,
|
||||
"r": 0,
|
||||
"type": "Color"
|
||||
}
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(1.0)",
|
||||
"label": "",
|
||||
"longdesc": "The image from which colors are taken",
|
||||
"name": "map",
|
||||
"shortdesc": "Color map",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that fills each area with a color taken from a color map image",
|
||||
"name": "Fill to Color",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated output image",
|
||||
"rgba": "mix($edgecolor, $map(fract($(name_uv)_bb.xy+0.5*$(name_uv)_bb.zw)), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": {
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1
|
||||
},
|
||||
"label": "Edge Color",
|
||||
"longdesc": "The color used to draw outlines",
|
||||
"name": "edgecolor",
|
||||
"shortdesc": "Outline color",
|
||||
"type": "color"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to color"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_position",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"axis": 0
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec2 $(name_uv)_c = fract($in($uv).xy+0.5*$in($uv).zw);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that fills each area with a greyscale value that depends on its position",
|
||||
"name": "Fill to Position",
|
||||
"outputs": [
|
||||
{
|
||||
"f": "$axis",
|
||||
"longdesc": "The generated output image",
|
||||
"shortdesc": "Output",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 2,
|
||||
"label": "",
|
||||
"longdesc": "The position value to be used:\n- X for horizontal axis\n- Y for vertical axis\n- Radial for distance to center",
|
||||
"name": "axis",
|
||||
"shortdesc": "Position",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "X",
|
||||
"value": "$(name_uv)_c.x"
|
||||
},
|
||||
{
|
||||
"name": "Y",
|
||||
"value": "$(name_uv)_c.y"
|
||||
},
|
||||
{
|
||||
"name": "Radial",
|
||||
"value": "length($(name_uv)_c-vec2(0.5))"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to position"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,58 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_random_color",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"edgecolor": {
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1,
|
||||
"type": "Color"
|
||||
}
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that fills each area with a random color",
|
||||
"name": "Fill to Random Color ",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated output image",
|
||||
"rgb": "mix($edgecolor.rgb, rand3(vec2(float($seed), rand(vec2(rand($(name_uv)_bb.xy), rand($(name_uv)_bb.zw))))), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": {
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1
|
||||
},
|
||||
"label": "Edge Color",
|
||||
"longdesc": "The color used for outlines",
|
||||
"name": "edgecolor",
|
||||
"shortdesc": "Outline color",
|
||||
"type": "color"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to random color"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_random_grey",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"edgecolor": 1
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that fills each area with a random greyscale value",
|
||||
"name": "Fill to Random Grey",
|
||||
"outputs": [
|
||||
{
|
||||
"f": "mix($edgecolor, rand(vec2(float($seed), rand(vec2(rand($(name_uv)_bb.xy), rand($(name_uv)_bb.zw))))), step(0.0000001, dot($(name_uv)_bb.zw, vec2(1.0))))",
|
||||
"longdesc": "The generated output image",
|
||||
"shortdesc": "Output",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Edge color",
|
||||
"longdesc": "The value used for the outlines",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "edgecolor",
|
||||
"shortdesc": "Outline color",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to random grey"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,66 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_size",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"formula": 0
|
||||
},
|
||||
"seed_value": -52887,
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that fills each area with a greyscale value that depends on its size",
|
||||
"name": "Fill to Size",
|
||||
"outputs": [
|
||||
{
|
||||
"f": "$formula",
|
||||
"longdesc": "The generated output image",
|
||||
"shortdesc": "Output",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0,
|
||||
"label": "",
|
||||
"longdesc": "The size value to be used (area, width, height or maximum between width and height)",
|
||||
"name": "formula",
|
||||
"shortdesc": "Size",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Area",
|
||||
"value": "sqrt($(name_uv)_bb.z*$(name_uv)_bb.w)"
|
||||
},
|
||||
{
|
||||
"name": "Width",
|
||||
"value": "$(name_uv)_bb.z"
|
||||
},
|
||||
{
|
||||
"name": "Height",
|
||||
"value": "$(name_uv)_bb.w"
|
||||
},
|
||||
{
|
||||
"name": "max(W, H)",
|
||||
"value": "max($(name_uv)_bb.z, $(name_uv)_bb.w)"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to size"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,57 +0,0 @@
|
||||
{
|
||||
"name": "fill_to_uv",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"mode": 0
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_bb = $in($uv);",
|
||||
"global": "vec3 fill_to_uv_stretch(vec2 coord, vec4 bb, float seed) {\n\tvec2 uv_islands = fract(coord-bb.xy)/bb.zw;\n\tfloat random_value = rand(vec2(seed)+bb.xy+bb.zw);\n\treturn vec3(uv_islands, random_value);\n}\n\nvec3 fill_to_uv_square(vec2 coord, vec4 bb, float seed) {\n\tvec2 uv_islands;\n\tif (bb.z > bb.w) {\n\t\tvec2 adjusted_coord = coord + vec2(0.0, (bb.z - bb.w) / 2.0);\n\t\tuv_islands = fract(adjusted_coord-bb.xy)/bb.zz;\n\t} else {\n\t\tvec2 adjusted_coord = coord + vec2((bb.w - bb.z) / 2.0, 0.0);\n\t\tuv_islands = fract(adjusted_coord-bb.xy)/bb.ww;\n\t}\n\tfloat random_value = rand(vec2(seed)+bb.xy+bb.zw);\n\treturn vec3(uv_islands, random_value);\n}",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input fill data, to be connected to the output of a Fill node",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "A fill companion node that generated an UV map that follows each filled area",
|
||||
"name": "Fill to UV ",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated output UV map, to be connected to a Custom UV node",
|
||||
"rgb": "fill_to_uv_$mode($uv, $(name_uv)_bb, float($seed))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0,
|
||||
"label": "",
|
||||
"longdesc": "The mode decides how the UVs are layed out on each bounding box:\n- Stretch mode where the UV layout is stretched to the bounding box. \n- Square mode where the UV layout is even and centerered based on the longest axis of the bounding box.",
|
||||
"name": "mode",
|
||||
"shortdesc": "Mode",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Stretch",
|
||||
"value": "stretch"
|
||||
},
|
||||
{
|
||||
"name": "Square",
|
||||
"value": "square"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"shortdesc": "Fill to UV"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
File diff suppressed because one or more lines are too long
@ -1,233 +0,0 @@
|
||||
{
|
||||
"export": {
|
||||
|
||||
},
|
||||
"name": "material_dynamic",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"albedo_color": {
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1,
|
||||
"type": "Color"
|
||||
},
|
||||
"ao": 1,
|
||||
"depth_scale": 0.5,
|
||||
"emission_energy": 1,
|
||||
"flags_transparent": false,
|
||||
"metallic": 0,
|
||||
"normal": 1,
|
||||
"roughness": 1
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"custom": "",
|
||||
"exports": {
|
||||
"Godot": {
|
||||
"export_extension": "tres",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).tres",
|
||||
"template": "[gd_resource type=\"ShaderMaterial\" load_steps=2 format=2]\n[ext_resource path=\"$(file_prefix).shader\" type=\"Shader\" id=1]\n$begin_buffers\n[ext_resource path=\"res://$(file_prefix)_texture_$(buffer_index).png\" type=\"Texture\" id=$(expr:$(buffer_index)+1)]\n$end_buffers\n[resource]\nshader = ExtResource( 1 )\n$begin_buffers\nshader_param/texture_$(buffer_index) = ExtResource( $(expr:$(buffer_index)+1) )\n$end_buffers\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "shader_type spatial;\nuniform vec3 uv1_scale = vec3(1.0, 1.0, 1.0);\nuniform int depth_min_layers = 8;\nuniform int depth_max_layers = 16;\nuniform vec2 depth_flip = vec2(1.0);\nuniform float variation = 0.0;\nvarying float elapsed_time;\nvoid vertex() {\n\telapsed_time = TIME;\n}\n$definitions float_uniform_to_const,rename_buffers\nvoid fragment() {\n\tfloat _seed_variation_ = variation;\n\tvec2 uv = fract(UV*uv1_scale.xy);\n$if $(connected:depth_tex)\n$begin_generate rename_buffers\n\t{\n\t\tfloat depth_scale = 0.2*$depth_scale;\n\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*depth_flip.x,-BINORMAL*depth_flip.y,NORMAL));\n\t\tfloat num_layers = mix(float(depth_max_layers),float(depth_min_layers), abs(dot(vec3(0.0, 0.0, 1.0), view_dir)));\n\t\tfloat layer_depth = 1.0 / num_layers;\n\t\tfloat current_layer_depth = 0.0;\n\t\tvec2 P = view_dir.xy * depth_scale;\n\t\tvec2 delta = P / num_layers;\n\t\tvec2 ofs = uv;\n\t\tfloat depth = $depth_tex(ofs);\n\t\tfloat current_depth = 0.0;\n\t\twhile(current_depth < depth) {\n\t\t\tofs -= delta;\n\t\t\tdepth = $depth_tex(ofs);\n\t\t\tcurrent_depth += layer_depth;\n\t\t}\n\t\tvec2 prev_ofs = ofs + delta;\n\t\tfloat after_depth = depth - current_depth;\n\t\tfloat before_depth = $depth_tex(prev_ofs) - current_depth + layer_depth;\n\t\tfloat weight = after_depth / (after_depth - before_depth);\n\t\tofs = mix(ofs,prev_ofs,weight);\n\t\tuv = ofs;\n\t}\n$end_generate\n$fi\n$begin_generate rename_buffers\n\tvec3 albedo_tex = $albedo_tex(uv).rgb;\n\talbedo_tex = mix(pow((albedo_tex + vec3(0.055)) * (1.0 / (1.0 + 0.055)),vec3(2.4)),albedo_tex * (1.0 / 12.92),lessThan(albedo_tex,vec3(0.04045)));\n\tALBEDO = albedo_tex*$albedo_color.rgb;\n\tMETALLIC = $metallic_tex(uv)*$metallic;\n\tROUGHNESS = $roughness_tex(uv)*$roughness;\n\tNORMALMAP = $normal_tex(uv);\n\tEMISSION = $emission_tex(uv)*$emission_energy;\n\tALPHA = $opacity_tex(uv);\n$end_generate\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unity": {
|
||||
"export_extension": "mat",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "Shader \"Custom/NewSurfaceShader\"\n{\n Properties {\n$begin_buffers\n\t texture_$(buffer_index) (\"Texture $(buffer_index)\", 2D) = \"white\" {}\n$end_buffers\n\t _MainTex (\"Foo\", 2D) = \"white\" {}\n }\n SubShader {\n Tags { \"RenderType\"=\"Opaque\" }\n LOD 200\n CGPROGRAM\n #pragma surface surf Standard fullforwardshadows\n #pragma target 3.0\n\t\t\n sampler2D _MainTex;\n struct Input {\n float2 uv_MainTex;\n };\n UNITY_INSTANCING_BUFFER_START(Props)\n UNITY_INSTANCING_BUFFER_END(Props)\n\t\t\n$definitions hlsl,rename_buffers,unity\n\t\t\n void surf (Input IN, inout SurfaceOutputStandard o) {\n\t\t\tfloat2 uv = IN.uv_MainTex;\n$begin_generate hlsl,rename_buffers,unity\n\t\t\to.Albedo = $albedo_tex(uv).rgb*$albedo_color.rgb;\n o.Metallic = $metallic_tex(uv)*$metallic;\n o.Smoothness = 1.0-$roughness_tex(uv)*$roughness;\n o.Alpha = 1.0;\n\t\t\to.Normal = $normal_tex(uv)*vec3(-1.0, 1.0, -1.0)+vec3(1.0, 0.0, 1.0);\n$end_generate\n }\n ENDCG\n }\n FallBack \"Diffuse\"\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(tex_$(buffer_index))\nTextureImporter:\n internalIDToNameTable: []\n externalObjects: {}\n serializedVersion: 11\n mipmaps:\n mipMapMode: 0\n enableMipMap: 1\n sRGBTexture: 1\n linearTexture: 0\n fadeOut: 0\n borderMipMap: 0\n mipMapsPreserveCoverage: 0\n alphaTestReferenceValue: 0.5\n mipMapFadeDistanceStart: 1\n mipMapFadeDistanceEnd: 3\n bumpmap:\n convertToNormalMap: 0\n externalNormalMap: 0\n heightScale: 0.25\n normalMapFilter: 0\n isReadable: 0\n streamingMipmaps: 0\n streamingMipmapsPriority: 0\n vTOnly: 0\n grayScaleToAlpha: 0\n generateCubemap: 6\n cubemapConvolution: 0\n seamlessCubemap: 0\n textureFormat: 1\n maxTextureSize: 2048\n textureSettings:\n serializedVersion: 2\n filterMode: -1\n aniso: -1\n mipBias: -100\n wrapU: -1\n wrapV: -1\n wrapW: -1\n nPOTScale: 1\n lightmap: 0\n compressionQuality: 50\n spriteMode: 0\n spriteExtrude: 1\n spriteMeshType: 1\n alignment: 0\n spritePivot: {x: 0.5, y: 0.5}\n spritePixelsToUnits: 100\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spriteGenerateFallbackPhysicsShape: 1\n alphaUsage: 1\n alphaIsTransparency: 0\n spriteTessellationDetail: -1\n textureType: 0\n textureShape: 1\n singleChannelComponent: 0\n flipbookRows: 1\n flipbookColumns: 1\n maxTextureSizeSet: 0\n compressionQualitySet: 0\n textureFormatSet: 0\n ignorePngGamma: 0\n applyGammaDecoding: 0\n platformSettings:\n - serializedVersion: 3\n buildTarget: DefaultTexturePlatform\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: -1\n textureCompression: 1\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 0\n androidETC2FallbackOverride: 0\n forceMaximumCompressionQuality_BC6H_BC7: 0\n spriteSheet:\n serializedVersion: 2\n sprites: []\n outline: []\n physicsShape: []\n bones: []\n spriteID: \n internalID: 0\n vertices: []\n indices: \n edges: []\n weights: []\n secondaryTextures: []\n spritePackingTag: \n pSDRemoveMatte: 0\n pSDShowRemoveMatteOption: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "buffer_templates"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).mat",
|
||||
"template": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!21 &2100000\nMaterial:\n serializedVersion: 6\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_Name: test2\n m_Shader: {fileID: 4800000, guid: $uid(shader), type: 3}\n m_ShaderKeywords: \n m_LightmapFlags: 4\n m_EnableInstancingVariants: 0\n m_DoubleSidedGI: 0\n m_CustomRenderQueue: -1\n stringTagMap: {}\n disabledShaderPasses: []\n m_SavedProperties:\n serializedVersion: 3\n m_TexEnvs:\n - _MainTex:\n m_Texture: {fileID: 2800000, guid: 6c5d2d4e94384751a0ce7d6619e0d49a, type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$begin_buffers\n - texture_$(buffer_index):\n m_Texture: {fileID: 2800000, guid: $uid(tex_$(buffer_index)), type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$end_buffers\n m_BuildTextureStacks: []\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(shader)\nShaderImporter:\n externalObjects: {}\n defaultTextures: []\n nonModifiableTextures: []\n preprocessorOverride: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unreal": {
|
||||
"export_extension": "mm2ue",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).mm2ue",
|
||||
"template": "/*\nInstructions to setup this material:\n- copy material_dynamic.uasset and open the copy\n$begin_buffers\n- create a TextureObject for $(file_prefix)_texture_$(buffer_index).png in the graph\n and a new input for texture_$(buffer_index) in the custom node, and connect them\n$end_buffers\n- copy the shader code below and paste it into the Custom node\n*/\nstruct Functions {\n$definitions hlsl,rename_buffers,unreal\n\tfixed4 generated_shader(float2 uv, out float metallic, out float roughness, out float3 normal) {\n$begin_generate hlsl,rename_buffers,unreal\n // sample the generated texture\n\t\tfixed4 rv = tofloat4($albedo_tex(uv), 1.0)*$albedo_color;\n\t\tmetallic = $metallic_tex(uv)*$metallic;\n\t\troughness = $roughness_tex(uv)*$roughness;\n\t\tnormal = $normal_tex(uv)*float3(-1.0, -1.0, -1.0)+float3(1.0, 1.0, 1.0);\n return rv;\n$end_generate\n }\n};\nFunctions f;\nfixed4 albedo = f.generated_shader(TexCoords, metallic, roughness, normal);\nreturn albedo;\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"group_size": 7,
|
||||
"label": "",
|
||||
"name": "albedo_tex",
|
||||
"type": "rgb"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"label": "",
|
||||
"name": "metallic_tex",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"label": "",
|
||||
"name": "roughness_tex",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.0)",
|
||||
"label": "",
|
||||
"name": "emission_tex",
|
||||
"type": "rgb"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"name": "normal_tex",
|
||||
"type": "rgb"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"label": "",
|
||||
"name": "ao_tex",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "0.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"name": "depth_tex",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"label": "",
|
||||
"name": "opacity_tex",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"name": "Dynamic PBR Material",
|
||||
"outputs": [
|
||||
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": {
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 1,
|
||||
"r": 1
|
||||
},
|
||||
"label": "Albedo",
|
||||
"name": "albedo_color",
|
||||
"type": "color"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Metallic",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "metallic",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Roughness",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "roughness",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Emission",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "emission_energy",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Normal",
|
||||
"max": 10,
|
||||
"min": 0,
|
||||
"name": "normal",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Ambient occlusion",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "ao",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Depth",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "depth_scale",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"default": false,
|
||||
"label": "Transparency",
|
||||
"name": "flags_transparent",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"preview_shader": "shader_type spatial;\nrender_mode blend_mix,depth_draw_alpha_prepass,cull_back,diffuse_burley,specular_schlick_ggx;\n\nuniform vec3 uv1_offset = vec3(1.0, 1.0, 1.0);\nuniform vec3 uv1_scale = vec3(1.0, 1.0, 1.0);\nuniform int depth_min_layers = 8;\nuniform int depth_max_layers = 32;\nuniform vec2 depth_flip = vec2(1.0);\nuniform float variation = 0.0;\n\nvarying float elapsed_time;\n\nvoid vertex() {\n\telapsed_time = TIME;\n\tUV = UV*uv1_scale.xy+uv1_offset.xy;\n}\n\n//---\n\n\n$definitions\n\nvoid fragment() {\n\tfloat _seed_variation_ = variation;\n\tvec2 uv = fract(UV);\n$begin_generate\n\t{\n\t\tfloat depth_scale = 0.2*$depth_scale;\n\t\tvec3 view_dir = normalize(normalize(-VERTEX)*mat3(TANGENT*depth_flip.x,-BINORMAL*depth_flip.y,NORMAL));\n\t\tfloat num_layers = mix(float(depth_max_layers),float(depth_min_layers), abs(dot(vec3(0.0, 0.0, 1.0), view_dir)));\n\t\tfloat layer_depth = 1.0 / num_layers;\n\t\tfloat current_layer_depth = 0.0;\n\t\tvec2 P = view_dir.xy * depth_scale;\n\t\tvec2 delta = P / num_layers;\n\t\tvec2 ofs = uv;\n\t\tfloat depth = $depth_tex(ofs);\n\t\tfloat current_depth = 0.0;\n\t\twhile(current_depth < depth) {\n\t\t\tofs -= delta;\n\t\t\tdepth = $depth_tex(ofs);\n\t\t\tcurrent_depth += layer_depth;\n\t\t}\n\t\tvec2 prev_ofs = ofs + delta;\n\t\tfloat after_depth = depth - current_depth;\n\t\tfloat before_depth = $depth_tex(prev_ofs) - current_depth + layer_depth;\n\t\tfloat weight = after_depth / (after_depth - before_depth);\n\t\tofs = mix(ofs,prev_ofs,weight);\n\t\tuv = ofs;\n\t}\n$end_generate\n$begin_generate\n\tvec3 albedo_tex = $albedo_tex(uv);\n\talbedo_tex = mix(pow((albedo_tex + vec3(0.055)) * (1.0 / (1.0 + 0.055)),vec3(2.4)),albedo_tex * (1.0 / 12.92),lessThan(albedo_tex,vec3(0.04045)));\n\tALBEDO = albedo_tex.rgb*$albedo_color.rgb;\n\tMETALLIC = $metallic_tex(uv)*$metallic;\n\tROUGHNESS = $roughness_tex(uv)*$roughness;\n\tNORMALMAP = $normal_tex(uv);\n\tNORMALMAP_DEPTH = $normal;\n\tEMISSION = $emission_tex(uv)*$emission_energy;\n\tAO = $ao*$ao_tex(uv);\n\tif ($flags_transparent) {\n\t\tALPHA = $opacity_tex(uv);\n\t}\n$end_generate\n}\n"
|
||||
},
|
||||
"type": "material_export"
|
||||
}
|
@ -1,124 +0,0 @@
|
||||
{
|
||||
"export": {
|
||||
|
||||
},
|
||||
"name": "material_raymarching",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"seed": 12723,
|
||||
"seed_locked": false,
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"custom": "",
|
||||
"exports": {
|
||||
"Godot": {
|
||||
"export_extension": "tres",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).tres",
|
||||
"template": "[gd_resource type=\"ShaderMaterial\" load_steps=2 format=2]\n[ext_resource path=\"$(file_prefix).shader\" type=\"Shader\" id=1]\n$begin_buffers\n[ext_resource path=\"res://$(file_prefix)_texture_$(buffer_index).png\" type=\"Texture\" id=$(expr:$(buffer_index)+1)]\n$end_buffers\n[resource]\nshader = ExtResource( 1 )\n$begin_buffers\nshader_param/texture_$(buffer_index) = ExtResource( $(expr:$(buffer_index)+1) )\n$end_buffers\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "shader_type spatial;\nvarying float elapsed_time;\nvarying vec3 world_camera;\nvarying vec3 world_position;\nconst int MAX_STEPS = 100;\nconst float MAX_DIST = 100.0;\nconst float SURF_DIST = 1e-3;\n$definitions float_uniform_to_const,rename_buffers\nvec2 GetDist(vec3 p) {\n\tfloat _seed_variation_ = 0.0;\n\t\n$begin_generate rename_buffers\n\tvec2 d = $distance(p);\n$end_generate\n\treturn d;\n}\nvec2 RayMarch(vec3 ro, vec3 rd) {\n\tfloat dO = 0.0;\n\tfloat color = 0.0;\n\tvec2 dS;\n\t\n\tfor (int i = 0; i < MAX_STEPS; i++) {\n\t\tvec3 p = ro + dO * rd;\n\t\tdS = GetDist(p);\n\t\tdO += dS.x;\n\t\t\n\t\tif (dS.x < SURF_DIST || dO > MAX_DIST) {\n\t\t\tcolor = dS.y;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn vec2(dO, color);\n}\nvec3 GetNormal(vec3 p) {\n\tvec2 e = vec2(1e-2, 0);\n\t\n\tvec3 n = GetDist(p).x - vec3(\n\t\tGetDist(p - e.xyy).x,\n\t\tGetDist(p - e.yxy).x,\n\t\tGetDist(p - e.yyx).x\n\t);\n\t\n\treturn normalize(n);\n}\nvoid vertex() {\n\telapsed_time = TIME;\n\tworld_position = VERTEX;\n\tworld_camera = (inverse(MODELVIEW_MATRIX) * vec4(0, 0, 0, 1)).xyz; //object space\n\t//world_camera = ( CAMERA_MATRIX * vec4(0, 0, 0, 1)).xyz; //uncomment this to raymarch in world space\n}\nvoid fragment() {\n\tfloat _seed_variation_ = 0.0;\n\t\n\tvec3 ro = world_camera;\n\tvec3 rd = normalize(world_position - ro);\n\t\n\tvec2 rm = RayMarch(ro, rd);\n\tfloat d = rm.x;\n\tif (d >= MAX_DIST) {\n\t\tdiscard;\n\t} else {\n\t\tvec3 p = ro + rd * d;\n$begin_generate rename_buffers\n\t\tALBEDO = $albedo(vec4(p, rm.y));\n\t\tROUGHNESS = $roughness(vec4(p, rm.y)).x;\n\t\tMETALLIC = $metallic(vec4(p, rm.y)).x;\n$end_generate\n\t\tNORMAL = (INV_CAMERA_MATRIX*WORLD_MATRIX*vec4(GetNormal(p), 0.0)).xyz;\n\t}\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unity": {
|
||||
"export_extension": "mat",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "Shader \"Custom/NewSurfaceShader\"\n{\n Properties {\n$begin_buffers\n\t texture_$(buffer_index) (\"Texture $(buffer_index)\", 2D) = \"white\" {}\n$end_buffers\n }\n SubShader\n {\n Tags { \"RenderType\"=\"Opaque\" }\n LOD 200\n CGPROGRAM\n // Physically based Standard lighting model, and enable shadows on all light types\n #pragma surface surf Standard fullforwardshadows\n // Use shader model 3.0 target, to get nicer looking lighting\n #pragma target 3.0\n struct Input\n {\n float3 worldPos;\n float3 viewDir;\n };\n UNITY_INSTANCING_BUFFER_START(Props)\n // put more per-instance properties here\n UNITY_INSTANCING_BUFFER_END(Props)\n$definitions hlsl,rename_buffers,unity\n float2 sceneSDF(float3 p) {\n$begin_generate hlsl,rename_buffers,unity\n return $distance(p);\n$end_generate\n }\n#define MAX_STEPS 128\n#define SURF_DIST 0.001\n#define MAX_DIST 1000.0\n float2 RayMarch(float3 ro, float3 rd) {\n float dO = 0.0;\n float color = 0.0;\n float2 dS;\n \n for (int i = 0; i < MAX_STEPS; i++) {\n float3 p = ro + dO * rd;\n dS = sceneSDF(p);\n dO += dS.x;\n \n if (dS.x < SURF_DIST || dO > MAX_DIST) {\n color = dS.y;\n break;\n }\n }\n return float2(dO, color);\n }\n float3 GetNormal(float3 p) {\n float2 e = float2(1e-2, 0);\n \n float3 n = sceneSDF(p).x - float3(\n sceneSDF(p - e.xyy).x,\n sceneSDF(p - e.yxy).x,\n sceneSDF(p - e.yyx).x\n );\n \n return normalize(n);\n }\n void surf (Input IN, inout SurfaceOutputStandard o) {\n float3 ro = mul(unity_WorldToObject, float4(_WorldSpaceCameraPos, 1.0));\n float3 rd = normalize(mul(unity_WorldToObject, float4(IN.worldPos, 1.0))-ro);\n float2 dist = RayMarch(ro, rd);\n if (dist.x > 99.0) {\n discard;\n }\n float3 p = ro+rd*dist.x;\n$begin_generate hlsl,rename_buffers,unity\n o.Albedo = $albedo(vec4(p, dist.y));\n o.Metallic = $metallic(vec4(p, dist.y)).x;\n o.Smoothness = 1.0-$roughness(vec4(p, dist.y)).x;\n o.Normal = GetNormal(p);\n$end_generate\n }\n ENDCG\n }\n FallBack \"Diffuse\"\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(tex_$(buffer_index))\nTextureImporter:\n internalIDToNameTable: []\n externalObjects: {}\n serializedVersion: 11\n mipmaps:\n mipMapMode: 0\n enableMipMap: 1\n sRGBTexture: 1\n linearTexture: 0\n fadeOut: 0\n borderMipMap: 0\n mipMapsPreserveCoverage: 0\n alphaTestReferenceValue: 0.5\n mipMapFadeDistanceStart: 1\n mipMapFadeDistanceEnd: 3\n bumpmap:\n convertToNormalMap: 0\n externalNormalMap: 0\n heightScale: 0.25\n normalMapFilter: 0\n isReadable: 0\n streamingMipmaps: 0\n streamingMipmapsPriority: 0\n vTOnly: 0\n grayScaleToAlpha: 0\n generateCubemap: 6\n cubemapConvolution: 0\n seamlessCubemap: 0\n textureFormat: 1\n maxTextureSize: 2048\n textureSettings:\n serializedVersion: 2\n filterMode: -1\n aniso: -1\n mipBias: -100\n wrapU: -1\n wrapV: -1\n wrapW: -1\n nPOTScale: 1\n lightmap: 0\n compressionQuality: 50\n spriteMode: 0\n spriteExtrude: 1\n spriteMeshType: 1\n alignment: 0\n spritePivot: {x: 0.5, y: 0.5}\n spritePixelsToUnits: 100\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spriteGenerateFallbackPhysicsShape: 1\n alphaUsage: 1\n alphaIsTransparency: 0\n spriteTessellationDetail: -1\n textureType: 0\n textureShape: 1\n singleChannelComponent: 0\n flipbookRows: 1\n flipbookColumns: 1\n maxTextureSizeSet: 0\n compressionQualitySet: 0\n textureFormatSet: 0\n ignorePngGamma: 0\n applyGammaDecoding: 0\n platformSettings:\n - serializedVersion: 3\n buildTarget: DefaultTexturePlatform\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: -1\n textureCompression: 1\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 0\n androidETC2FallbackOverride: 0\n forceMaximumCompressionQuality_BC6H_BC7: 0\n spriteSheet:\n serializedVersion: 2\n sprites: []\n outline: []\n physicsShape: []\n bones: []\n spriteID: \n internalID: 0\n vertices: []\n indices: \n edges: []\n weights: []\n secondaryTextures: []\n spritePackingTag: \n pSDRemoveMatte: 0\n pSDShowRemoveMatteOption: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "buffer_templates"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).mat",
|
||||
"template": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!21 &2100000\nMaterial:\n serializedVersion: 6\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_Name: test2\n m_Shader: {fileID: 4800000, guid: $uid(shader), type: 3}\n m_ShaderKeywords: \n m_LightmapFlags: 4\n m_EnableInstancingVariants: 0\n m_DoubleSidedGI: 0\n m_CustomRenderQueue: -1\n stringTagMap: {}\n disabledShaderPasses: []\n m_SavedProperties:\n serializedVersion: 3\n m_TexEnvs:\n - _MainTex:\n m_Texture: {fileID: 2800000, guid: 6c5d2d4e94384751a0ce7d6619e0d49a, type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$begin_buffers\n - texture_$(buffer_index):\n m_Texture: {fileID: 2800000, guid: $uid(tex_$(buffer_index)), type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$end_buffers\n m_BuildTextureStacks: []\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(shader)\nShaderImporter:\n externalObjects: {}\n defaultTextures: []\n nonModifiableTextures: []\n preprocessorOverride: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unreal": {
|
||||
"export_extension": "mm2ue",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).mm2ue",
|
||||
"template": "/*\nInstructions to setup this material:\n- copy material_raymarching.uasset and open the copy\n- copy the shader code below and paste it into the Custom node\n$begin_buffers\n- create a TextureObject for $(file_prefix)_texture_$(buffer_index).png in the graph\n and a new input for texture_$(buffer_index) in the custom node, and connect them\n$end_buffers\n*/\nstruct Functions {\n$definitions hlsl,rename_buffers,unreal\n float2 sceneSDF(float3 p) {\n\t\tp = p.xzy/Scale;\n$begin_generate hlsl,rename_buffers,unreal\n\t\tfloat2 d = $distance(p);\n$end_generate\n return float2(d.x*Scale, d.y);\n }\n#define MAX_STEPS 128\n#define SURF_DIST 0.1\n#define MAX_DIST 1000.0\n float2 RayMarch(float3 ro, float3 rd) {\n float dO = 0.0;\n float color = 0.0;\n float2 dS;\n \n for (int i = 0; i < MAX_STEPS; i++) {\n float3 p = ro + dO * rd;\n dS = sceneSDF(p);\n dO += dS.x;\n \n if (dS.x < SURF_DIST || dO > MAX_DIST) {\n color = dS.y;\n break;\n }\n }\n return float2(dO, color);\n }\n float3 GetNormal(float3 p) {\n float2 e = float2(1e-2, 0);\n \n float3 n = sceneSDF(p).x - float3(\n sceneSDF(p - e.xyy).x,\n sceneSDF(p - e.yxy).x,\n sceneSDF(p - e.yyx).x\n );\n \n return normalize(n);\n }\n float4 generated_shader(float3 CameraPosition, float3 RayDirection, out float metallic, out float roughness, out float3 normal) {\n float3 ro = CameraPosition;\n float3 rd = RayDirection;\n float2 dist = RayMarch(ro, rd);\n\t\tfloat3 p = ro+dist.x*rd;\n\t\tfloat4 pc = tofloat4(p.xzy/Scale, dist.y);\n\t\tfloat alpha = (dist < MAX_DIST) ? 1.0 : 0.0;\n$begin_generate hlsl,rename_buffers,unreal\n float4 albedo = tofloat4($albedo(pc), alpha);\n metallic = $metallic(pc).x;\n roughness = $roughness(pc).x;\n$end_generate\n normal = GetNormal(p.xzy);\n return albedo;\n }\n};\nFunctions f;\nfloat4 albedo = f.generated_shader(CameraPosition, RayDirection, metallic, roughness, normal);\nreturn albedo;\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(file_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec2(0.0)",
|
||||
"function": true,
|
||||
"label": "Distance",
|
||||
"name": "distance",
|
||||
"type": "sdf3dc"
|
||||
},
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"function": true,
|
||||
"label": "Albedo",
|
||||
"name": "albedo",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.0)",
|
||||
"function": true,
|
||||
"label": "Metallic",
|
||||
"name": "metallic",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"function": true,
|
||||
"label": "Roughness",
|
||||
"name": "roughness",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"name": "Raymarching Material",
|
||||
"outputs": [
|
||||
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"preview_shader": "shader_type spatial;\n\nvarying float elapsed_time;\n\nvarying vec3 world_camera;\nvarying vec3 world_position;\n\nconst int MAX_STEPS = 100;\nconst float MAX_DIST = 100.0;\nconst float SURF_DIST = 1e-3;\n\n$definitions\n\nvec2 GetDist(vec3 p) {\n\tfloat _seed_variation_ = 0.0;\n\t\n$begin_generate\n\tvec2 d = $distance(p);\n$end_generate\n\n\treturn d;\n}\n\nvec2 RayMarch(vec3 ro, vec3 rd) {\n\tfloat dO = 0.0;\n\tfloat color = 0.0;\n\tvec2 dS;\n\t\n\tfor (int i = 0; i < MAX_STEPS; i++)\n\t{\n\t\tvec3 p = ro + dO * rd;\n\t\tdS = GetDist(p);\n\t\tdO += dS.x;\n\t\t\n\t\tif (dS.x < SURF_DIST || dO > MAX_DIST) {\n\t\t\tcolor = dS.y;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn vec2(dO, color);\n}\n\nvec3 GetNormal(vec3 p) {\n\tvec2 e = vec2(1e-2, 0);\n\t\n\tvec3 n = GetDist(p).x - vec3(\n\t\tGetDist(p - e.xyy).x,\n\t\tGetDist(p - e.yxy).x,\n\t\tGetDist(p - e.yyx).x\n\t);\n\t\n\treturn normalize(n);\n}\n\nvoid vertex() {\n\telapsed_time = TIME;\n\tworld_position = VERTEX;\n\tworld_camera = (inverse(MODELVIEW_MATRIX) * vec4(0, 0, 0, 1)).xyz; //object space\n\t//world_camera = ( CAMERA_MATRIX * vec4(0, 0, 0, 1)).xyz; //uncomment this to raymarch in world space\n}\n\nvoid fragment() {\n\tfloat _seed_variation_ = 0.0;\n\t\n\tvec3 ro = world_camera;\n\tvec3 rd = normalize(world_position - ro);\n\t\n\tvec2 rm = RayMarch(ro, rd);\n\tfloat d = rm.x;\n\n\tif (d >= MAX_DIST)\n\t\tdiscard;\n\telse\n\t{\n\t\tvec3 p = ro + rd * d;\n$begin_generate\n\t\tALBEDO = $albedo(vec4(p, rm.y));\n\t\tROUGHNESS = $roughness(vec4(p, rm.y)).x;\n\t\tMETALLIC = $metallic(vec4(p, rm.y)).x;\n$end_generate\n\t\tNORMAL = (INV_CAMERA_MATRIX*WORLD_MATRIX*vec4(GetNormal(p), 0.0)).xyz;\n\t}\n}\n"
|
||||
},
|
||||
"type": "material_export"
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
{
|
||||
"export": {
|
||||
|
||||
},
|
||||
"name": "material_unlit",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"blend": 0
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"custom": "",
|
||||
"exports": {
|
||||
"Godot": {
|
||||
"export_extension": "tres",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).tres",
|
||||
"template": "[gd_resource type=\"ShaderMaterial\" load_steps=2 format=2]\n[ext_resource path=\"$(file_prefix).shader\" type=\"Shader\" id=1]\n$begin_buffers\n[ext_resource path=\"res://$(file_prefix)_texture_$(buffer_index).png\" type=\"Texture\" id=$(expr:$(buffer_index)+1)]\n$end_buffers\n[resource]\nshader = ExtResource( 1 )\n$begin_buffers\nshader_param/texture_$(buffer_index) = ExtResource( $(expr:$(buffer_index)+1) )\n$end_buffers\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "shader_type spatial;\n$begin_generate\nrender_mode unshaded, blend_$blend;\n$end_generate\n\nuniform vec3 uv1_scale = vec3(1.0, 1.0, 1.0);\nuniform vec3 uv1_offset = vec3(0.0, 0.0, 0.0);\nuniform float variation = 0.0;\n\nvarying float elapsed_time;\nvoid vertex() {\n\telapsed_time = TIME;\n\tUV = UV*uv1_scale.xy+uv1_offset.xy;\n}\n\n$definitions float_uniform_to_const,rename_buffers\n\nvoid fragment() {\n\tfloat _seed_variation_ = variation;\n\tvec2 uv = fract(UV);\n$begin_generate rename_buffers\n\tvec4 color_tex = $color_tex(uv);\n\tcolor_tex = mix(pow((color_tex + vec4(0.055)) * (1.0 / (1.0 + 0.055)),vec4(2.4)),color_tex * (1.0 / 12.92),lessThan(color_tex,vec4(0.04045)));\n\tALBEDO = color_tex.rgb;\n\tALPHA = color_tex.a;\n$end_generate\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unity": {
|
||||
"export_extension": "mat",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).shader",
|
||||
"template": "Shader \"Unlit/NewUnlitShader\"\n{\n Properties\n {\n }\n SubShader\n {\n Tags { \"RenderType\"=\"Opaque\" }\n LOD 100\n Pass\n {\n \tBlend One One\n CGPROGRAM\n #pragma vertex vert\n #pragma fragment frag\n // make fog work\n #pragma multi_compile_fog\n #include \"UnityCG.cginc\"\n struct appdata\n {\n float4 vertex : POSITION;\n float2 uv : TEXCOORD0;\n };\n struct v2f\n {\n float2 uv : TEXCOORD0;\n UNITY_FOG_COORDS(1)\n float4 vertex : SV_POSITION;\n };\n$definitions hlsl,rename_buffers,unity\n\t\t\n\t\t\tv2f vert (appdata v) {\n\t\t\t\tv2f o;\n\t\t\t\to.vertex = UnityObjectToClipPos(v.vertex);\n\t\t\t\to.uv = v.uv;\n\t\t\t\tUNITY_TRANSFER_FOG(o,o.vertex);\n\t\t\t\treturn o;\n\t\t\t}\n\t\t\tfixed4 frag (v2f i) : SV_Target {\n\t\t\t\tfloat2 uv = i.uv;\n$begin_generate hlsl,rename_buffers,unity\n // sample the generated texture\n fixed4 col = $color_tex(uv);\n$end_generate\n // apply fog\n UNITY_APPLY_FOG(i.fogCoord, col);\n return col;\n }\n ENDCG\n }\n }\n}\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png",
|
||||
"type": "buffers"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix)_texture_$(buffer_index).png.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(tex_$(buffer_index))\nTextureImporter:\n internalIDToNameTable: []\n externalObjects: {}\n serializedVersion: 11\n mipmaps:\n mipMapMode: 0\n enableMipMap: 1\n sRGBTexture: 1\n linearTexture: 0\n fadeOut: 0\n borderMipMap: 0\n mipMapsPreserveCoverage: 0\n alphaTestReferenceValue: 0.5\n mipMapFadeDistanceStart: 1\n mipMapFadeDistanceEnd: 3\n bumpmap:\n convertToNormalMap: 0\n externalNormalMap: 0\n heightScale: 0.25\n normalMapFilter: 0\n isReadable: 0\n streamingMipmaps: 0\n streamingMipmapsPriority: 0\n vTOnly: 0\n grayScaleToAlpha: 0\n generateCubemap: 6\n cubemapConvolution: 0\n seamlessCubemap: 0\n textureFormat: 1\n maxTextureSize: 2048\n textureSettings:\n serializedVersion: 2\n filterMode: -1\n aniso: -1\n mipBias: -100\n wrapU: -1\n wrapV: -1\n wrapW: -1\n nPOTScale: 1\n lightmap: 0\n compressionQuality: 50\n spriteMode: 0\n spriteExtrude: 1\n spriteMeshType: 1\n alignment: 0\n spritePivot: {x: 0.5, y: 0.5}\n spritePixelsToUnits: 100\n spriteBorder: {x: 0, y: 0, z: 0, w: 0}\n spriteGenerateFallbackPhysicsShape: 1\n alphaUsage: 1\n alphaIsTransparency: 0\n spriteTessellationDetail: -1\n textureType: 0\n textureShape: 1\n singleChannelComponent: 0\n flipbookRows: 1\n flipbookColumns: 1\n maxTextureSizeSet: 0\n compressionQualitySet: 0\n textureFormatSet: 0\n ignorePngGamma: 0\n applyGammaDecoding: 0\n platformSettings:\n - serializedVersion: 3\n buildTarget: DefaultTexturePlatform\n maxTextureSize: 2048\n resizeAlgorithm: 0\n textureFormat: -1\n textureCompression: 1\n compressionQuality: 50\n crunchedCompression: 0\n allowsAlphaSplitting: 0\n overridden: 0\n androidETC2FallbackOverride: 0\n forceMaximumCompressionQuality_BC6H_BC7: 0\n spriteSheet:\n serializedVersion: 2\n sprites: []\n outline: []\n physicsShape: []\n bones: []\n spriteID: \n internalID: 0\n vertices: []\n indices: \n edges: []\n weights: []\n secondaryTextures: []\n spritePackingTag: \n pSDRemoveMatte: 0\n pSDShowRemoveMatteOption: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "buffer_templates"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).mat",
|
||||
"template": "%YAML 1.1\n%TAG !u! tag:unity3d.com,2011:\n--- !u!21 &2100000\nMaterial:\n serializedVersion: 6\n m_ObjectHideFlags: 0\n m_CorrespondingSourceObject: {fileID: 0}\n m_PrefabInstance: {fileID: 0}\n m_PrefabAsset: {fileID: 0}\n m_Name: test2\n m_Shader: {fileID: 4800000, guid: $uid(shader), type: 3}\n m_ShaderKeywords: \n m_LightmapFlags: 4\n m_EnableInstancingVariants: 0\n m_DoubleSidedGI: 0\n m_CustomRenderQueue: -1\n stringTagMap: {}\n disabledShaderPasses: []\n m_SavedProperties:\n serializedVersion: 3\n m_TexEnvs:\n - _MainTex:\n m_Texture: {fileID: 2800000, guid: 6c5d2d4e94384751a0ce7d6619e0d49a, type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$begin_buffers\n - texture_$(buffer_index):\n m_Texture: {fileID: 2800000, guid: $uid(tex_$(buffer_index)), type: 3}\n m_Scale: {x: 1, y: 1}\n m_Offset: {x: 0, y: 0}\n$end_buffers\n m_BuildTextureStacks: []\n",
|
||||
"type": "template"
|
||||
},
|
||||
{
|
||||
"file_name": "$(path_prefix).shader.meta",
|
||||
"template": "fileFormatVersion: 2\nguid: $uid(shader)\nShaderImporter:\n externalObjects: {}\n defaultTextures: []\n nonModifiableTextures: []\n preprocessorOverride: 0\n userData: \n assetBundleName: \n assetBundleVariant: \n",
|
||||
"type": "template"
|
||||
}
|
||||
]
|
||||
},
|
||||
"Unreal": {
|
||||
"export_extension": "mm2ue",
|
||||
"files": [
|
||||
{
|
||||
"file_name": "$(path_prefix).mm2ue",
|
||||
"template": "/*\nInstructions to setup this material:\n- copy material_unlit.uasset and open the copy\n$begin_buffers\n- create a TextureObject for $(file_prefix)_texture_$(buffer_index).png in the graph\n and a new input for texture_$(buffer_index) in the custom node, and connect them\n$end_buffers\n- copy the shader code below and paste it into the Custom node\n*/\nstruct Functions {\n$definitions hlsl,rename_buffers,unreal\n\tfixed4 generated_shader(float2 uv) {\n$begin_generate hlsl,rename_buffers,unreal\n // sample the generated texture\n return $color_tex(uv);\n$end_generate\n }\n};\nFunctions f;\nreturn f.generated_shader(TexCoords);\n",
|
||||
"type": "template"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(1.0)",
|
||||
"label": "",
|
||||
"name": "color_tex",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"name": "Dynamic Unlit Material",
|
||||
"outputs": [
|
||||
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0,
|
||||
"label": "Blend",
|
||||
"name": "blend",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Add",
|
||||
"value": "add"
|
||||
},
|
||||
{
|
||||
"name": "Mix",
|
||||
"value": "mix"
|
||||
},
|
||||
{
|
||||
"name": "Mul",
|
||||
"value": "mul"
|
||||
},
|
||||
{
|
||||
"name": "Sub",
|
||||
"value": "sub"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"preview_shader": "shader_type spatial;\n$begin_generate\nrender_mode unshaded, blend_$blend;\n$end_generate\n\nuniform vec3 uv1_scale = vec3(1.0, 1.0, 1.0);\nuniform vec3 uv1_offset = vec3(0.0, 0.0, 0.0);\nuniform float variation = 0.0;\n\nvarying float elapsed_time;\n\nvoid vertex() {\n\telapsed_time = TIME;\n\tUV = UV*uv1_scale.xy+uv1_offset.xy;\n}\n\n$definitions\n\nvoid fragment() {\n\tfloat _seed_variation_ = variation;\n\tvec2 uv = fract(UV);\n$begin_generate\n\tvec4 color_tex = $color_tex(uv);\n\tcolor_tex = mix(pow((color_tex + vec4(0.055)) * (1.0 / (1.0 + 0.055)),vec4(2.4)),color_tex * (1.0 / 12.92),lessThan(color_tex,vec4(0.04045)));\n\tALBEDO = color_tex.rgb;\n\tALPHA = color_tex.a;\n$end_generate\n\n}\n"
|
||||
},
|
||||
"type": "material_export"
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return vec4(vec3($(value)), 1.0);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return vec4($(value), 1.0);
|
||||
}
|
@ -1,7 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return $(value);
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
float d = $(value);
|
||||
vec3 col = vec3(cos(d*min(256, preview_size)));
|
||||
col *= clamp(1.0-d*d, 0.0, 1.0);
|
||||
col *= vec3(1.0, vec2(step(-0.015, d)));
|
||||
col *= vec3(vec2(step(d, 0.015)), 1.0);
|
||||
return vec4(col, 1.0);
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
float calcdist(vec3 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return min($(value), uv.z);
|
||||
}
|
||||
|
||||
float raymarch(vec3 ro, vec3 rd) {
|
||||
float d=0.0;
|
||||
for (int i = 0; i < 50; i++) {
|
||||
vec3 p = ro + rd*d;
|
||||
float dstep = calcdist(p);
|
||||
d += dstep;
|
||||
if (dstep < 0.0001) break;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
vec3 normal(vec3 p) {
|
||||
float d = calcdist(p);
|
||||
float e = .0001;
|
||||
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)), calcdist(p-vec3(0.0, e, 0.0)), calcdist(p-vec3(0.0, 0.0, e)));
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
uv -= vec2(0.5);
|
||||
vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
|
||||
vec3 n = normal(p);
|
||||
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||
vec3 ld = normalize(l-p);
|
||||
float o = step(p.z, 0.001);
|
||||
float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);
|
||||
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||
return vec4(vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light, 1.0);
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec2 calcdist(vec3 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
vec2 v = $(value);
|
||||
return vec2(min(v.x, uv.z), v.y);
|
||||
}
|
||||
|
||||
vec2 raymarch(vec3 ro, vec3 rd) {
|
||||
float d=0.0;
|
||||
float color;
|
||||
for (int i = 0; i < 50; i++) {
|
||||
vec3 p = ro + rd*d;
|
||||
vec2 dstep = calcdist(p);
|
||||
d += dstep.x;
|
||||
if (dstep.x < 0.0001) {
|
||||
color = dstep.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return vec2(d, color);
|
||||
}
|
||||
vec3 normal(vec3 p) {
|
||||
float d = calcdist(p).x;
|
||||
float e = .0001;
|
||||
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)).x, calcdist(p-vec3(0.0, e, 0.0)).x, calcdist(p-vec3(0.0, 0.0, e)).x);
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
vec3 rm_color(float c) {
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(vec3(c) + K.xyz) * 6.0 - K.www);
|
||||
return 1.0 * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), 1.0);
|
||||
}
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
uv -= vec2(0.5);
|
||||
vec2 rm = raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0));
|
||||
vec3 p = vec3(uv, 2.0-rm.x);
|
||||
vec3 n = normal(p);
|
||||
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||
vec3 ld = normalize(l-p);
|
||||
float o = step(p.z, 0.001);
|
||||
float shadow = 1.0-0.75*step(raymarch(l, -ld).x, length(l-p)-0.01);
|
||||
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||
return vec4(mix(rm_color(fract(rm.y)), vec3(0.9), o)*light, 1.0);
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
float calcdist(vec3 p) {
|
||||
return length(p)-0.4;
|
||||
}
|
||||
|
||||
vec3 calcColor(vec4 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return $(value);
|
||||
}
|
||||
|
||||
float raymarch(vec3 ro, vec3 rd) {
|
||||
float d=0.0;
|
||||
for (int i = 0; i < 200; i++) {
|
||||
vec3 p = ro + rd*d;
|
||||
float dstep = calcdist(p);
|
||||
d += dstep;
|
||||
if (dstep < 0.0001) break;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
vec3 normal(vec3 p) {
|
||||
float d = calcdist(p);
|
||||
float e = .0001;
|
||||
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)), calcdist(p-vec3(0.0, e, 0.0)), calcdist(p-vec3(0.0, 0.0, e)));
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
uv -= vec2(0.5);
|
||||
vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
|
||||
vec3 n = normal(p);
|
||||
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||
vec3 ld = normalize(l-p);
|
||||
float o = step(p.z, 0.001);
|
||||
float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);
|
||||
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||
return vec4(calcColor(vec4(p, 0.0))*light, 1.0);
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
float calcdist(vec3 p) {
|
||||
return length(p)-0.4;
|
||||
}
|
||||
|
||||
vec3 calcColor(vec4 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return vec3($(value));
|
||||
}
|
||||
|
||||
float raymarch(vec3 ro, vec3 rd) {
|
||||
float d=0.0;
|
||||
for (int i = 0; i < 200; i++) {
|
||||
vec3 p = ro + rd*d;
|
||||
float dstep = calcdist(p);
|
||||
d += dstep;
|
||||
if (dstep < 0.0001) break;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
vec3 normal(vec3 p) {
|
||||
float d = calcdist(p);
|
||||
float e = .0001;
|
||||
vec3 n = d - vec3(calcdist(p-vec3(e, 0.0, 0.0)), calcdist(p-vec3(0.0, e, 0.0)), calcdist(p-vec3(0.0, 0.0, e)));
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
uv -= vec2(0.5);
|
||||
vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
|
||||
vec3 n = normal(p);
|
||||
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||
vec3 ld = normalize(l-p);
|
||||
float o = step(p.z, 0.001);
|
||||
float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);
|
||||
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||
return vec4(calcColor(vec4(p, 0.0))*light, 1.0);
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
uniform float variation = 0.0;
|
||||
|
||||
vec4 mfield(vec4 uv) {
|
||||
float _seed_variation_ = variation;
|
||||
$(code)
|
||||
return $(value);
|
||||
}
|
||||
|
||||
float raymarch(vec3 ro, vec3 rd) {
|
||||
float d=0.0;
|
||||
for (int i = 0; i < 200; i++) {
|
||||
vec3 p = ro + rd*d;
|
||||
float dstep = mfield(vec4(p,0.0)).w;
|
||||
d += dstep;
|
||||
if (dstep < 0.0001) break;
|
||||
}
|
||||
return d;
|
||||
}
|
||||
vec3 normal(vec3 p) {
|
||||
float d = mfield(vec4(p,0.0)).w;
|
||||
float e = .0001;
|
||||
vec3 n = d - vec3(mfield(vec4(p-vec3(e, 0.0, 0.0),0.0)).w, mfield(vec4(p-vec3(0.0, e, 0.0),0.0)).w, mfield(vec4(p-vec3(0.0, 0.0, e),0.0)).w);
|
||||
return normalize(n);
|
||||
}
|
||||
|
||||
vec4 preview_2d(vec2 uv) {
|
||||
uv -= vec2(0.5);
|
||||
vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));
|
||||
vec3 n = normal(p);
|
||||
vec3 l = vec3(5.0, 5.0, 10.0);
|
||||
vec3 ld = normalize(l-p);
|
||||
float o = step(p.z, 0.001);
|
||||
float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);
|
||||
float light = 0.3+0.7*dot(n, ld)*shadow;
|
||||
return vec4(mfield(vec4(p, 1.0)).xyz*light, 1.0);
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_apply",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "0.0",
|
||||
"label": "Height",
|
||||
"longdesc": "The height map generated by the Render node",
|
||||
"name": "z",
|
||||
"shortdesc": "HeightMap",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "0.0",
|
||||
"label": "Color",
|
||||
"longdesc": "The color map generated by the Render node",
|
||||
"name": "c",
|
||||
"shortdesc": "ColorMap",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"label": "Texture",
|
||||
"longdesc": "The 3D texture",
|
||||
"name": "t",
|
||||
"shortdesc": "Tex3D",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Applies 3D textures to a rendered 3D signed distance function scene.",
|
||||
"name": "TEX3D Apply",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The textured 3D scene",
|
||||
"rgb": "$t(vec4($uv, $z($uv), $c($uv)))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"shortdesc": "Tex3D Apply"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,48 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_apply_invuvmap",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"label": "Texture",
|
||||
"longdesc": "The input 3D texture",
|
||||
"name": "t",
|
||||
"shortdesc": "Texture",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.0)",
|
||||
"label": "Inv. UV Map",
|
||||
"longdesc": "The inverse UV map of the object",
|
||||
"name": "map",
|
||||
"shortdesc": "InvUVMap",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "This node applies a 3D texture to an object using its inverse UV map.",
|
||||
"name": "TEX3D Apply",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated texture",
|
||||
"rgb": "$t(vec4($map($uv), 0.0))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"shortdesc": "TEX3D Apply"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_blend",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"amount": 0.5,
|
||||
"blend_type": 0
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "vec3 blend3d_normal(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1 + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_multiply(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*c1*c2 + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_screen(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*(1.0-(1.0-c1)*(1.0-c2)) + (1.0-opacity)*c2;\n}\n\nfloat blend3d_overlay_f(float c1, float c2) {\n\treturn (c1 < 0.5) ? (2.0*c1*c2) : (1.0-2.0*(1.0-c1)*(1.0-c2));\n}\n\nvec3 blend3d_overlay(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend3d_overlay_f(c1.x, c2.x), blend3d_overlay_f(c1.y, c2.y), blend3d_overlay_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_hard_light(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*0.5*(c1*c2+blend3d_overlay(c1, c2, 1.0)) + (1.0-opacity)*c2;\n}\n\nfloat blend3d_soft_light_f(float c1, float c2) {\n\treturn (c2 < 0.5) ? (2.0*c1*c2+c1*c1*(1.0-2.0*c2)) : 2.0*c1*(1.0-c2)+sqrt(c1)*(2.0*c2-1.0);\n}\n\nvec3 blend3d_soft_light(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend3d_soft_light_f(c1.x, c2.x), blend3d_soft_light_f(c1.y, c2.y), blend3d_soft_light_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend3d_burn_f(float c1, float c2) {\n\treturn (c1==0.0)?c1:max((1.0-((1.0-c2)/c1)),0.0);\n}\n\nvec3 blend3d_burn(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend3d_burn_f(c1.x, c2.x), blend3d_burn_f(c1.y, c2.y), blend3d_burn_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nfloat blend3d_dodge_f(float c1, float c2) {\n\treturn (c1==1.0)?c1:min(c2/(1.0-c1),1.0);\n}\n\nvec3 blend3d_dodge(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*vec3(blend3d_dodge_f(c1.x, c2.x), blend3d_dodge_f(c1.y, c2.y), blend3d_dodge_f(c1.z, c2.z)) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_lighten(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*max(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_darken(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*min(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_difference(vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n}\n",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3($uv.x, 1.0, 1.0)",
|
||||
"label": "Source1",
|
||||
"longdesc": "The foreground input",
|
||||
"name": "s1",
|
||||
"shortdesc": "Foreground",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(1.0, $uv.y, 1.0)",
|
||||
"label": "Source2",
|
||||
"longdesc": "The background input",
|
||||
"name": "s2",
|
||||
"shortdesc": "Background",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"label": "Opacity",
|
||||
"longdesc": "The optional opacity mask",
|
||||
"name": "a",
|
||||
"shortdesc": "Mask",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Blends its 3D texture inputs, using an optional mask",
|
||||
"name": "TEX3D Blend",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The 3D texture generated by the blend operation",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "blend3d_$blend_type($s1($uv).rgb, $s2($uv).rgb, $amount*dot($a($uv), vec3(1.0))/3.0)",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0,
|
||||
"label": "",
|
||||
"longdesc": "The algorithm used to blend the inputs",
|
||||
"name": "blend_type",
|
||||
"shortdesc": "Blend mode",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Normal",
|
||||
"value": "normal"
|
||||
},
|
||||
{
|
||||
"name": "Multiply",
|
||||
"value": "multiply"
|
||||
},
|
||||
{
|
||||
"name": "Screen",
|
||||
"value": "screen"
|
||||
},
|
||||
{
|
||||
"name": "Overlay",
|
||||
"value": "overlay"
|
||||
},
|
||||
{
|
||||
"name": "Hard Light",
|
||||
"value": "hard_light"
|
||||
},
|
||||
{
|
||||
"name": "Soft Light",
|
||||
"value": "soft_light"
|
||||
},
|
||||
{
|
||||
"name": "Burn",
|
||||
"value": "burn"
|
||||
},
|
||||
{
|
||||
"name": "Dodge",
|
||||
"value": "dodge"
|
||||
},
|
||||
{
|
||||
"name": "Lighten",
|
||||
"value": "lighten"
|
||||
},
|
||||
{
|
||||
"name": "Darken",
|
||||
"value": "darken"
|
||||
},
|
||||
{
|
||||
"name": "Difference",
|
||||
"value": "difference"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "3:",
|
||||
"longdesc": "The opacity of the blend operation",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "amount",
|
||||
"shortdesc": "Opacity",
|
||||
"step": 0,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Blend"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,85 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_colorize",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"g": {
|
||||
"interpolation": 1,
|
||||
"points": [
|
||||
{
|
||||
"a": 1,
|
||||
"b": 1,
|
||||
"g": 0,
|
||||
"pos": 0,
|
||||
"r": 0
|
||||
},
|
||||
{
|
||||
"a": 1,
|
||||
"b": 0,
|
||||
"g": 0.46875,
|
||||
"pos": 1,
|
||||
"r": 1
|
||||
}
|
||||
],
|
||||
"type": "Gradient"
|
||||
}
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3($uv.x+0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The input greyscale 3D texture",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Remaps a greyscale 3D texture to a custom gradient",
|
||||
"name": "TEX3D Colorize",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The remapped color 3D texture ",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "$g(dot($in($uv), vec3(1.0))/3.0).rgb",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"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": "g",
|
||||
"shortdesc": "Gradient",
|
||||
"type": "gradient"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Colorize"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,59 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_distort",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"Distort": 0.3
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture to be distorted",
|
||||
"name": "in1",
|
||||
"shortdesc": "Input1",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture used to distort Input1",
|
||||
"name": "in2",
|
||||
"shortdesc": "Input2",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Distorts its input 3D texture using another 3D texture",
|
||||
"name": "TEX3D Distort",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The distorted 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "$in1(vec4($uv.xyz+($in2($uv)*$Distort*0.5-0.5), 0.0))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Distort",
|
||||
"longdesc": "The strength of the distort effect",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "Distort",
|
||||
"shortdesc": "Strength",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Distort"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,119 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_fbm",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"iterations": 1,
|
||||
"noise": 0,
|
||||
"persistence": 0.5,
|
||||
"scale_x": 8,
|
||||
"scale_y": 8,
|
||||
"scale_z": 8
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "float rand31(vec3 p) {\n\treturn fract(sin(dot(p,vec3(127.1,311.7, 74.7)))*43758.5453123);\n}\nvec3 rand33(vec3 p){\n\tp = vec3( dot(p,vec3(127.1,311.7, 74.7)),\n\t\t\t dot(p,vec3(269.5,183.3,246.1)),\n\t\t\t dot(p,vec3(113.5,271.9,124.6)));\n\n\treturn -1.0 + 2.0*fract(sin(p)*43758.5453123);\n}\n\nfloat tex3d_fbm_value(vec3 coord, vec3 size, float seed) {\n\tvec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\tvec3 f = fract(coord);\n\tfloat p000 = rand31(mod(o, size));\n\tfloat p001 = rand31(mod(o + vec3(0.0, 0.0, 1.0), size));\n\tfloat p010 = rand31(mod(o + vec3(0.0, 1.0, 0.0), size));\n\tfloat p011 = rand31(mod(o + vec3(0.0, 1.0, 1.0), size));\n\tfloat p100 = rand31(mod(o + vec3(1.0, 0.0, 0.0), size));\n\tfloat p101 = rand31(mod(o + vec3(1.0, 0.0, 1.0), size));\n\tfloat p110 = rand31(mod(o + vec3(1.0, 1.0, 0.0), size));\n\tfloat p111 = rand31(mod(o + vec3(1.0, 1.0, 1.0), size));\n\tvec3 t = f * f * (3.0 - 2.0 * f);\n\treturn mix(mix(mix(p000, p100, t.x), mix(p010, p110, t.x), t.y), mix(mix(p001, p101, t.x), mix(p011, p111, t.x), t.y), t.z);\n}\n\nfloat tex3d_fbm_perlin(vec3 coord, vec3 size, float seed) {\n\tvec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\tvec3 f = fract(coord);\n\tvec3 v000 = normalize(rand33(mod(o, size))-vec3(0.5));\n\tvec3 v001 = normalize(rand33(mod(o + vec3(0.0, 0.0, 1.0), size))-vec3(0.5));\n\tvec3 v010 = normalize(rand33(mod(o + vec3(0.0, 1.0, 0.0), size))-vec3(0.5));\n\tvec3 v011 = normalize(rand33(mod(o + vec3(0.0, 1.0, 1.0), size))-vec3(0.5));\n\tvec3 v100 = normalize(rand33(mod(o + vec3(1.0, 0.0, 0.0), size))-vec3(0.5));\n\tvec3 v101 = normalize(rand33(mod(o + vec3(1.0, 0.0, 1.0), size))-vec3(0.5));\n\tvec3 v110 = normalize(rand33(mod(o + vec3(1.0, 1.0, 0.0), size))-vec3(0.5));\n\tvec3 v111 = normalize(rand33(mod(o + vec3(1.0, 1.0, 1.0), size))-vec3(0.5));\n\tfloat p000 = dot(v000, f);\n\tfloat p001 = dot(v001, f - vec3(0.0, 0.0, 1.0));\n\tfloat p010 = dot(v010, f - vec3(0.0, 1.0, 0.0));\n\tfloat p011 = dot(v011, f - vec3(0.0, 1.0, 1.0));\n\tfloat p100 = dot(v100, f - vec3(1.0, 0.0, 0.0));\n\tfloat p101 = dot(v101, f - vec3(1.0, 0.0, 1.0));\n\tfloat p110 = dot(v110, f - vec3(1.0, 1.0, 0.0));\n\tfloat p111 = dot(v111, f - vec3(1.0, 1.0, 1.0));\n\tvec3 t = f * f * (3.0 - 2.0 * f);\n\treturn 0.5 + mix(mix(mix(p000, p100, t.x), mix(p010, p110, t.x), t.y), mix(mix(p001, p101, t.x), mix(p011, p111, t.x), t.y), t.z);\n}\n\nfloat tex3d_fbm_cellular(vec3 coord, vec3 size, float seed) {\n\tvec3 o = floor(coord)+rand3(vec2(seed, 1.0-seed))+size;\n\tvec3 f = fract(coord);\n\tfloat min_dist = 3.0;\n\tfor (float x = -1.0; x <= 1.0; x++) {\n\t\tfor (float y = -1.0; y <= 1.0; y++) {\n\t\t\tfor (float z = -1.0; z <= 1.0; z++) {\n\t\t\t\tvec3 node = 0.4*rand33(mod(o + vec3(x, y, z), size)) + vec3(x, y, z);\n\t\t\t\tfloat dist = sqrt((f - node).x * (f - node).x + (f - node).y * (f - node).y + (f - node).z * (f - node).z);\n\t\t\t\tmin_dist = min(min_dist, dist);\n\t\t\t}\n\t\t}\n\t}\n\treturn min_dist;\n}\n",
|
||||
"inputs": [
|
||||
|
||||
],
|
||||
"instance": "float $(name)_fbm(vec3 coord, vec3 size, int octaves, float persistence, float seed) {\n\tfloat normalize_factor = 0.0;\n\tfloat value = 0.0;\n\tfloat scale = 1.0;\n\tfor (int i = 0; i < octaves; i++) {\n\t\tvalue += tex3d_fbm_$noise(coord*size, size, seed) * scale;\n\t\tnormalize_factor += scale;\n\t\tsize *= 2.0;\n\t\tscale *= persistence;\n\t}\n\treturn value / normalize_factor;\n}\n",
|
||||
"longdesc": "Generates a 3D noise made of several octaves of a simple noise",
|
||||
"name": "TEX3D FBM",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "Shows a greyscale 3D texture of the generated noise",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "vec3($(name)_fbm($(uv).xyz, vec3($(scale_x), $(scale_y), $(scale_z)), int($(iterations)), $(persistence), float($(seed))))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 2,
|
||||
"label": "Noise",
|
||||
"longdesc": "The simple noise type",
|
||||
"name": "noise",
|
||||
"shortdesc": "Noise type",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Value",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "Perlin",
|
||||
"value": "perlin"
|
||||
},
|
||||
{
|
||||
"name": "Cellular",
|
||||
"value": "cellular"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Scale X",
|
||||
"longdesc": "The scale of the first octave along the X axis",
|
||||
"max": 32,
|
||||
"min": 1,
|
||||
"name": "scale_x",
|
||||
"shortdesc": "Scale.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Scale Y",
|
||||
"longdesc": "The scale of the first octave along the Y axis",
|
||||
"max": 32,
|
||||
"min": 1,
|
||||
"name": "scale_y",
|
||||
"shortdesc": "Scale.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Scale Z",
|
||||
"longdesc": "The scale of the first octave along the Z axis",
|
||||
"max": 32,
|
||||
"min": 1,
|
||||
"name": "scale_z",
|
||||
"shortdesc": "Scale.z",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 3,
|
||||
"label": "Iterations",
|
||||
"longdesc": "The number of noise octaves",
|
||||
"max": 10,
|
||||
"min": 1,
|
||||
"name": "iterations",
|
||||
"shortdesc": "Octaves",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Persistence",
|
||||
"longdesc": "The persistence between two consecutive octaves",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "persistence",
|
||||
"shortdesc": "Persistence",
|
||||
"step": 0.05,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D FBM"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,40 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_from2d",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The input 2D texture",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Creates a 3D texture from a 2D texture",
|
||||
"name": "TEX3D From2D",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "$in($uv.xy+vec2(0.5))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"shortdesc": "Tex3D From 2D"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,210 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_pattern",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"mix": 4,
|
||||
"x_scale": 2,
|
||||
"x_wave": 2,
|
||||
"y_scale": 2,
|
||||
"y_wave": 2,
|
||||
"z_scale": 2,
|
||||
"z_wave": 2
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "float wave3d_constant(float x) {\n\treturn 1.0;\n}\n\nfloat wave3d_sine(float x) {\n\treturn 0.5-0.5*cos(3.14159265359*2.0*x);\n}\n\nfloat wave3d_triangle(float x) {\n\tx = fract(x);\n\treturn min(2.0*x, 2.0-2.0*x);\n}\n\nfloat wave3d_sawtooth(float x) {\n\treturn fract(x);\n}\n\nfloat wave3d_square(float x) {\n\treturn (fract(x) < 0.5) ? 0.0 : 1.0;\n}\n\nfloat wave3d_bounce(float x) {\n\tx = 2.0*(fract(x)-0.5);\n\treturn sqrt(1.0-x*x);\n}\n\nfloat mix3d_mul(float x, float y, float z) {\n\treturn x*y*z;\n}\n\nfloat mix3d_add(float x, float y, float z) {\n\treturn min(x+y+z, 1.0);\n}\n\nfloat mix3d_max(float x, float y, float z) {\n\treturn max(max(x, y), z);\n}\n\nfloat mix3d_min(float x, float y, float z) {\n\treturn min(min(x, y), z);\n}\n\nfloat mix3d_xor(float x, float y, float z) {\n\tfloat xy = min(x+y, 2.0-x-y);\n\treturn min(xy+z, 2.0-xy-z);\n}\n\nfloat mix3d_pow(float x, float y, float z) {\n\treturn pow(pow(x, y), z);\n}",
|
||||
"inputs": [
|
||||
|
||||
],
|
||||
"instance": "float $(name)_fct(vec3 uv) {\n\treturn mix3d_$(mix)(wave3d_$(x_wave)($(x_scale)*uv.x), wave3d_$(y_wave)($(y_scale)*uv.y), wave3d_$(z_wave)($(z_scale)*uv.z));\n}",
|
||||
"longdesc": "A greyscale 3D texture that combines patterns along all 3 axes",
|
||||
"name": "TEX3D Pattern",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The generated 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "vec3($(name)_fct($(uv).xyz))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"default": 0,
|
||||
"label": "Combiner",
|
||||
"longdesc": "The operation used to combine the X, Y and Z patterns",
|
||||
"name": "mix",
|
||||
"shortdesc": "Combine",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Multiply",
|
||||
"value": "mul"
|
||||
},
|
||||
{
|
||||
"name": "Add",
|
||||
"value": "add"
|
||||
},
|
||||
{
|
||||
"name": "Max",
|
||||
"value": "max"
|
||||
},
|
||||
{
|
||||
"name": "Min",
|
||||
"value": "min"
|
||||
},
|
||||
{
|
||||
"name": "Xor",
|
||||
"value": "xor"
|
||||
},
|
||||
{
|
||||
"name": "Pow",
|
||||
"value": "pow"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"label": "X",
|
||||
"longdesc": "Pattern generated along the X axis",
|
||||
"name": "x_wave",
|
||||
"shortdesc": "Pattern.x",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Sine",
|
||||
"value": "sine"
|
||||
},
|
||||
{
|
||||
"name": "Triangle",
|
||||
"value": "triangle"
|
||||
},
|
||||
{
|
||||
"name": "Square",
|
||||
"value": "square"
|
||||
},
|
||||
{
|
||||
"name": "Sawtooth",
|
||||
"value": "sawtooth"
|
||||
},
|
||||
{
|
||||
"name": "Constant",
|
||||
"value": "constant"
|
||||
},
|
||||
{
|
||||
"name": "Bounce",
|
||||
"value": "bounce"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "2:",
|
||||
"longdesc": "Repetitions of the pattern along X axis",
|
||||
"max": 32,
|
||||
"min": 0,
|
||||
"name": "x_scale",
|
||||
"shortdesc": "Repeat.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"label": "Y",
|
||||
"longdesc": "Pattern generated along the Y axis",
|
||||
"name": "y_wave",
|
||||
"shortdesc": "Pattern.y",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Sine",
|
||||
"value": "sine"
|
||||
},
|
||||
{
|
||||
"name": "Triangle",
|
||||
"value": "triangle"
|
||||
},
|
||||
{
|
||||
"name": "Square",
|
||||
"value": "square"
|
||||
},
|
||||
{
|
||||
"name": "Sawtooth",
|
||||
"value": "sawtooth"
|
||||
},
|
||||
{
|
||||
"name": "Constant",
|
||||
"value": "constant"
|
||||
},
|
||||
{
|
||||
"name": "Bounce",
|
||||
"value": "bounce"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "3:",
|
||||
"longdesc": "Repetitions of the pattern along Y axis",
|
||||
"max": 32,
|
||||
"min": 0,
|
||||
"name": "y_scale",
|
||||
"shortdesc": "Repeat.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"default": 0,
|
||||
"label": "Z",
|
||||
"longdesc": "Pattern generated along the Z axis",
|
||||
"name": "z_wave",
|
||||
"shortdesc": "Pattern.z",
|
||||
"type": "enum",
|
||||
"values": [
|
||||
{
|
||||
"name": "Sine",
|
||||
"value": "sine"
|
||||
},
|
||||
{
|
||||
"name": "Triangle",
|
||||
"value": "triangle"
|
||||
},
|
||||
{
|
||||
"name": "Square",
|
||||
"value": "square"
|
||||
},
|
||||
{
|
||||
"name": "Sawtooth",
|
||||
"value": "sawtooth"
|
||||
},
|
||||
{
|
||||
"name": "Constant",
|
||||
"value": "constant"
|
||||
},
|
||||
{
|
||||
"name": "Bounce",
|
||||
"value": "bounce"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "4:",
|
||||
"longdesc": "Repetitions of the pattern along Z axis",
|
||||
"max": 32,
|
||||
"min": 0,
|
||||
"name": "z_scale",
|
||||
"shortdesc": "Repeat.z",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Pattern"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,77 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_rotate",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"ax": 0,
|
||||
"ay": 0,
|
||||
"az": 0
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "vec3 tex3d_rotate(vec3 p, vec3 a) {\n\tvec3 rv;\n\tfloat c;\n\tfloat s;\n\tc = cos(a.x);\n\ts = sin(a.x);\n\trv.x = p.x;\n\trv.y = p.y*c+p.z*s;\n\trv.z = -p.y*s+p.z*c;\n\tc = cos(a.y);\n\ts = sin(a.y);\n\tp.x = rv.x*c+rv.z*s;\n\tp.y = rv.y;\n\tp.z = -rv.x*s+rv.z*c;\n\tc = cos(a.z);\n\ts = sin(a.z);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(1.0)",
|
||||
"label": "",
|
||||
"longdesc": "The input 3D texture",
|
||||
"name": "in",
|
||||
"shortdesc": "Input",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Rotates a 3D texture",
|
||||
"name": "TEX3D Rotate",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The rotated 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "$in(vec4(tex3d_rotate($uv.xyz, -vec3($ax, $ay, $az)*0.01745329251), $uv.w))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "X",
|
||||
"longdesc": "The rotation around the X axis",
|
||||
"max": 180,
|
||||
"min": -180,
|
||||
"name": "ax",
|
||||
"shortdesc": "Rotate.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Y",
|
||||
"longdesc": "The rotation around the Y axis",
|
||||
"max": 180,
|
||||
"min": -180,
|
||||
"name": "ay",
|
||||
"shortdesc": "Rotate.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Z",
|
||||
"longdesc": "The rotation around the Z axis",
|
||||
"max": 180,
|
||||
"min": -180,
|
||||
"name": "az",
|
||||
"shortdesc": "Rotate.z",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Rotate"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,72 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_select",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"t": 0.01,
|
||||
"v": 1
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "float $(name_uv)_d = ($uv.w-$v)/$t;",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture associated to the specified color index",
|
||||
"name": "in1",
|
||||
"shortdesc": "Input1",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture(s) associated to other color indices",
|
||||
"name": "in2",
|
||||
"shortdesc": "Input2",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Selects a 3D texture for a given color index. This can be used to map several textures into a single 3D scene.",
|
||||
"name": "TEX3D Select",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The merged 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "mix($in1($uv), $in2($uv), clamp(1.0-$(name_uv)_d*$(name_uv)_d, 0.0, 1.0))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Value",
|
||||
"longdesc": "The value of the selected color index",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "v",
|
||||
"shortdesc": "Value",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.1,
|
||||
"label": "Tolerance",
|
||||
"longdesc": "The tolerance used when comparing color indices",
|
||||
"max": 1,
|
||||
"min": 0.01,
|
||||
"name": "t",
|
||||
"shortdesc": "Tolerance",
|
||||
"step": 0.001,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Select"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,69 +0,0 @@
|
||||
{
|
||||
"name": "tex3d_select_shape",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"d": 0
|
||||
},
|
||||
"seed": 0,
|
||||
"seed_locked": false,
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture associated to the specified color index",
|
||||
"name": "in1",
|
||||
"shortdesc": "Input1",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "vec3(0.5)",
|
||||
"label": "",
|
||||
"longdesc": "The 3D texture(s) associated to other color indices",
|
||||
"name": "in2",
|
||||
"shortdesc": "Input2",
|
||||
"type": "tex3d"
|
||||
},
|
||||
{
|
||||
"default": "0.0",
|
||||
"label": "",
|
||||
"longdesc": "The shape in which input1 is applied",
|
||||
"name": "shape",
|
||||
"shortdesc": "Shape",
|
||||
"type": "sdf3d"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Selects a 3D texture inside, and another outside a shape. This can be used to map several textures into a single 3D scene.",
|
||||
"name": "TEX3D Shape Select",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "The merged 3D texture",
|
||||
"shortdesc": "Output",
|
||||
"tex3d": "mix($in1($uv), $in2($uv), clamp($shape($uv.xyz)/max($d, 0.0001), 0.0, 1.0))",
|
||||
"type": "tex3d"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Smoothness",
|
||||
"longdesc": "The width of the transition area between both textures",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "d",
|
||||
"shortdesc": "Smoothness",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tex3D Shape Select"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
{
|
||||
"name": "tile2x2",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The first input",
|
||||
"name": "in1",
|
||||
"shortdesc": "Input1",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The second input",
|
||||
"name": "in2",
|
||||
"shortdesc": "Input2",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The third input",
|
||||
"name": "in3",
|
||||
"shortdesc": "Input3",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"label": "",
|
||||
"longdesc": "The fourth input",
|
||||
"name": "in4",
|
||||
"shortdesc": "Input4",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Places 4 input images into a single output to create an atlas of 4 images. Chaining Tile2x2 nodes can be useful to create 16 images atlases.\nAtlases are used by remapping nodes such as CustomUV, Tiler and Splatter.",
|
||||
"name": "Tile2x2",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "Shows the generated atlas",
|
||||
"rgba": "($uv.y < 0.5) ? (($uv.x < 0.5) ? ($in1(2.0*$uv)) : ($in2(2.0*$uv-vec2(1.0, 0.0)))) : (($uv.x < 0.5) ? ($in3(2.0*$uv-vec2(0.0, 1.0))) : ($in4(2.0*$uv-vec2(1.0, 1.0))))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"shortdesc": "Tile2x2"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
{
|
||||
"name": "tile2x2_variations",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(0.0)",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "The first input",
|
||||
"name": "in",
|
||||
"shortdesc": "Input1",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"instance": "",
|
||||
"longdesc": "Places 4 input images into a single output to create an atlas of 4 images. Chaining Tile2x2 nodes can be useful to create 16 images atlases.\nAtlases are used by remapping nodes such as CustomUV, Tiler and Splatter.",
|
||||
"name": "Tile2x2 Variations",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "Shows the generated atlas",
|
||||
"rgba": "($uv.y < 0.5) ? (($uv.x < 0.5) ? ($in.variation(2.0*$uv, $seed)) : ($in.variation(2.0*$uv-vec2(1.0, 0.0), $seed+0.1))) : (($uv.x < 0.5) ? ($in.variation(2.0*$uv-vec2(0.0, 1.0), $seed+0.2)) : ($in.variation(2.0*$uv-vec2(1.0, 1.0), $seed+0.3)))",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"shortdesc": "Tile2x2"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,213 +0,0 @@
|
||||
{
|
||||
"name": "tiler",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"fixed_offset": 0,
|
||||
"offset": 1,
|
||||
"overlap": 1,
|
||||
"rotate": 180,
|
||||
"scale": 0.5,
|
||||
"scale_x": 0.5,
|
||||
"scale_y": 0.5,
|
||||
"select_inputs": 0,
|
||||
"tx": 20,
|
||||
"ty": 20,
|
||||
"value": 2
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), 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 tiler_$(name)(vec2 uv, vec2 tile, int overlap, vec2 _seed) {\n\tfloat c = 0.0;\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tvec2 seed = rand2(pos+_seed);\n\t\t\trc1 = rand3(seed);\n\t\t\tpos = fract(pos+vec2($fixed_offset/tile.x, 0.0)*floor(mod(pos.y*tile.y, 2.0))+$offset*seed/tile);\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tvec2 clamped_pv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\t\tif (pv.x != clamped_pv.x || pv.y != clamped_pv.y) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$select_inputs\n\t\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask*(1.0-$value*seed.x);\n\t\t\t\tc = max(c, c1);\n\t\t\t\trc = mix(rc, rc1, step(c, c1));\n\t\t\t}\n\t\t}\n\t}\n\treturn vec4(rc, c);\n}",
|
||||
"longdesc": "Tiles several occurences of an input image while adding randomness.",
|
||||
"name": "Tiler",
|
||||
"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": 4,
|
||||
"label": "Tile X",
|
||||
"longdesc": "The number of columns of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "tx",
|
||||
"shortdesc": "Tile.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile Y",
|
||||
"longdesc": "The number of rows of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "ty",
|
||||
"shortdesc": "Tile.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Overlap",
|
||||
"longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
"max": 5,
|
||||
"min": 0,
|
||||
"name": "overlap",
|
||||
"shortdesc": "Overlap",
|
||||
"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.5,
|
||||
"label": "Fixed Offset",
|
||||
"longdesc": "The relative offset of odd rows",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "fixed_offset",
|
||||
"shortdesc": "FixedOffset",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Rnd Offset",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "offset",
|
||||
"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 tile variations of the input",
|
||||
"name": "variations",
|
||||
"shortdesc": "Variations",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tiler"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,259 +0,0 @@
|
||||
{
|
||||
"name": "tiler_advanced",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"overlap": 1,
|
||||
"rotate": 0,
|
||||
"scale_x": 1,
|
||||
"scale_y": 1,
|
||||
"select_inputs": 0,
|
||||
"translate_x": 0,
|
||||
"translate_y": 0,
|
||||
"tx": 4,
|
||||
"ty": 4,
|
||||
"variations": false
|
||||
},
|
||||
"seed": 0.488938,
|
||||
"seed_locked": false,
|
||||
"shader_model": {
|
||||
"code": "vec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), 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"
|
||||
},
|
||||
{
|
||||
"default": "vec4(rand2($uv+vec2(float($seed))), rand2($uv-vec2(float($seed))))",
|
||||
"label": "",
|
||||
"longdesc": "An input color map used to generate the Instance map 1 output",
|
||||
"name": "color1",
|
||||
"shortdesc": "Color map 1",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(rand2(-$uv+vec2(float($seed))), rand2(-$uv-vec2(float($seed))))",
|
||||
"label": "",
|
||||
"longdesc": "An input color map used to generate the Instance map 2 output",
|
||||
"name": "color2",
|
||||
"shortdesc": "Color map 2",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "5:",
|
||||
"longdesc": "A map for translation along the X axis",
|
||||
"name": "tr_x",
|
||||
"shortdesc": "Translate map X",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for translation along the Y axis",
|
||||
"name": "tr_y",
|
||||
"shortdesc": "Translate map Y",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for rotation",
|
||||
"name": "r",
|
||||
"shortdesc": "Rotate map",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for scale along the X axis",
|
||||
"name": "sc_x",
|
||||
"shortdesc": "Scale map X",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for scale along the Y axis",
|
||||
"name": "sc_y",
|
||||
"shortdesc": "Scale map Y",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"instance": "vec4 tiler_$(name)(vec2 uv, vec2 tile, int overlap, float _seed) {\n\tfloat c = 0.0;\n\tvec2 map_uv = vec2(0.0);\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tpos = fract(pos+vec2(0.5));\n\t\t\t\tpv -= vec2($translate_x*$tr_x(pos), $translate_y*$tr_y(pos))/tile;\n\t\t\t\tfloat angle = $r(pos) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv /= vec2($scale_x*$sc_x(pos), $scale_y*$sc_y(pos));\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvec2 seed = rand2(vec2(_seed)+pos);\n\t\t\t\t$select_inputs\n\t\t\t\tfloat c1 = $in.variation(pv, $variations ? seed.x : 0.0)*mask;\n\t\t\t\tc = max(c, c1);\n\t\t\t\tmap_uv = mix(map_uv, pos, step(c, c1));\n\t\t\t}\n\t\t}\n\t}\n\treturn vec4(map_uv, 0.0, c);\n}",
|
||||
"longdesc": "Tiles several occurences of an input image while adding randomness.",
|
||||
"name": "Advanced Tiler",
|
||||
"outputs": [
|
||||
{
|
||||
"f": "$(name_uv)_rch.a",
|
||||
"longdesc": "Shows the generated pattern",
|
||||
"shortdesc": "Output",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"longdesc": "Shows a color for each instance of the input image",
|
||||
"rgba": "$color1($(name_uv)_rch.rg)",
|
||||
"shortdesc": "Instance map 1",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"longdesc": "Shows a color for each instance of the input image",
|
||||
"rgba": "$color2($(name_uv)_rch.rg)",
|
||||
"shortdesc": "Instance map 2",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile X",
|
||||
"longdesc": "The number of columns of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "tx",
|
||||
"shortdesc": "Tile.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile Y",
|
||||
"longdesc": "The number of rows of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "ty",
|
||||
"shortdesc": "Tile.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Overlap",
|
||||
"longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
"max": 5,
|
||||
"min": 0,
|
||||
"name": "overlap",
|
||||
"shortdesc": "Overlap",
|
||||
"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": 0,
|
||||
"label": "Translate X",
|
||||
"longdesc": "The translation along the X axis applied to the instances",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "translate_x",
|
||||
"shortdesc": "Translate.x",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Translate Y",
|
||||
"longdesc": "The translation along the Y axis applied to the instances",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "translate_y",
|
||||
"shortdesc": "Translate.y",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Rotate",
|
||||
"longdesc": "The angle of instances of the input",
|
||||
"max": 180,
|
||||
"min": 0,
|
||||
"name": "rotate",
|
||||
"shortdesc": "Rotate",
|
||||
"step": 0.1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"default": false,
|
||||
"label": "Variations",
|
||||
"longdesc": "Check to tile variations of the input",
|
||||
"name": "variations",
|
||||
"shortdesc": "Variations",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tiler"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,256 +0,0 @@
|
||||
{
|
||||
"name": "tiler_advanced_color",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"overlap": 1,
|
||||
"rotate": 0,
|
||||
"scale_x": 1,
|
||||
"scale_y": 1,
|
||||
"select_inputs": 0,
|
||||
"translate_x": 0,
|
||||
"translate_y": 0,
|
||||
"tx": 4,
|
||||
"ty": 4
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec2 $(name_uv)_mapuv;\nvec4 $(name_uv)_rch = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), float($seed), $(name_uv)_mapuv);",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec4(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"
|
||||
},
|
||||
{
|
||||
"default": "vec4(rand2($uv+vec2(float($seed))), rand2($uv-vec2(float($seed))))",
|
||||
"label": "",
|
||||
"longdesc": "An input color map used to generate the Instance map 1 output",
|
||||
"name": "color1",
|
||||
"shortdesc": "Color map 1",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "vec4(rand2(-$uv+vec2(float($seed))), rand2(-$uv-vec2(float($seed))))",
|
||||
"label": "",
|
||||
"longdesc": "An input color map used to generate the Instance map 2 output",
|
||||
"name": "color2",
|
||||
"shortdesc": "Color map 2",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "5:",
|
||||
"longdesc": "A map for translation along the X axis",
|
||||
"name": "tr_x",
|
||||
"shortdesc": "Translate map X",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for translation along the Y axis",
|
||||
"name": "tr_y",
|
||||
"shortdesc": "Translate map Y",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for rotation",
|
||||
"name": "r",
|
||||
"shortdesc": "Rotate map",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for scale along the X axis",
|
||||
"name": "sc_x",
|
||||
"shortdesc": "Scale map X",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "A map for scale along the Y axis",
|
||||
"name": "sc_y",
|
||||
"shortdesc": "Scale map Y",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"instance": "vec4 tiler_$(name)(vec2 uv, vec2 tile, int overlap, float _seed, out vec2 outmapuv) {\n\t// $seed\n\tvec4 c = vec4(0.0);\n\toutmapuv = vec2(0.0);\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tpos = fract(pos+vec2(0.5));\n\t\t\t\tpv -= vec2($translate_x*$tr_x(pos), $translate_y*$tr_y(pos))/tile;\n\t\t\t\tfloat angle = $r(pos) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv /= vec2($scale_x*$sc_x(pos), $scale_y*$sc_y(pos));\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tif (pv != clamp(pv, vec2(0.0), vec2(1.0))) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tvec2 seed = rand2(vec2(_seed)+pos);\n\t\t\t\t$select_inputs\n\t\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\t\tfloat na = n.a*mask;\n\t\t\t\toutmapuv = mix(outmapuv, pos, step(c.a, na));\n\t\t\t\tc = mix(c, n, na);\n\t\t\t}\n\t\t}\n\t}\n\treturn c;\n}\n",
|
||||
"longdesc": "Tiles several occurences of an input image while adding randomness.",
|
||||
"name": "Advanced Tiler Color",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "Shows the generated pattern",
|
||||
"rgba": "$(name_uv)_rch",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"longdesc": "Shows a color for each instance of the input image",
|
||||
"rgba": "$color1($(name_uv)_mapuv)",
|
||||
"shortdesc": "Instance map 1",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"longdesc": "Shows a color for each instance of the input image",
|
||||
"rgba": "$color2($(name_uv)_mapuv)",
|
||||
"shortdesc": "Instance map 2",
|
||||
"type": "rgba"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile X",
|
||||
"longdesc": "The number of columns of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "tx",
|
||||
"shortdesc": "Tile.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile Y",
|
||||
"longdesc": "The number of rows of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "ty",
|
||||
"shortdesc": "Tile.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Overlap",
|
||||
"longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
"max": 5,
|
||||
"min": 0,
|
||||
"name": "overlap",
|
||||
"shortdesc": "Overlap",
|
||||
"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": 0,
|
||||
"label": "Translate X",
|
||||
"longdesc": "The translation along the X axis applied to the instances",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "translate_x",
|
||||
"shortdesc": "Translate.x",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Translate Y",
|
||||
"longdesc": "The translation along the Y axis applied to the instances",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "translate_y",
|
||||
"shortdesc": "Translate.y",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0,
|
||||
"label": "Rotate",
|
||||
"longdesc": "The angle of instances of the input",
|
||||
"max": 180,
|
||||
"min": 0,
|
||||
"name": "rotate",
|
||||
"shortdesc": "Rotate",
|
||||
"step": 0.1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
},
|
||||
{
|
||||
"default": false,
|
||||
"label": "Variations",
|
||||
"longdesc": "Check to tile variations of the input",
|
||||
"name": "variations",
|
||||
"shortdesc": "Variations",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Tiler"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,213 +0,0 @@
|
||||
{
|
||||
"name": "tiler_color",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
"fixed_offset": 0.5,
|
||||
"offset": 0.25,
|
||||
"opacity": 0,
|
||||
"overlap": 1,
|
||||
"rotate": 45,
|
||||
"scale": 0.2,
|
||||
"scale_x": 1,
|
||||
"scale_y": 1,
|
||||
"select_inputs": 0,
|
||||
"tx": 4,
|
||||
"ty": 4
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "vec3 $(name_uv)_random_color;\nvec4 $(name_uv)_tiled_output = tiler_$(name)($uv, vec2($tx, $ty), int($overlap), vec2(float($seed)), $(name_uv)_random_color);",
|
||||
"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": "rgba"
|
||||
},
|
||||
{
|
||||
"default": "1.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"longdesc": "The mask applied to the pattern",
|
||||
"name": "mask",
|
||||
"shortdesc": "Mask",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
"instance": "vec4 tiler_$(name)(vec2 uv, vec2 tile, int overlap, vec2 _seed, out vec3 random_color) {\n\tvec4 c = vec4(0.0);\n\tvec3 rc = vec3(0.0);\n\tvec3 rc1;\n\tfor (int dx = -overlap; dx <= overlap; ++dx) {\n\t\tfor (int dy = -overlap; dy <= overlap; ++dy) {\n\t\t\tvec2 pos = fract((floor(uv*tile)+vec2(float(dx), float(dy))+vec2(0.5))/tile-vec2(0.5));\n\t\t\tvec2 seed = rand2(pos+_seed);\n\t\t\trc1 = rand3(seed);\n\t\t\tpos = fract(pos+vec2($fixed_offset/tile.x, 0.0)*floor(mod(pos.y*tile.y, 2.0))+$offset*seed/tile);\n\t\t\tfloat mask = $mask(fract(pos+vec2(0.5)));\n\t\t\tif (mask > 0.01) {\n\t\t\t\tvec2 pv = fract(uv - pos)-vec2(0.5);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate * 0.01745329251;\n\t\t\t\tfloat ca = cos(angle);\n\t\t\t\tfloat sa = sin(angle);\n\t\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\t\tpv /= vec2($scale_x, $scale_y);\n\t\t\t\tpv += vec2(0.5);\n\t\t\t\tpv = clamp(pv, vec2(0.0), vec2(1.0));\n\t\t\t\t$select_inputs\n\t\t\t\tvec4 n = $in.variation(pv, $variations ? seed.x : 0.0);\n\t\t\t\tseed = rand2(seed);\n\t\t\t\tfloat na = n.a*mask*(1.0-$opacity*seed.x);\n\t\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\t\tc = mix(c, n, na);\n\t\t\t\trc = mix(rc, rc1, n.a);\n\t\t\t}\n\t\t}\n\t}\n\trandom_color = rc;\n\treturn c;\n}\n",
|
||||
"longdesc": "Tiles several occurences of an input image while adding randomness.",
|
||||
"name": "Color Tiler",
|
||||
"outputs": [
|
||||
{
|
||||
"longdesc": "Shows the generated pattern",
|
||||
"rgba": "$(name_uv)_tiled_output",
|
||||
"shortdesc": "Output",
|
||||
"type": "rgba"
|
||||
},
|
||||
{
|
||||
"longdesc": "Shows a random color for each instance of the input image",
|
||||
"rgb": "$(name_uv)_random_color",
|
||||
"shortdesc": "Instance Map",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile X",
|
||||
"longdesc": "The number of columns of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "tx",
|
||||
"shortdesc": "Tile.x",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 4,
|
||||
"label": "Tile Y",
|
||||
"longdesc": "The number of rows of the tiles pattern",
|
||||
"max": 64,
|
||||
"min": 1,
|
||||
"name": "ty",
|
||||
"shortdesc": "Tile.y",
|
||||
"step": 1,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 1,
|
||||
"label": "Overlap",
|
||||
"longdesc": "The number of neighbour tiles an instance of the input image can overlap. Set this parameter to the lowest value that generates the expected result (where all instances are fully visible) to improve performance.",
|
||||
"max": 5,
|
||||
"min": 0,
|
||||
"name": "overlap",
|
||||
"shortdesc": "Overlap",
|
||||
"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.5,
|
||||
"label": "Fixed Offset",
|
||||
"longdesc": "The relative offset of odd rows",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "fixed_offset",
|
||||
"shortdesc": "FixedOffset",
|
||||
"step": 0.01,
|
||||
"type": "float"
|
||||
},
|
||||
{
|
||||
"control": "None",
|
||||
"default": 0.5,
|
||||
"label": "Rnd Offset",
|
||||
"max": 1,
|
||||
"min": 0,
|
||||
"name": "offset",
|
||||
"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 tile variations of the input",
|
||||
"name": "variations",
|
||||
"shortdesc": "Variations",
|
||||
"type": "boolean"
|
||||
}
|
||||
],
|
||||
"shortdesc": "Color Tiler"
|
||||
},
|
||||
"type": "shader"
|
||||
}
|
@ -1,97 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: test
|
||||
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_ShaderKeywords:$(expr:" _METALLICGLOSSMAP" if $(connected:roughness_tex) or $(connected:metallic_tex) else "")$(expr:" _NORMALMAP" if $(connected:normal_tex) else "")$(expr:" _PARALLAXMAP" if $(connected:depth_tex) else "")
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses: []
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _BumpMap:
|
||||
$if $(connected:normal_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:2), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailAlbedoMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMask:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissionMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
$if $(connected:albedo_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:0), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MetallicGlossMap:
|
||||
$if $(connected:roughness_tex) or $(connected:metallic_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:1), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _OcclusionMap:
|
||||
$if $(connected:ao_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:4), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ParallaxMap:
|
||||
$if $(connected:depth_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:3), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _BumpScale: 1
|
||||
- _Cutoff: 0.5
|
||||
- _DetailNormalMapScale: 1
|
||||
- _DstBlend: 0
|
||||
- _GlossMapScale: 1
|
||||
- _Glossiness: 0.5
|
||||
- _GlossyReflections: 1
|
||||
- _Metallic: 0
|
||||
- _Mode: 0
|
||||
- _OcclusionStrength: 1
|
||||
- _Parallax: 0.02
|
||||
- _SmoothnessTextureChannel: 0
|
||||
- _SpecularHighlights: 1
|
||||
- _SrcBlend: 1
|
||||
- _UVSec: 0
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
|
@ -1,91 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: $(file_param:uid)
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 10
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
sRGBTexture: $(file_param:srgb)
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: -1
|
||||
aniso: -1
|
||||
mipBias: -100
|
||||
wrapU: -1
|
||||
wrapV: -1
|
||||
wrapW: -1
|
||||
nPOTScale: 1
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 0
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: $(file_param:normal)
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spritePackingTag:
|
||||
pSDRemoveMatte: 0
|
||||
pSDShowRemoveMatteOption: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@ -1,288 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!21 &2100000
|
||||
Material:
|
||||
serializedVersion: 6
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: test
|
||||
m_Shader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3}
|
||||
m_ShaderKeywords: _NORMALMAP_TANGENT_SPACE$(expr:" _NORMALMAP" if $(connected:normal_tex) else "")$(expr:" _HEIGHTMAP _PIXEL_DISPLACEMENT _PIXEL_DISPLACEMENT_LOCK_OBJECT_SCALE _DISPLACEMENT_LOCK_TILING_SCALE" if $(connected:depth_tex) else "")$(expr:" _MASKMAP" if $(connected:ao_tex) or $(connected:roughness_tex) or $(connected:metallic_tex) else "")$(expr:" _EMISSIVE_COLOR_MAP" if $(connected:emission_tex) else "")
|
||||
m_LightmapFlags: 4
|
||||
m_EnableInstancingVariants: 0
|
||||
m_DoubleSidedGI: 0
|
||||
m_CustomRenderQueue: -1
|
||||
stringTagMap: {}
|
||||
disabledShaderPasses:
|
||||
- DistortionVectors
|
||||
- MOTIONVECTORS
|
||||
- TransparentDepthPrepass
|
||||
- TransparentDepthPostpass
|
||||
- TransparentBackface
|
||||
m_SavedProperties:
|
||||
serializedVersion: 3
|
||||
m_TexEnvs:
|
||||
- _AnisotropyMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BaseColorMap:
|
||||
$if $(connected:albedo_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:0), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BentNormalMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _BentNormalMapOS:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _CoatMaskMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DetailMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _DistortionVectorMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _EmissiveColorMap:
|
||||
$if $(connected:emission_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:4), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _HeightMap:
|
||||
$if $(connected:depth_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:3), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _IridescenceMaskMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _IridescenceThicknessMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MainTex:
|
||||
$if $(connected:albedo_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:0), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _MaskMap:
|
||||
$if $(connected:ao_tex) or $(connected:roughness_tex) or $(connected:metallic_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:1), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _NormalMap:
|
||||
$if $(connected:normal_tex)
|
||||
m_Texture: {fileID: 2800000, guid: $(uid:2), type: 3}
|
||||
$else
|
||||
m_Texture: {fileID: 0}
|
||||
$fi
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _NormalMapOS:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SpecularColorMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _SubsurfaceMaskMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _TangentMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _TangentMapOS:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _ThicknessMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
- _TransmittanceColorMap:
|
||||
m_Texture: {fileID: 0}
|
||||
m_Scale: {x: 1, y: 1}
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_Floats:
|
||||
- _AORemapMax: 1
|
||||
- _AORemapMin: 0
|
||||
- _ATDistance: 1
|
||||
- _AddPrecomputedVelocity: 0
|
||||
- _AlbedoAffectEmissive: 0
|
||||
- _AlphaCutoff: 0.5
|
||||
- _AlphaCutoffEnable: 0
|
||||
- _AlphaCutoffPostpass: 0.5
|
||||
- _AlphaCutoffPrepass: 0.5
|
||||
- _AlphaCutoffShadow: 0.5
|
||||
- _AlphaDstBlend: 0
|
||||
- _AlphaSrcBlend: 1
|
||||
- _Anisotropy: 0
|
||||
- _BlendMode: 0
|
||||
- _CoatMask: 0
|
||||
- _CullMode: 2
|
||||
- _CullModeForward: 2
|
||||
- _Cutoff: 0.5
|
||||
- _DepthOffsetEnable: 0
|
||||
- _DetailAlbedoScale: 1
|
||||
- _DetailNormalScale: 1
|
||||
- _DetailSmoothnessScale: 1
|
||||
- _DiffusionProfile: 0
|
||||
- _DiffusionProfileHash: 0
|
||||
- _DisplacementLockObjectScale: 1
|
||||
- _DisplacementLockTilingScale: 1
|
||||
$if $(connected:depth_tex)
|
||||
- _DisplacementMode: 2
|
||||
$else
|
||||
- _DisplacementMode: 0
|
||||
$fi
|
||||
- _DistortionBlendMode: 0
|
||||
- _DistortionBlurBlendMode: 0
|
||||
- _DistortionBlurDstBlend: 1
|
||||
- _DistortionBlurRemapMax: 1
|
||||
- _DistortionBlurRemapMin: 0
|
||||
- _DistortionBlurScale: 1
|
||||
- _DistortionBlurSrcBlend: 1
|
||||
- _DistortionDepthTest: 1
|
||||
- _DistortionDstBlend: 1
|
||||
- _DistortionEnable: 0
|
||||
- _DistortionScale: 1
|
||||
- _DistortionSrcBlend: 1
|
||||
- _DistortionVectorBias: -1
|
||||
- _DistortionVectorScale: 2
|
||||
- _DoubleSidedEnable: 0
|
||||
- _DoubleSidedNormalMode: 1
|
||||
- _DstBlend: 0
|
||||
- _EmissiveColorMode: 1
|
||||
- _EmissiveExposureWeight: 1
|
||||
- _EmissiveIntensity: 1
|
||||
- _EmissiveIntensityUnit: 0
|
||||
- _EnableBlendModePreserveSpecularLighting: 1
|
||||
- _EnableFogOnTransparent: 1
|
||||
- _EnableGeometricSpecularAA: 0
|
||||
- _EnergyConservingSpecularColor: 1
|
||||
- _HeightAmplitude: $(expr:0.08*$(param:depth_scale))
|
||||
- _HeightCenter: 1
|
||||
- _HeightMapParametrization: 0
|
||||
- _HeightMax: 1
|
||||
- _HeightMin: -1
|
||||
- _HeightOffset: 0
|
||||
- _HeightPoMAmplitude: $(expr:8*$(param:depth_scale))
|
||||
- _HeightTessAmplitude: 2
|
||||
- _HeightTessCenter: 0.5
|
||||
- _InvTilingScale: 1
|
||||
- _Ior: 1.5
|
||||
- _IridescenceMask: 1
|
||||
- _IridescenceThickness: 1
|
||||
- _LinkDetailsWithBase: 1
|
||||
- _MaterialID: 1
|
||||
- _Metallic: $(param:metallic)
|
||||
- _NormalMapSpace: 0
|
||||
- _NormalScale: $(param:normal)
|
||||
- _PPDLodThreshold: 5
|
||||
- _PPDMaxSamples: 15
|
||||
- _PPDMinSamples: 5
|
||||
- _PPDPrimitiveLength: 1
|
||||
- _PPDPrimitiveWidth: 1
|
||||
- _ReceivesSSR: 1
|
||||
- _RefractionModel: 0
|
||||
- _SSRefractionProjectionModel: 0
|
||||
- _Smoothness: 1
|
||||
- _SmoothnessRemapMax: 1
|
||||
- _SmoothnessRemapMin: $(expr:1-$(param:roughness))
|
||||
- _SpecularAAScreenSpaceVariance: 0.1
|
||||
- _SpecularAAThreshold: 0.2
|
||||
- _SpecularOcclusionMode: 1
|
||||
- _SrcBlend: 1
|
||||
- _StencilRef: 0
|
||||
- _StencilRefDepth: 8
|
||||
- _StencilRefDistortionVec: 4
|
||||
- _StencilRefGBuffer: 10
|
||||
- _StencilRefMV: 40
|
||||
- _StencilWriteMask: 6
|
||||
- _StencilWriteMaskDepth: 8
|
||||
- _StencilWriteMaskDistortionVec: 4
|
||||
- _StencilWriteMaskGBuffer: 14
|
||||
- _StencilWriteMaskMV: 40
|
||||
- _SubsurfaceMask: 1
|
||||
- _SupportDecals: 1
|
||||
- _SurfaceType: 0
|
||||
- _TexWorldScale: 1
|
||||
- _TexWorldScaleEmissive: 1
|
||||
- _Thickness: 1
|
||||
- _TransmissionEnable: 1
|
||||
- _TransparentBackfaceEnable: 0
|
||||
- _TransparentCullMode: 2
|
||||
- _TransparentDepthPostpassEnable: 0
|
||||
- _TransparentDepthPrepassEnable: 0
|
||||
- _TransparentSortPriority: 0
|
||||
- _TransparentWritingMotionVec: 0
|
||||
- _TransparentZWrite: 0
|
||||
- _UVBase: 0
|
||||
- _UVDetail: 0
|
||||
- _UVEmissive: 0
|
||||
- _UseEmissiveIntensity: 0
|
||||
- _UseShadowThreshold: 0
|
||||
- _ZTestDepthEqualForOpaque: 3
|
||||
- _ZTestGBuffer: 4
|
||||
- _ZTestModeDistortion: 4
|
||||
- _ZTestTransparent: 4
|
||||
- _ZWrite: 1
|
||||
m_Colors:
|
||||
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0}
|
||||
- _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0}
|
||||
- _EmissionColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _InvPrimScale: {r: 1, g: 1, b: 0, a: 0}
|
||||
- _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
|
||||
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0}
|
||||
- _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0}
|
||||
- _UVMappingMask: {r: 1, g: 0, b: 0, a: 0}
|
||||
- _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0}
|
||||
--- !u!114 &8466335806480081788
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 11
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
version: 2
|
Loading…
Reference in New Issue
Block a user