diff --git a/addons/material_maker/doc/images/node_3d_box.png b/addons/material_maker/doc/images/node_3d_box.png deleted file mode 100644 index 1cb5f73..0000000 Binary files a/addons/material_maker/doc/images/node_3d_box.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_3d_sphere.png b/addons/material_maker/doc/images/node_3d_sphere.png deleted file mode 100644 index ffc48f9..0000000 Binary files a/addons/material_maker/doc/images/node_3d_sphere.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_adjust_hsv.png b/addons/material_maker/doc/images/node_adjust_hsv.png deleted file mode 100644 index d779741..0000000 Binary files a/addons/material_maker/doc/images/node_adjust_hsv.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_blend.png b/addons/material_maker/doc/images/node_blend.png deleted file mode 100644 index 379aa16..0000000 Binary files a/addons/material_maker/doc/images/node_blend.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_blur.png b/addons/material_maker/doc/images/node_blur.png deleted file mode 100644 index 556ed40..0000000 Binary files a/addons/material_maker/doc/images/node_blur.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_bricks.png b/addons/material_maker/doc/images/node_bricks.png deleted file mode 100644 index b3abdb2..0000000 Binary files a/addons/material_maker/doc/images/node_bricks.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_brightness_contrast.png b/addons/material_maker/doc/images/node_brightness_contrast.png deleted file mode 100644 index 62cf05a..0000000 Binary files a/addons/material_maker/doc/images/node_brightness_contrast.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_buffer.png b/addons/material_maker/doc/images/node_buffer.png deleted file mode 100644 index c89a52f..0000000 Binary files a/addons/material_maker/doc/images/node_buffer.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_color_noise.png b/addons/material_maker/doc/images/node_color_noise.png deleted file mode 100644 index 6d47be7..0000000 Binary files a/addons/material_maker/doc/images/node_color_noise.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_colorize.png b/addons/material_maker/doc/images/node_colorize.png deleted file mode 100644 index ed07f56..0000000 Binary files a/addons/material_maker/doc/images/node_colorize.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_combine.png b/addons/material_maker/doc/images/node_combine.png deleted file mode 100644 index c57da6e..0000000 Binary files a/addons/material_maker/doc/images/node_combine.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_customuv.png b/addons/material_maker/doc/images/node_customuv.png deleted file mode 100644 index 5d37ead..0000000 Binary files a/addons/material_maker/doc/images/node_customuv.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_debug.png b/addons/material_maker/doc/images/node_debug.png deleted file mode 100644 index 8fae855..0000000 Binary files a/addons/material_maker/doc/images/node_debug.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_decompose.png b/addons/material_maker/doc/images/node_decompose.png deleted file mode 100644 index f4924d1..0000000 Binary files a/addons/material_maker/doc/images/node_decompose.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_directional_blur.png b/addons/material_maker/doc/images/node_directional_blur.png deleted file mode 100644 index 28431d5..0000000 Binary files a/addons/material_maker/doc/images/node_directional_blur.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_edge_detect.png b/addons/material_maker/doc/images/node_edge_detect.png deleted file mode 100644 index afc5eec..0000000 Binary files a/addons/material_maker/doc/images/node_edge_detect.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_emboss.png b/addons/material_maker/doc/images/node_emboss.png deleted file mode 100644 index 1181b7a..0000000 Binary files a/addons/material_maker/doc/images/node_emboss.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_export.png b/addons/material_maker/doc/images/node_export.png deleted file mode 100644 index 0bc00ab..0000000 Binary files a/addons/material_maker/doc/images/node_export.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_fibers.png b/addons/material_maker/doc/images/node_fibers.png deleted file mode 100644 index 725dd0b..0000000 Binary files a/addons/material_maker/doc/images/node_fibers.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_greyscale.png b/addons/material_maker/doc/images/node_greyscale.png deleted file mode 100644 index ddc83a4..0000000 Binary files a/addons/material_maker/doc/images/node_greyscale.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_invert.png b/addons/material_maker/doc/images/node_invert.png deleted file mode 100644 index cf5f1c4..0000000 Binary files a/addons/material_maker/doc/images/node_invert.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_kaleidoscope.png b/addons/material_maker/doc/images/node_kaleidoscope.png deleted file mode 100644 index 889a369..0000000 Binary files a/addons/material_maker/doc/images/node_kaleidoscope.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_mirror.png b/addons/material_maker/doc/images/node_mirror.png deleted file mode 100644 index ca2557f..0000000 Binary files a/addons/material_maker/doc/images/node_mirror.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_noise.png b/addons/material_maker/doc/images/node_noise.png deleted file mode 100644 index d55ee6f..0000000 Binary files a/addons/material_maker/doc/images/node_noise.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_normal_map.png b/addons/material_maker/doc/images/node_normal_map.png deleted file mode 100644 index 07e52ec..0000000 Binary files a/addons/material_maker/doc/images/node_normal_map.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_occlusion.png b/addons/material_maker/doc/images/node_occlusion.png deleted file mode 100644 index be82b7c..0000000 Binary files a/addons/material_maker/doc/images/node_occlusion.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_pattern.png b/addons/material_maker/doc/images/node_pattern.png deleted file mode 100644 index 83a0af0..0000000 Binary files a/addons/material_maker/doc/images/node_pattern.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_perlin.png b/addons/material_maker/doc/images/node_perlin.png deleted file mode 100644 index bb0de6b..0000000 Binary files a/addons/material_maker/doc/images/node_perlin.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_quantize.png b/addons/material_maker/doc/images/node_quantize.png deleted file mode 100644 index 90dbe2c..0000000 Binary files a/addons/material_maker/doc/images/node_quantize.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_remote.png b/addons/material_maker/doc/images/node_remote.png deleted file mode 100644 index ff7b846..0000000 Binary files a/addons/material_maker/doc/images/node_remote.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_runes.png b/addons/material_maker/doc/images/node_runes.png deleted file mode 100644 index 67cf5f4..0000000 Binary files a/addons/material_maker/doc/images/node_runes.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_scratches.png b/addons/material_maker/doc/images/node_scratches.png deleted file mode 100644 index 8a0de8e..0000000 Binary files a/addons/material_maker/doc/images/node_scratches.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdannularshape.png b/addons/material_maker/doc/images/node_sdannularshape.png deleted file mode 100644 index 1408485..0000000 Binary files a/addons/material_maker/doc/images/node_sdannularshape.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdboolean.png b/addons/material_maker/doc/images/node_sdboolean.png deleted file mode 100644 index dc8b031..0000000 Binary files a/addons/material_maker/doc/images/node_sdboolean.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdbox.png b/addons/material_maker/doc/images/node_sdbox.png deleted file mode 100644 index f866a08..0000000 Binary files a/addons/material_maker/doc/images/node_sdbox.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdcircle.png b/addons/material_maker/doc/images/node_sdcircle.png deleted file mode 100644 index 3798408..0000000 Binary files a/addons/material_maker/doc/images/node_sdcircle.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_boolean.png b/addons/material_maker/doc/images/node_sdf3d_boolean.png deleted file mode 100644 index 5b8462e..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_boolean.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_box.png b/addons/material_maker/doc/images/node_sdf3d_box.png deleted file mode 100644 index 837d182..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_box.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_capsule.png b/addons/material_maker/doc/images/node_sdf3d_capsule.png deleted file mode 100644 index 96a2fda..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_capsule.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_circlerepeat.png b/addons/material_maker/doc/images/node_sdf3d_circlerepeat.png deleted file mode 100644 index 4cb9004..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_circlerepeat.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_cone.png b/addons/material_maker/doc/images/node_sdf3d_cone.png deleted file mode 100644 index da6f654..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_cone.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_cylinder.png b/addons/material_maker/doc/images/node_sdf3d_cylinder.png deleted file mode 100644 index 584c7c9..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_cylinder.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_extrusion.png b/addons/material_maker/doc/images/node_sdf3d_extrusion.png deleted file mode 100644 index 4284f51..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_extrusion.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_morph.png b/addons/material_maker/doc/images/node_sdf3d_morph.png deleted file mode 100644 index 2c64791..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_morph.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_render.png b/addons/material_maker/doc/images/node_sdf3d_render.png deleted file mode 100644 index d439a29..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_render.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_repeat.png b/addons/material_maker/doc/images/node_sdf3d_repeat.png deleted file mode 100644 index d187979..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_repeat.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_revolution.png b/addons/material_maker/doc/images/node_sdf3d_revolution.png deleted file mode 100644 index 2102b51..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_revolution.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_rotate.png b/addons/material_maker/doc/images/node_sdf3d_rotate.png deleted file mode 100644 index 140c506..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_rotate.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_roundedshape.png b/addons/material_maker/doc/images/node_sdf3d_roundedshape.png deleted file mode 100644 index bb0aff1..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_roundedshape.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_scale.png b/addons/material_maker/doc/images/node_sdf3d_scale.png deleted file mode 100644 index 75cf7c5..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_scale.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_smoothboolean.png b/addons/material_maker/doc/images/node_sdf3d_smoothboolean.png deleted file mode 100644 index 58f5df2..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_smoothboolean.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_sphere.png b/addons/material_maker/doc/images/node_sdf3d_sphere.png deleted file mode 100644 index 56551b0..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_sphere.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_torus.png b/addons/material_maker/doc/images/node_sdf3d_torus.png deleted file mode 100644 index b1ee336..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_torus.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdf3d_translate.png b/addons/material_maker/doc/images/node_sdf3d_translate.png deleted file mode 100644 index 2e3e8f3..0000000 Binary files a/addons/material_maker/doc/images/node_sdf3d_translate.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdline.png b/addons/material_maker/doc/images/node_sdline.png deleted file mode 100644 index f15cdcf..0000000 Binary files a/addons/material_maker/doc/images/node_sdline.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdmorph.png b/addons/material_maker/doc/images/node_sdmorph.png deleted file mode 100644 index 1199b2f..0000000 Binary files a/addons/material_maker/doc/images/node_sdmorph.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdrhombus.png b/addons/material_maker/doc/images/node_sdrhombus.png deleted file mode 100644 index 2100a84..0000000 Binary files a/addons/material_maker/doc/images/node_sdrhombus.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdroundedshape.png b/addons/material_maker/doc/images/node_sdroundedshape.png deleted file mode 100644 index 1694866..0000000 Binary files a/addons/material_maker/doc/images/node_sdroundedshape.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdshow.png b/addons/material_maker/doc/images/node_sdshow.png deleted file mode 100644 index 5bf221f..0000000 Binary files a/addons/material_maker/doc/images/node_sdshow.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sdsmoothboolean.png b/addons/material_maker/doc/images/node_sdsmoothboolean.png deleted file mode 100644 index 683d077..0000000 Binary files a/addons/material_maker/doc/images/node_sdsmoothboolean.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_shape.png b/addons/material_maker/doc/images/node_shape.png deleted file mode 100644 index 47194db..0000000 Binary files a/addons/material_maker/doc/images/node_shape.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_sharpen.png b/addons/material_maker/doc/images/node_sharpen.png deleted file mode 100644 index 82734d2..0000000 Binary files a/addons/material_maker/doc/images/node_sharpen.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_swapchannel.png b/addons/material_maker/doc/images/node_swapchannel.png deleted file mode 100644 index 8c6e17a..0000000 Binary files a/addons/material_maker/doc/images/node_swapchannel.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_transform.png b/addons/material_maker/doc/images/node_transform.png deleted file mode 100644 index cad7be7..0000000 Binary files a/addons/material_maker/doc/images/node_transform.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_truchet.png b/addons/material_maker/doc/images/node_truchet.png deleted file mode 100644 index 481f7ee..0000000 Binary files a/addons/material_maker/doc/images/node_truchet.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_voronoi.png b/addons/material_maker/doc/images/node_voronoi.png deleted file mode 100644 index e52c509..0000000 Binary files a/addons/material_maker/doc/images/node_voronoi.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_warp.png b/addons/material_maker/doc/images/node_warp.png deleted file mode 100644 index 272b52e..0000000 Binary files a/addons/material_maker/doc/images/node_warp.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_weave.png b/addons/material_maker/doc/images/node_weave.png deleted file mode 100644 index 9e558b7..0000000 Binary files a/addons/material_maker/doc/images/node_weave.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_workflow_applymap.png b/addons/material_maker/doc/images/node_workflow_applymap.png deleted file mode 100644 index 31b4102..0000000 Binary files a/addons/material_maker/doc/images/node_workflow_applymap.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_workflow_createmap.png b/addons/material_maker/doc/images/node_workflow_createmap.png deleted file mode 100644 index 8510171..0000000 Binary files a/addons/material_maker/doc/images/node_workflow_createmap.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_workflow_mix.png b/addons/material_maker/doc/images/node_workflow_mix.png deleted file mode 100644 index 8b088d3..0000000 Binary files a/addons/material_maker/doc/images/node_workflow_mix.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_workflow_mixmaps.png b/addons/material_maker/doc/images/node_workflow_mixmaps.png deleted file mode 100644 index f7f6c2b..0000000 Binary files a/addons/material_maker/doc/images/node_workflow_mixmaps.png and /dev/null differ diff --git a/addons/material_maker/doc/images/node_workflow_output.png b/addons/material_maker/doc/images/node_workflow_output.png deleted file mode 100644 index 255b288..0000000 Binary files a/addons/material_maker/doc/images/node_workflow_output.png and /dev/null differ diff --git a/addons/material_maker/engine/gen_base.gd b/addons/material_maker/engine/gen_base.gd index acc3eab..e787b08 100644 --- a/addons/material_maker/engine/gen_base.gd +++ b/addons/material_maker/engine/gen_base.gd @@ -37,17 +37,6 @@ var parameters = {} var seed_locked : bool = false var seed_value : int = 0 -const PORT_TYPE_NAMES : Array = [ "f", "rgb", "rgba", "sdf2d", "sdf3d" ] - -const PORT_TYPES : Dictionary = { - f = { type="float", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.5, 0.5, 0.5) }, - rgb = { type="vec3", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.5, 0.5, 1.0) }, - rgba = { type="vec4", paramdefs="vec2 uv", params="uv", slot_type=0, color=Color(0.0, 0.5, 0.0, 0.5) }, - sdf2d = { type="float", paramdefs="vec2 uv", params="uv", slot_type=1, color=Color(1.0, 0.5, 0.0) }, - sdf3d = { type="float", paramdefs="vec3 p", params="p", slot_type=2, color=Color(1.0, 0.0, 0.0) }, - any = { slot_type=42, color=Color(1.0, 1.0, 1.0) } -} - func _ready() -> void: init_parameters() @@ -150,7 +139,7 @@ func get_targets(output_index : int) -> Array: return [] # get the list of outputs that depend on the input whose index is passed as parameter -func follow_input(input_index : int) -> Array: +func follow_input(_input_index : int) -> Array: var rv = [] for i in range(get_output_defs().size()): rv.push_back(OutputPort.new(self, i)) @@ -165,6 +154,31 @@ func get_input_shader(input_index : int) -> Dictionary: func get_shader(output_index : int, context) -> Dictionary: return get_shader_code("UV", output_index, context) +func generate_preview_shader(src_code, type) -> String: + var code + code = "shader_type canvas_item;\n" + code += "render_mode blend_disabled;\n" + code += "uniform float preview_size = 64;\n" + var file = File.new() + file.open("res://addons/material_maker/common.shader", File.READ) + code += file.get_as_text() + code += "\n" + if src_code.has("textures"): + for t in src_code.textures.keys(): + code += "uniform sampler2D "+t+";\n" + if src_code.has("globals"): + for g in src_code.globals: + code += g + var shader_code = src_code.defs + if src_code.has(type): + var preview_code : String = mm_io_types.types[type].preview + preview_code = preview_code.replace("$(code)", src_code.code) + preview_code = preview_code.replace("$(value)", src_code[type]) + shader_code += preview_code + #print("GENERATED SHADER:\n"+shader_code) + code += shader_code + return code + func render(output_index : int, size : int, preview : bool = false) -> Object: var context : MMGenContext = MMGenContext.new() var source = get_shader_code("uv", output_index, context) @@ -174,7 +188,11 @@ func render(output_index : int, size : int, preview : bool = false) -> Object: source = { defs="", code="", textures={}, rgba="vec4(0.0)" } var shader : String if preview: - shader = mm_renderer.generate_preview_shader(source) + var output_type = "rgba" + var outputs = get_output_defs() + if outputs.size() > output_index: + output_type = outputs[output_index].type + shader = generate_preview_shader(source, output_type) else: shader = mm_renderer.generate_shader(source) var result = mm_renderer.render_shader(shader, source.textures, size) @@ -186,20 +204,15 @@ func get_shader_code(uv : String, output_index : int, context : MMGenContext) -> var rv = _get_shader_code(uv, output_index, context) while rv is GDScriptFunctionState: rv = yield(rv, "completed") - if !rv.empty(): - if !rv.has("f"): - if rv.has("rgb"): - rv.f = "(dot("+rv.rgb+", vec3(1.0))/3.0)" - elif rv.has("rgba"): - rv.f = "(dot("+rv.rgba+".rgb, vec3(1.0))/3.0)" - if !rv.has("rgb"): - if rv.has("rgba"): - rv.rgb = rv.rgba+".rgb" - elif rv.has("f"): - rv.rgb = "vec3("+rv.f+")" - if !rv.has("rgba"): - if rv.has("rgb"): - rv.rgba = "vec4("+rv.rgb+", 1.0)" + if rv.has("type") and mm_io_types.types.has(rv.type): + if mm_io_types.types[rv.type].has("convert"): + for c in mm_io_types.types[rv.type].convert: + if !rv.has(c.type): + var expr = c.expr.replace("$(value)", rv[rv.type]) + rv[c.type] = expr + else: + print("Missing type for node ") + print(rv) return rv func _get_shader_code(__, __, __) -> Dictionary: @@ -212,8 +225,11 @@ func _serialize(data: Dictionary) -> Dictionary: func serialize() -> Dictionary: var rv = { name=name, type=get_type(), parameters={}, node_position={ x=position.x, y=position.y } } - for p in parameters.keys(): - rv.parameters[p] = MMType.serialize_value(parameters[p]) + for p in get_parameter_defs(): + if parameters.has(p.name): + rv.parameters[p.name] = MMType.serialize_value(parameters[p.name]) + else: + rv.parameters[p.name] = p.default if seed_locked: rv.seed_value = seed_value if model != null: @@ -222,7 +238,7 @@ func serialize() -> Dictionary: rv = _serialize(rv) return rv -func _deserialize(data : Dictionary) -> void: +func _deserialize(_data : Dictionary) -> void: pass func deserialize(data : Dictionary) -> void: diff --git a/addons/material_maker/engine/gen_convolution.gd b/addons/material_maker/engine/gen_convolution.gd index ad9b89b..f1b1f61 100644 --- a/addons/material_maker/engine/gen_convolution.gd +++ b/addons/material_maker/engine/gen_convolution.gd @@ -174,6 +174,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - for t in src_code.textures.keys(): rv.textures[t] = src_code.textures[t] rv[convolution_params.output_type] = "%s_%d" % [ genname, variant_index ] + rv.type = convolution_params.output_type return rv diff --git a/addons/material_maker/engine/gen_graph.gd b/addons/material_maker/engine/gen_graph.gd index 078d8eb..8136463 100644 --- a/addons/material_maker/engine/gen_graph.gd +++ b/addons/material_maker/engine/gen_graph.gd @@ -331,5 +331,4 @@ func _deserialize(data : Dictionary) -> void: if data.has("label"): label = data.label var nodes = data.nodes if data.has("nodes") else [] - var connections = data.connections if data.has("connections") else [] - load("res://addons/material_maker/engine/loader.gd").add_to_gen_graph(self, nodes, connections) + mm_loader.add_to_gen_graph(self, nodes, data.connections if data.has("connections") else []) diff --git a/addons/material_maker/engine/gen_ios.gd b/addons/material_maker/engine/gen_ios.gd index d7d30fe..3e2437f 100644 --- a/addons/material_maker/engine/gen_ios.gd +++ b/addons/material_maker/engine/gen_ios.gd @@ -55,7 +55,6 @@ func set_port_name(i : int, n : String) -> void: ports[i].name = n func set_port_type(i : int, t : String) -> void: - print(t) ports[i].type = t emit_signal("parameter_changed", "__update_all__", null) diff --git a/addons/material_maker/engine/gen_remote.gd b/addons/material_maker/engine/gen_remote.gd index ea1da41..5ca6782 100644 --- a/addons/material_maker/engine/gen_remote.gd +++ b/addons/material_maker/engine/gen_remote.gd @@ -37,7 +37,6 @@ func get_next_widget_name() -> String: func fix() -> void: # Make sure all widgets have a name - var i = 0 for w in widgets: if !w.has("name"): w.name = get_next_widget_name() @@ -76,7 +75,6 @@ func get_type_name() -> String: func get_parameter_defs() -> Array: var rv = [] - var i = 0 for w in widgets: match w.type: "config_control": @@ -90,7 +88,6 @@ func get_parameter_defs() -> Array: for c in configurations: p.values.push_back({ name=c, value=c }) rv.append(p) - i += 1 "linked_control": var linked = w.linked_widgets[0] var p : Dictionary @@ -105,7 +102,6 @@ func get_parameter_defs() -> Array: p.name = w.name p.label = w.label rv.append(p) - i += 1 _: print("Unsupported widget of type "+str(w.type)) return rv diff --git a/addons/material_maker/engine/gen_shader.gd b/addons/material_maker/engine/gen_shader.gd index cf6b11b..3410f79 100644 --- a/addons/material_maker/engine/gen_shader.gd +++ b/addons/material_maker/engine/gen_shader.gd @@ -55,7 +55,7 @@ func set_shader_model(data: Dictionary) -> void: for i in range(shader_model.outputs.size()): var output = shader_model.outputs[i] var output_code = "" - for f in PORT_TYPES.keys(): + for f in mm_io_types.types.keys(): if output.has(f): shader_model.outputs[i].type = f output_code = output[f] @@ -78,7 +78,6 @@ func find_keyword_call(string, keyword): return null var parenthesis_level = 0 var parameter_begin = position+search_string.length() - var parameter_end = -1 for i in range(parameter_begin, string.length()): if string[i] == '(': parenthesis_level += 1 @@ -126,7 +125,7 @@ func replace_input(string : String, context, input : String, type : String, src if src_code.has(type): src_code.string = src_code[type] else: - src_code.string = "*error*" + src_code.string = "*error missing "+type+"*\n"+JSON.print(src_code) # Add global definitions if src_code.has("globals"): for d in src_code.globals: @@ -236,10 +235,6 @@ func subst(string : String, context : MMGenContext, uv : String = "") -> Diction cont = changed and new_pass_required return { string=string, globals=required_globals, defs=required_defs, code=required_code, textures=required_textures } -func create_input_function(function_name : String, input_index : int, context : MMGenContext) -> Dictionary: - var rv = { globals=[], defs="", code="", textures={} } - return rv - func _get_shader_code(uv : String, output_index : int, context : MMGenContext) -> Dictionary: var genname = "o"+str(get_instance_id()) var rv = { globals=[], defs="", code="", textures={} } @@ -260,7 +255,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - var input = shader_model.inputs[i] if input.has("function") and input.function: var source = get_source(i) - var string = "$%s(%s)" % [ input.name, PORT_TYPES[input.type].params ] + var string = "$%s(%s)" % [ input.name, mm_io_types.types[input.type].params ] var local_context = MMGenContext.new(context) var result = replace_input(string, local_context, input.name, input.type, source, input.default) while result is GDScriptFunctionState: @@ -274,7 +269,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - # Add textures for t in result.textures.keys(): rv.textures[t] = result.textures[t] - rv.defs += "%s %s_input_%s(%s) {\n" % [ PORT_TYPES[input.type].type, genname, input.name, PORT_TYPES[input.type].paramdefs ] + rv.defs += "%s %s_input_%s(%s) {\n" % [ mm_io_types.types[input.type].type, genname, input.name, mm_io_types.types[input.type].paramdefs ] rv.defs += "%s\n" % result.code rv.defs += "return %s;\n}\n" % result.string if shader_model.has("instance"): @@ -307,7 +302,7 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - var variant_index = context.get_variant(self, variant_string) if variant_index == -1: variant_index = context.get_variant(self, variant_string) - for f in PORT_TYPES.keys(): + for f in mm_io_types.types.keys(): if output.has(f): var subst_output = subst(output[f], context, uv) while subst_output is GDScriptFunctionState: @@ -320,12 +315,13 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - rv.defs += subst_output.defs # Add generated code rv.code += subst_output.code - rv.code += "%s %s_%d_%d_%s = %s;\n" % [ PORT_TYPES[f].type, genname, output_index, variant_index, f, subst_output.string ] + rv.code += "%s %s_%d_%d_%s = %s;\n" % [ mm_io_types.types[f].type, genname, output_index, variant_index, f, subst_output.string ] for t in subst_output.textures.keys(): rv.textures[t] = subst_output.textures[t] - for f in PORT_TYPES.keys(): + for f in mm_io_types.types.keys(): if output.has(f): rv[f] = "%s_%d_%d_%s" % [ genname, output_index, variant_index, f ] + rv.type = output.type if shader_model.has("global") && rv.globals.find(shader_model.global) == -1: rv.globals.push_back(shader_model.global) return rv diff --git a/addons/material_maker/engine/gen_texture.gd b/addons/material_maker/engine/gen_texture.gd index 0b90b33..db344a7 100644 --- a/addons/material_maker/engine/gen_texture.gd +++ b/addons/material_maker/engine/gen_texture.gd @@ -9,11 +9,11 @@ Base class for texture generators that provide a texture as output var texture : ImageTexture = ImageTexture.new() func get_output_defs() -> Array: - return [ { rgba="" } ] + return [ { rgba="", type="rgba" } ] func _get_shader_code_lod(uv : String, output_index : int, context : MMGenContext, lod : float = 0.0) -> Dictionary: var genname = "o"+str(get_instance_id()) - var rv = { globals=[], defs="", code="" } + var rv = { globals=[], defs="", code="", type="rgba" } var texture_name = genname+"_tex" var variant_index = context.get_variant(self, uv) if variant_index == -1: diff --git a/addons/material_maker/engine/io_types.gd b/addons/material_maker/engine/io_types.gd new file mode 100644 index 0000000..5bf862f --- /dev/null +++ b/addons/material_maker/engine/io_types.gd @@ -0,0 +1,22 @@ +tool +extends Node + +var type_names : Array = [] +var types : Dictionary = {} + +func _ready(): + var file = File.new() + if file.open("res://addons/material_maker/nodes/io_types.mmt", File.READ) != OK: + print("Cannot read types") + return false + var type_list = parse_json(file.get_as_text()) + file.close() + for t in type_list: + if t.has("label"): + type_names.push_back(t.name) + var c = t.color + t.color = Color(c.r, c.g, c.b, c.a) + if file.open("res://addons/material_maker/nodes/preview_"+t.name+".shader", File.READ) == OK: + t.preview = file.get_as_text() + file.close() + types[t.name] = t diff --git a/addons/material_maker/engine/loader.gd b/addons/material_maker/engine/loader.gd index f974215..10f7ec4 100644 --- a/addons/material_maker/engine/loader.gd +++ b/addons/material_maker/engine/loader.gd @@ -1,23 +1,42 @@ tool -extends Object -class_name MMGenLoader +extends Node const STD_GENDEF_PATH = "res://addons/material_maker/nodes" -static func generator_name_from_path(path : String) -> String: +var predefined_generators = {} + +func _ready()-> void: + update_predefined_generators() + +func update_predefined_generators()-> void: + predefined_generators = {} + for path in [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ]: + var dir = Directory.new() + if dir.open(path) == OK: + dir.list_dir_begin() + var file_name = dir.get_next() + while file_name != "": + if !dir.current_is_dir() and file_name.get_extension() == "mmg": + var file : File = File.new() + if file.open(path+"/"+file_name, File.READ) == OK: + predefined_generators[file_name.get_basename()] = parse_json(file.get_as_text()) + file.close() + file_name = dir.get_next() + +func generator_name_from_path(path : String) -> String: for p in [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ]: print(p) print(path.get_base_dir()) return path.get_basename().get_file() -static func load_gen(filename: String) -> MMGenBase: +func load_gen(filename: String) -> MMGenBase: var file = File.new() if file.open(filename, File.READ) == OK: var data = parse_json(file.get_as_text()) return create_gen(data) return null -static func add_to_gen_graph(gen_graph, generators, connections) -> Dictionary: +func add_to_gen_graph(gen_graph, generators, connections) -> Dictionary: var rv = { generators=[], connections=[] } var gennames = {} for n in generators: @@ -35,7 +54,7 @@ static func add_to_gen_graph(gen_graph, generators, connections) -> Dictionary: rv.connections.append(c) return rv -static func create_gen(data) -> MMGenBase: +func create_gen(data) -> MMGenBase: var guess = [ { keyword="connections", type=MMGenGraph }, { keyword="nodes", type=MMGenGraph }, @@ -64,22 +83,11 @@ static func create_gen(data) -> MMGenBase: if types.has(data.type): generator = types[data.type].new() else: - var file = File.new() - var gen_paths = [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ] - for p in gen_paths: - if file.open(p+"/"+data.type+".mmg", File.READ) == OK: - generator = create_gen(parse_json(file.get_as_text())) - generator.model = data.type - file.close() - break - elif file.open(p+"/"+data.type+".mmn", File.READ) == OK: - generator = MMGenShader.new() - generator.model = data.type - generator.set_shader_model(parse_json(file.get_as_text())) - file.close() - break + generator = create_gen(predefined_generators[data.type]) if generator == null: print("Cannot find description for "+data.type) + else: + generator.model = data.type if generator != null: generator.name = data.type if generator == null: @@ -88,7 +96,7 @@ static func create_gen(data) -> MMGenBase: generator.deserialize(data) return generator -static func get_generator_list() -> Array: +func get_generator_list() -> Array: var rv = [] var dir : Directory = Directory.new() for p in [ STD_GENDEF_PATH, OS.get_executable_path().get_base_dir()+"/generators" ]: diff --git a/addons/material_maker/engine/renderer.gd b/addons/material_maker/engine/renderer.gd index 94e0fd6..70c2980 100644 --- a/addons/material_maker/engine/renderer.gd +++ b/addons/material_maker/engine/renderer.gd @@ -38,75 +38,6 @@ static func generate_shader(src_code) -> String: code += shader_code return code -static func generate_preview_shader(src_code) -> String: - var code - code = "shader_type canvas_item;\n" - code += "render_mode blend_disabled;\n" - code += "uniform float preview_size = 64;\n" - var file = File.new() - file.open("res://addons/material_maker/common.shader", File.READ) - code += file.get_as_text() - code += "\n" - if src_code.has("textures"): - for t in src_code.textures.keys(): - code += "uniform sampler2D "+t+";\n" - if src_code.has("globals"): - for g in src_code.globals: - code += g - var shader_code = src_code.defs - if src_code.has("rgba"): - shader_code += "\nvoid fragment() {\n" - shader_code += "vec2 uv = UV;\n" - shader_code += src_code.code - shader_code += "COLOR = "+src_code.rgba+";\n" - shader_code += "}\n" - elif src_code.has("sdf2d"): - shader_code += "\nvoid fragment() {\n" - shader_code += "vec2 uv = UV;\n" - shader_code += src_code.code - shader_code += "float d = "+src_code.sdf2d+";\n" - shader_code += "vec3 col = vec3(cos(d*min(256, preview_size)));\n" - shader_code += "col *= clamp(1.0-d*d, 0.0, 1.0);\n" - shader_code += "col *= vec3(1.0, vec2(step(-0.015, d)));\n" - shader_code += "col *= vec3(vec2(step(d, 0.015)), 1.0);\n" - shader_code += "COLOR = vec4(col, 1.0);\n" - shader_code += "}\n" - elif src_code.has("sdf3d"): - shader_code += "\nfloat calcdist(vec3 uv) {\n" - shader_code += src_code.code - shader_code += "return min("+src_code.sdf3d+", uv.z);\n" - shader_code += "}\n" - shader_code += "float raymarch(vec3 ro, vec3 rd) {\n" - shader_code += "float d=0.0;\n" - shader_code += "for (int i = 0; i < 50; i++) {\n" - shader_code += "vec3 p = ro + rd*d;\n" - shader_code += "float dstep = calcdist(p);\n" - shader_code += "d += dstep;\n" - shader_code += "if (dstep < 0.0001) break;\n" - shader_code += "}\n" - shader_code += "return d;\n" - shader_code += "}\n" - shader_code += "vec3 normal(vec3 p) {\n" - shader_code += " float d = calcdist(p);\n" - shader_code += " float e = .0001;\n" - shader_code += " 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)));\n" - shader_code += " return normalize(n);\n" - shader_code += "}\n" - shader_code += "\nvoid fragment() {\n" - shader_code += "vec2 uv = UV-vec2(0.5);\n" - shader_code += "vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n" - shader_code += "vec3 n = normal(p);\n" - shader_code += "vec3 l = vec3(5.0, 5.0, 10.0);\n" - shader_code += "vec3 ld = normalize(l-p);\n" - shader_code += "float o = step(p.z, 0.001);\n" - shader_code += "float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);\n" - shader_code += "float light = 0.3+0.7*dot(n, ld)*shadow;\n" - shader_code += "COLOR = vec4(vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light, 1.0);\n" - shader_code += "}\n" - #print("GENERATED SHADER:\n"+shader_code) - code += shader_code - return code - static func generate_combined_shader(red_code, green_code, blue_code) -> String: var code code = "shader_type canvas_item;\n" diff --git a/addons/material_maker/import_plugin/ptex_spatial_material.gd b/addons/material_maker/import_plugin/ptex_spatial_material.gd index c347e00..b9310a5 100644 --- a/addons/material_maker/import_plugin/ptex_spatial_material.gd +++ b/addons/material_maker/import_plugin/ptex_spatial_material.gd @@ -13,8 +13,7 @@ func set_ptex(s : String) -> void : call_deferred("update_texture") func update_texture() -> void: - var loader = MMGenLoader.new() - var mm_graph = loader.create_gen(parse_json(ptex)) + var mm_graph = mm_loader.create_gen(parse_json(ptex)) if mm_graph == null: return var mm_material : MMGenMaterial = mm_graph.get_node("Material") diff --git a/addons/material_maker/nodes/bricks.mmg b/addons/material_maker/nodes/bricks.mmg index 7246a9e..aba14ac 100644 --- a/addons/material_maker/nodes/bricks.mmg +++ b/addons/material_maker/nodes/bricks.mmg @@ -10,7 +10,7 @@ "corner": 0, "mortar": 0.1, "pattern": 0, - "repeat": 1, + "repeat": 2, "round": 0, "row_offset": 0.5, "rows": 6 @@ -29,7 +29,7 @@ "type": "f" }, { - "rgb": "rand3(vec2($(name_uv).w, $(seed)))", + "rgb": "rand3(fract($(name_uv)_rect.xy)+rand2(vec2($seed)))", "type": "rgb" }, { diff --git a/addons/material_maker/nodes/fbm.mmg b/addons/material_maker/nodes/fbm.mmg new file mode 100644 index 0000000..6ce950a --- /dev/null +++ b/addons/material_maker/nodes/fbm.mmg @@ -0,0 +1,92 @@ +{ + "name": "fbm", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "iterations": 3, + "noise": 0, + "persistence": 0.5, + "scale_x": 4, + "scale_y": 4 + }, + "shader_model": { + "code": "", + "global": "float fbm_value(vec2 coord, vec2 size, float seed) {\n\tvec2 o = floor(coord)+rand2(vec2(float(seed), 1.0-float(seed)))+size;\n\tvec2 f = fract(coord);\n\tfloat p00 = rand(mod(o, size));\n\tfloat p01 = rand(mod(o + vec2(0.0, 1.0), size));\n\tfloat p10 = rand(mod(o + vec2(1.0, 0.0), size));\n\tfloat p11 = rand(mod(o + vec2(1.0, 1.0), size));\n\tvec2 t = f * f * (3.0 - 2.0 * f);\n\treturn mix(mix(p00, p10, t.x), mix(p01, p11, t.x), t.y);\n}\n\nfloat fbm_perlin(vec2 coord, vec2 size, float seed) {\n\tvec2 o = floor(coord)+rand2(vec2(float(seed), 1.0-float(seed)))+size;\n\tvec2 f = fract(coord);\n\tfloat a00 = rand(mod(o, size)) * 6.28318530718;\n\tfloat a01 = rand(mod(o + vec2(0.0, 1.0), size)) * 6.28318530718;\n\tfloat a10 = rand(mod(o + vec2(1.0, 0.0), size)) * 6.28318530718;\n\tfloat a11 = rand(mod(o + vec2(1.0, 1.0), size)) * 6.28318530718;\n\tvec2 v00 = vec2(cos(a00), sin(a00));\n\tvec2 v01 = vec2(cos(a01), sin(a01));\n\tvec2 v10 = vec2(cos(a10), sin(a10));\n\tvec2 v11 = vec2(cos(a11), sin(a11));\n\tfloat p00 = dot(v00, f);\n\tfloat p01 = dot(v01, f - vec2(0.0, 1.0));\n\tfloat p10 = dot(v10, f - vec2(1.0, 0.0));\n\tfloat p11 = dot(v11, f - vec2(1.0, 1.0));\n\tvec2 t = f * f * (3.0 - 2.0 * f);\n\treturn 0.5 + mix(mix(p00, p10, t.x), mix(p01, p11, t.x), t.y);\n}\n\nfloat fbm_cellular(vec2 coord, vec2 size, float seed) {\n\tvec2 o = floor(coord)+rand2(vec2(float(seed), 1.0-float(seed)))+size;\n\tvec2 f = fract(coord);\n\tfloat min_dist = 2.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\tvec2 node = rand2(mod(o + vec2(x, y), size)) + vec2(x, y);\n\t\t\tfloat dist = sqrt((f - node).x * (f - node).x + (f - node).y * (f - node).y);\n\t\t\tmin_dist = min(min_dist, dist);\n\t\t}\n\t}\n\treturn min_dist;\n}\n", + "inputs": [ + + ], + "instance": "float $(name)_fbm(vec2 coord, vec2 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 += 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", + "name": "FBM", + "outputs": [ + { + "f": "$(name)_fbm($(uv), vec2($(scale_x), $(scale_y)), int($(iterations)), $(persistence), $(seed))", + "type": "f" + } + ], + "parameters": [ + { + "default": 2, + "label": "Noise", + "name": "noise", + "type": "enum", + "values": [ + { + "name": "Value", + "value": "value" + }, + { + "name": "Perlin", + "value": "perlin" + }, + { + "name": "Cellular", + "value": "cellular" + } + ] + }, + { + "control": "None", + "default": 4, + "label": "Scale X", + "max": 32, + "min": 1, + "name": "scale_x", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Scale Y", + "max": 32, + "min": 1, + "name": "scale_y", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 3, + "label": "Iterations", + "max": 10, + "min": 1, + "name": "iterations", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "Persistance", + "max": 1, + "min": 0, + "name": "persistence", + "step": 0.05, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/io_types.mmt b/addons/material_maker/nodes/io_types.mmt new file mode 100644 index 0000000..d1a8f66 --- /dev/null +++ b/addons/material_maker/nodes/io_types.mmt @@ -0,0 +1,88 @@ +[ + { + "name":"f", + "label":"Greyscale", + "type":"float", + "paramdefs":"vec2 uv", + "params":"uv", + "slot_type":0, + "convert":[ + { "type":"rgb", "expr":"vec3($(value))" }, + { "type":"rgba", "expr":"vec4(vec3($(value)), 1.0)" } + ], + "color":{ "r":0.5, "g":0.5, "b":0.5, "a":1.0 } + }, + { + "name":"rgb", + "label":"Color", + "type":"vec3", + "paramdefs":"vec2 uv", + "params":"uv", + "slot_type":0, + "convert":[ + { "type":"f", "expr":"(dot($(value), vec3(1.0))/3.0)" }, + { "type":"rgba", "expr":"vec4($(value), 1.0)" } + ], + "color":{ "r":0.5, "g":0.5, "b":1.0, "a":1.0 } + }, + { + "name":"rgba", + "label":"RGBA", + "type":"vec4", + "paramdefs":"vec2 uv", + "params":"uv", + "slot_type":0, + "convert":[ + { "type":"f", "expr":"(dot(($(value)).rgb, vec3(1.0))/3.0)" }, + { "type":"rgb", "expr":"(($(value)).rgb)" } + ], + "color":{ "r":0.0, "g":0.5, "b":0.0, "a":0.5 } + }, + { + "name":"sdf2d", + "label":"SDF2D", + "type":"float", + "paramdefs":"vec2 uv", + "params":"uv", + "slot_type":1, + "color":{ "r":1.0, "g":0.5, "b":0.0, "a":1.0 } + }, + { + "name":"sdf3d", + "label":"SDF3D", + "type":"float", + "paramdefs":"vec3 p", + "params":"p", + "slot_type":2, + "convert":[ + { "type":"sdf3dc", "expr":"vec2($(value), 0.0)" } + ], + "color":{ "r":0.5, "g":0.0, "b":0.0, "a":1.0 } + }, + { + "name":"sdf3dc", + "label":"SDF3D-C", + "type":"vec2", + "paramdefs":"vec3 p", + "params":"p", + "slot_type":2, + "convert":[ + { "type":"sdf3d", "expr":"($(value)).x" } + ], + "color":{ "r":1.0, "g":0.0, "b":0.0, "a":1.0 } + }, + { + "name":"tex3d", + "label":"TEX3D", + "type":"vec3", + "paramdefs":"vec4 p", + "params":"p", + "slot_type":3, + "color":{ "r":1.0, "g":0.0, "b":1.0, "a":1.0 } + }, + { + "name":"any", + "slot_type":42, + "color":{ "r":1.0, "g":1.0, "b":1.0, "a":1.0 } + } +] diff --git a/addons/material_maker/nodes/mul_detect.mmg b/addons/material_maker/nodes/mul_detect.mmg new file mode 100644 index 0000000..bb58248 --- /dev/null +++ b/addons/material_maker/nodes/mul_detect.mmg @@ -0,0 +1,60 @@ +{ + "name": "mul_detect", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "t": 0.01, + "v": 0.5 + }, + "shader_model": { + "code": "float $(name_uv)_d = ($in($uv)-$v)/$t;", + "global": "", + "inputs": [ + { + "default": "1.0", + "label": "", + "name": "mul", + "type": "f" + }, + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "MulDetect", + "outputs": [ + { + "f": "$mul($uv)*clamp(1.0-$(name_uv)_d*$(name_uv)_d, 0.0, 1.0)", + "type": "f" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "Value", + "max": 1, + "min": 0, + "name": "v", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0.1, + "label": "Tolerance", + "max": 1, + "min": 0.01, + "name": "t", + "step": 0.001, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/preview_f.shader b/addons/material_maker/nodes/preview_f.shader new file mode 100644 index 0000000..fc4f1d5 --- /dev/null +++ b/addons/material_maker/nodes/preview_f.shader @@ -0,0 +1,5 @@ +void fragment() { + vec2 uv = UV; + $(code) + COLOR = vec4(vec3($(value)), 1.0); +} diff --git a/addons/material_maker/nodes/preview_rgb.shader b/addons/material_maker/nodes/preview_rgb.shader new file mode 100644 index 0000000..416d73e --- /dev/null +++ b/addons/material_maker/nodes/preview_rgb.shader @@ -0,0 +1,5 @@ +void fragment() { + vec2 uv = UV; + $(code) + COLOR = vec4($(value), 1.0); +} diff --git a/addons/material_maker/nodes/preview_rgba.shader b/addons/material_maker/nodes/preview_rgba.shader new file mode 100644 index 0000000..be33b4b --- /dev/null +++ b/addons/material_maker/nodes/preview_rgba.shader @@ -0,0 +1,5 @@ +void fragment() { + vec2 uv = UV; + $(code) + COLOR = $(value); +} diff --git a/addons/material_maker/nodes/preview_sdf2d.shader b/addons/material_maker/nodes/preview_sdf2d.shader new file mode 100644 index 0000000..33bbb32 --- /dev/null +++ b/addons/material_maker/nodes/preview_sdf2d.shader @@ -0,0 +1,10 @@ +void fragment() { + vec2 uv = UV; + $(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); + COLOR = vec4(col, 1.0); +} diff --git a/addons/material_maker/nodes/preview_sdf3d.shader b/addons/material_maker/nodes/preview_sdf3d.shader new file mode 100644 index 0000000..25d87c6 --- /dev/null +++ b/addons/material_maker/nodes/preview_sdf3d.shader @@ -0,0 +1,33 @@ +float calcdist(vec3 uv) { + $(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); +} + +void fragment() { + 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; + COLOR = vec4(vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light, 1.0); +} diff --git a/addons/material_maker/nodes/preview_sdf3dc.shader b/addons/material_maker/nodes/preview_sdf3dc.shader new file mode 100644 index 0000000..7c6ebbe --- /dev/null +++ b/addons/material_maker/nodes/preview_sdf3dc.shader @@ -0,0 +1,45 @@ +vec2 calcdist(vec3 uv) { + $(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); +} + +void fragment() { + 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; + COLOR = vec4(mix(rm_color(fract(rm.y)), vec3(0.9), o)*light, 1.0); +} diff --git a/addons/material_maker/nodes/preview_tex3d.shader b/addons/material_maker/nodes/preview_tex3d.shader new file mode 100644 index 0000000..97962ae --- /dev/null +++ b/addons/material_maker/nodes/preview_tex3d.shader @@ -0,0 +1,37 @@ +float calcdist(vec3 p) { + return length(p)-0.4; +} + +vec3 calcColor(vec4 uv) { + $(code) + return $(value); +} + +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); +} + +void fragment() { + 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; + COLOR = vec4(calcColor(vec4(p, 0.0))*light, 1.0); +} diff --git a/addons/material_maker/nodes/raymarching.mmg b/addons/material_maker/nodes/raymarching.mmg index 770058a..20012a6 100644 --- a/addons/material_maker/nodes/raymarching.mmg +++ b/addons/material_maker/nodes/raymarching.mmg @@ -8,7 +8,7 @@ }, "shader_model": { - "code": "float $(name_uv)_d = raymarch_$name($uv);\n", + "code": "vec2 $(name_uv)_d = raymarch_$name($uv);\n", "global": "", "inputs": [ { @@ -16,19 +16,23 @@ "function": true, "label": "", "name": "sdf", - "type": "sdf3d" + "type": "sdf3dc" } ], - "instance": "float input_$name(vec3 p) {\n\tif (p.z > 0.0) {\n\t\treturn $sdf(p);\n\t} else {\n\t\treturn p.z;\n\t}\n}\n\nfloat raymarch_$name(vec2 uv) {\n\tvec3 ro = vec3(uv-vec2(0.5), 1.0);\n\tvec3 rd = vec3(0.0, 0.0, -1.0);\n\tfloat dO=0.;\n \n for (int i=0; i < 25; i++) {\n \tvec3 p = ro + rd*dO;\n float dS = input_$name(p);\n dO += dS;\n if (dO > 1.0 || dS < 0.0001) break;\n }\n \n return dO;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = input_$name(p);\n float e = .001;\n \n vec3 n = d - vec3(\n input_$name(p-vec3(e, 0.0, 0.0)),\n input_$name(p-vec3(0.0, e, 0.0)),\n input_$name(p-vec3(0.0, 0.0, e)));\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n", + "instance": "vec2 raymarch_$name(vec2 uv) {\n\tvec3 ro = vec3(uv-vec2(0.5), 1.0);\n\tvec3 rd = vec3(0.0, 0.0, -1.0);\n\tfloat dO = 0.0;\n\tfloat c = 0.0;\n for (int i=0; i < 100; i++) {\n \tvec3 p = ro + rd*dO;\n vec2 dS = $sdf(p);\n dO += dS.x;\n\n if (dO >= 1.0) {\n\t\t\tbreak;\n\t\t} else if (dS.x < 0.0001) {\n\t\t\tc = dS.y;\n\t\t\tbreak;\n\t\t}\n }\n \n return vec2(dO, c);\n}\n\nvec3 normal_$name(vec3 p) {\n\tif (p.z <= 0.0) {\n\t\treturn vec3(0.0, 0.0, 1.0);\n\t}\n\n\tfloat d = $sdf(p).x;\n float e = .001;\n \n vec3 n = d - vec3(\n $sdf(p-vec3(e, 0.0, 0.0)).x,\n $sdf(p-vec3(0.0, e, 0.0)).x,\n $sdf(p-vec3(0.0, 0.0, e)).x);\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n", "name": "Raymarching", "outputs": [ { - "f": "1.0-$(name_uv)_d", + "f": "1.0-$(name_uv)_d.x", "type": "f" }, { - "rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d))", + "rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d.x))", "type": "rgb" + }, + { + "f": "$(name_uv)_d.y", + "type": "f" } ], "parameters": [ diff --git a/addons/material_maker/nodes/sdf3d_boolean.mmg b/addons/material_maker/nodes/sdf3d_boolean.mmg index 417e9ba..c99649d 100644 --- a/addons/material_maker/nodes/sdf3d_boolean.mmg +++ b/addons/material_maker/nodes/sdf3d_boolean.mmg @@ -5,57 +5,51 @@ "y": 0 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "shader_model": { "code": "", - "global": "", + "global": "vec2 sdf3dc_union(vec2 a, vec2 b) {\n\treturn vec2(min(a.x, b.x), mix(b.y, a.y, step(a.x, b.x)));\n}\nvec2 sdf3dc_sub(vec2 a, vec2 b) {\n\treturn vec2(max(-a.x, b.x), a.y);\n}\nvec2 sdf3dc_inter(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, b.x), mix(a.y, b.y, step(a.x, b.x)));\n}\n", "inputs": [ { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in1", - "type": "sdf3d" + "type": "sdf3dc" }, { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in2", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Boolean", "outputs": [ { - "sdf3d": "$op $in1($uv), $in2($uv))", - "type": "sdf3d" + "sdf3dc": "$op($in1($uv), $in2($uv))", + "type": "sdf3dc" } ], "parameters": [ { - "default": 1, + "default": 2, "label": "", "name": "op", "type": "enum", "values": [ { "name": "Union", - "value": "min(" + "value": "sdf3dc_union" }, { "name": "Subtraction", - "value": "max(-" + "value": "sdf3dc_sub" }, { "name": "Intersection", - "value": "max(" + "value": "sdf3dc_inter" } ] } diff --git a/addons/material_maker/nodes/sdf3d_circle_repeat.mmg b/addons/material_maker/nodes/sdf3d_circle_repeat.mmg index 889944a..a0f65d1 100644 --- a/addons/material_maker/nodes/sdf3d_circle_repeat.mmg +++ b/addons/material_maker/nodes/sdf3d_circle_repeat.mmg @@ -6,7 +6,7 @@ }, "parameters": { "a": 0, - "c": 4, + "c": 5, "r": 0.24, "rx": 4, "ry": 4, @@ -20,22 +20,23 @@ "global": "vec3 circle_repeat_transform(vec3 p, float count) {\n\tfloat r = 6.28/count;\n\tfloat pa = atan(p.x, p.y);\n\tfloat a = mod(pa+0.5*r, r)-0.5*r;\n\tvec3 rv;\n\tfloat c = cos(a-pa);\n\tfloat s = sin(a-pa);\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": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Circle Repeat", "outputs": [ { - "sdf3d": "$in(circle_repeat_transform($uv, $c))", - "type": "sdf3d" + "sdf3dc": "$in(circle_repeat_transform($uv, $c))", + "type": "sdf3dc" } ], "parameters": [ { + "control": "None", "default": 4, "label": "", "max": 32, diff --git a/addons/material_maker/nodes/sdf3d_color.mmg b/addons/material_maker/nodes/sdf3d_color.mmg new file mode 100644 index 0000000..290c473 --- /dev/null +++ b/addons/material_maker/nodes/sdf3d_color.mmg @@ -0,0 +1,51 @@ +{ + "name": "sdf3d_color", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "bevel": 0, + "c": 0.5, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Color", + "outputs": [ + { + "sdf3dc": "vec2($in($uv), $c)", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "c", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/sdf3d_elongation.mmg b/addons/material_maker/nodes/sdf3d_elongation.mmg new file mode 100644 index 0000000..9fcd763 --- /dev/null +++ b/addons/material_maker/nodes/sdf3d_elongation.mmg @@ -0,0 +1,65 @@ +{ + "name": "sdf3d_elongation", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "x": 0.2, + "y": 0, + "z": 0 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec2(0.0)", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Elongation", + "outputs": [ + { + "sdf3dc": "$in($uv-clamp($uv, -abs(vec3($x, $y, $z)), abs(vec3($x, $y, $z))))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "P1.x", + "default": 0, + "label": "X", + "max": 1, + "min": 0, + "name": "x", + "step": 0.01, + "type": "float" + }, + { + "control": "P1.y", + "default": 0, + "label": "Y", + "max": 1, + "min": 0, + "name": "y", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Z", + "max": 1, + "min": 0, + "name": "z", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/sdf3d_repeat.mmg b/addons/material_maker/nodes/sdf3d_repeat.mmg index 3e2875c..de3daed 100644 --- a/addons/material_maker/nodes/sdf3d_repeat.mmg +++ b/addons/material_maker/nodes/sdf3d_repeat.mmg @@ -6,9 +6,9 @@ }, "parameters": { "a": 0, - "r": 0.24, - "rx": 4, - "ry": 4, + "r": 0.3, + "rx": 3, + "ry": 3, "s": 0.3, "x": 0.35, "y": 0, @@ -19,22 +19,23 @@ "global": "vec3 repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 a = (rand3(floor(mod((p.xy+0.5*r.xy)/r.xy, 1.0/r.xy)+vec2(seed)))-0.5)*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\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": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Repeat", "outputs": [ { - "sdf3d": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", - "type": "sdf3d" + "sdf3dc": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", + "type": "sdf3dc" } ], "parameters": [ { + "control": "None", "default": 4, "label": "X", "max": 32, @@ -44,6 +45,7 @@ "type": "float" }, { + "control": "None", "default": 4, "label": "Y", "max": 32, @@ -53,6 +55,7 @@ "type": "float" }, { + "control": "None", "default": 0.5, "label": "R", "max": 1, diff --git a/addons/material_maker/nodes/sdf3d_rotate.mmg b/addons/material_maker/nodes/sdf3d_rotate.mmg index 588e943..f0f3dad 100644 --- a/addons/material_maker/nodes/sdf3d_rotate.mmg +++ b/addons/material_maker/nodes/sdf3d_rotate.mmg @@ -18,22 +18,23 @@ "global": "vec3 rotate3d(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": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Rotate", "outputs": [ { - "sdf3d": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))", - "type": "sdf3d" + "sdf3dc": "$in(rotate3d($uv, -vec3($ax, $ay, $az)*0.01745329251))", + "type": "sdf3dc" } ], "parameters": [ { + "control": "None", "default": 0, "label": "X", "max": 180, @@ -43,6 +44,7 @@ "type": "float" }, { + "control": "None", "default": 0, "label": "Y", "max": 180, @@ -52,6 +54,7 @@ "type": "float" }, { + "control": "None", "default": 0, "label": "Z", "max": 180, diff --git a/addons/material_maker/nodes/sdf3d_rounded.mmg b/addons/material_maker/nodes/sdf3d_rounded.mmg index 87ce10b..fdf3491 100644 --- a/addons/material_maker/nodes/sdf3d_rounded.mmg +++ b/addons/material_maker/nodes/sdf3d_rounded.mmg @@ -11,30 +11,31 @@ "h": 0.08, "k": 0.15, "op": 0, - "r": 0.05, + "r": 0.1, "w": 0.28 }, "shader_model": { - "code": "", + "code": "vec2 $(name_uv)_v = $in($uv);", "global": "", "inputs": [ { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Rounded", "outputs": [ { - "sdf3d": "$in($uv)-$r", - "type": "sdf3d" + "sdf3dc": "vec2($(name_uv)_v.x-$r, $(name_uv)_v.y)", + "type": "sdf3dc" } ], "parameters": [ { + "control": "None", "default": 0, "label": "", "max": 1, diff --git a/addons/material_maker/nodes/sdf3d_scale.mmg b/addons/material_maker/nodes/sdf3d_scale.mmg index 9cec47e..b6727a9 100644 --- a/addons/material_maker/nodes/sdf3d_scale.mmg +++ b/addons/material_maker/nodes/sdf3d_scale.mmg @@ -12,22 +12,22 @@ "z": 0 }, "shader_model": { - "code": "", + "code": "vec2 $(name_uv)_in = $in(($uv)/$s);", "global": "", "inputs": [ { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Scale", "outputs": [ { - "sdf3d": "$in(($uv)/$s)*$s", - "type": "sdf3d" + "sdf3dc": "vec2($(name_uv)_in.x*$s, $(name_uv)_in.y)", + "type": "sdf3dc" } ], "parameters": [ diff --git a/addons/material_maker/nodes/sdf3d_smoothboolean.mmg b/addons/material_maker/nodes/sdf3d_smoothboolean.mmg index ff3ac8a..42e2062 100644 --- a/addons/material_maker/nodes/sdf3d_smoothboolean.mmg +++ b/addons/material_maker/nodes/sdf3d_smoothboolean.mmg @@ -10,57 +10,58 @@ "cy": 0, "h": 0.08, "k": 0.1, - "op": 0, + "op": 2, "r": 0.3, "w": 0.28 }, "shader_model": { "code": "", - "global": "float sdf3SmoothUnion(float d1, float d2, float k) {\n float h = clamp(0.5+0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)-k*h*(1.0-h);\n}\n\nfloat sdf3SmoothSubtraction( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2+d1)/k, 0.0, 1.0);\n return mix( d2, -d1, h )+k*h*(1.0-h);\n}\n\nfloat sdf3SmoothIntersection( float d1, float d2, float k ) {\n float h = clamp(0.5-0.5*(d2-d1)/k, 0.0, 1.0);\n return mix(d2, d1, h)+k*h*(1.0-h);\n}\n", + "global": "vec2 sdf3d_smooth_union(vec2 d1, vec2 d2, float k) {\n float h = clamp(0.5+0.5*(d2.x-d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, d1.x, h)-k*h*(1.0-h), mix(d2.y, d1.y, step(d1.x, d2.x)));\n}\n\nvec2 sdf3d_smooth_subtraction(vec2 d1, vec2 d2, float k ) {\n float h = clamp(0.5-0.5*(d2.x+d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, -d1.x, h )+k*h*(1.0-h), d2.y);\n}\n\nvec2 sdf3d_smooth_intersection(vec2 d1, vec2 d2, float k ) {\n float h = clamp(0.5-0.5*(d2.x-d1.x)/k, 0.0, 1.0);\n return vec2(mix(d2.x, d1.x, h)+k*h*(1.0-h), mix(d1.y, d2.y, step(d1.x, d2.x)));\n}\n", "inputs": [ { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in1", - "type": "sdf3d" + "type": "sdf3dc" }, { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in2", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", - "name": "sdSmoothBoolean", + "name": "SmoothBoolean", "outputs": [ { - "sdf3d": "sdf3Smooth$op($in1($uv), $in2($uv), $k)", - "type": "sdf3d" + "sdf3dc": "sdf3d_smooth_$op($in1($uv), $in2($uv), $k)", + "type": "sdf3dc" } ], "parameters": [ { - "default": 0, + "default": 2, "label": "", "name": "op", "type": "enum", "values": [ { "name": "Union", - "value": "Union" + "value": "union" }, { "name": "Subtraction", - "value": "Subtraction" + "value": "subtraction" }, { "name": "Intersection", - "value": "Intersection" + "value": "intersection" } ] }, { + "control": "None", "default": 0, "label": "", "max": 1, diff --git a/addons/material_maker/nodes/sdf3d_translate.mmg b/addons/material_maker/nodes/sdf3d_translate.mmg index 141810f..732a9b4 100644 --- a/addons/material_maker/nodes/sdf3d_translate.mmg +++ b/addons/material_maker/nodes/sdf3d_translate.mmg @@ -14,18 +14,18 @@ "global": "", "inputs": [ { - "default": "0.0", + "default": "vec2(0.0)", "label": "", "name": "in", - "type": "sdf3d" + "type": "sdf3dc" } ], "instance": "", "name": "Translate", "outputs": [ { - "sdf3d": "$in($uv-vec3($x, $y, $z))", - "type": "sdf3d" + "sdf3dc": "$in($uv-vec3($x, $y, $z))", + "type": "sdf3dc" } ], "parameters": [ diff --git a/addons/material_maker/nodes/shape.mmg b/addons/material_maker/nodes/shape.mmg index ced36f9..7093eed 100644 --- a/addons/material_maker/nodes/shape.mmg +++ b/addons/material_maker/nodes/shape.mmg @@ -5,18 +5,23 @@ "y": 0 }, "parameters": { - "edge": 0.2, - "radius": 1, - "shape": 0, - "sides": 3 + "edge": 0.5, + "radius": 0.9, + "shape": 1, + "sides": 6 }, "shader_model": { + "code": "", "global": "float shape_circle(vec2 uv, float sides, float size, float edge) {\n uv = 2.0*uv-1.0;\n\tedge = max(edge, 1.0e-8);\n float distance = length(uv);\n return clamp((1.0-distance/size)/edge, 0.0, 1.0);\n}\n\nfloat shape_polygon(vec2 uv, float sides, float size, float edge) {\n uv = 2.0*uv-1.0;\n\tedge = max(edge, 1.0e-8);\n float angle = atan(uv.x, uv.y)+3.14159265359;\n float slice = 6.28318530718/sides;\n return clamp((size-cos(floor(0.5+angle/slice)*slice-angle)*length(uv))/(edge*size), 0.0, 1.0);\n}\n\nfloat shape_star(vec2 uv, float sides, float size, float edge) {\n uv = 2.0*uv-1.0;\n\tedge = max(edge, 1.0e-8);\n float angle = atan(uv.x, uv.y);\n float slice = 6.28318530718/sides;\n return clamp((size-cos(floor(1.5+angle/slice-2.0*step(0.5*slice, mod(angle, slice)))*slice-angle)*length(uv))/(edge*size), 0.0, 1.0);\n}\n\nfloat shape_curved_star(vec2 uv, float sides, float size, float edge) {\n uv = 2.0*uv-1.0;\n\tedge = max(edge, 1.0e-8);\n float angle = 2.0*(atan(uv.x, uv.y)+3.14159265359);\n float slice = 6.28318530718/sides;\n return clamp((size-cos(floor(0.5+0.5*angle/slice)*2.0*slice-angle)*length(uv))/(edge*size), 0.0, 1.0);\n}\n\nfloat shape_rays(vec2 uv, float sides, float size, float edge) {\n uv = 2.0*uv-1.0;\n\tedge = 0.5*max(edge, 1.0e-8)*size;\n\tfloat slice = 6.28318530718/sides;\n float angle = mod(atan(uv.x, uv.y)+3.14159265359, slice)/slice;\n return clamp(min((size-angle)/edge, angle/edge), 0.0, 1.0);\n}\n\n", + "inputs": [ + + ], "instance": "", "name": "Shape", "outputs": [ { - "f": "shape_$(shape)($(uv), $(sides), $(radius), $(edge))" + "f": "shape_$(shape)($(uv), $(sides), $(radius), $(edge))", + "type": "f" } ], "parameters": [ @@ -49,6 +54,7 @@ ] }, { + "control": "None", "default": 3, "label": "", "max": 32, @@ -58,23 +64,26 @@ "type": "float" }, { + "control": "None", "default": 1, "label": "", "max": 1, "min": 0, "name": "radius", - "step": 0, + "step": 0.01, "type": "float" }, { + "control": "None", "default": 0.2, "label": "", "max": 1, "min": 0, "name": "edge", - "step": 0, + "step": 0.01, "type": "float" } ] - } + }, + "type": "shader" } \ No newline at end of file diff --git a/addons/material_maker/nodes/splatter.mmg b/addons/material_maker/nodes/splatter.mmg new file mode 100644 index 0000000..921f71c --- /dev/null +++ b/addons/material_maker/nodes/splatter.mmg @@ -0,0 +1,94 @@ +{ + "name": "splatter", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "count": 30, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "function": true, + "label": "", + "name": "in", + "type": "f" + }, + { + "default": "1.0", + "function": true, + "label": "", + "name": "mask", + "type": "f" + } + ], + "instance": "float splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tfloat c = 0.0;\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\tfloat mask = $mask(seed+vec2(0.5));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\t$select_inputs\n\t\t\tc = max(c, $in(pv)*mask);\n\t\t}\n\t}\n\treturn c;\n}", + "name": "Splatter", + "outputs": [ + { + "f": "splatter_$(name)($uv, int($count), vec2($seed))", + "type": "f" + } + ], + "parameters": [ + { + "control": "None", + "default": 10, + "label": "Count", + "max": 100, + "min": 1, + "name": "count", + "step": 1, + "type": "float" + }, + { + "default": 0, + "label": "Inputs", + "name": "select_inputs", + "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": "Rotate", + "max": 180, + "min": 0, + "name": "rotate", + "step": 0.1, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Scale", + "max": 1, + "min": 0, + "name": "scale", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/splatter_color.mmg b/addons/material_maker/nodes/splatter_color.mmg new file mode 100644 index 0000000..4158172 --- /dev/null +++ b/addons/material_maker/nodes/splatter_color.mmg @@ -0,0 +1,94 @@ +{ + "name": "splatter_color", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "count": 30, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec4(0.0)", + "function": true, + "label": "", + "name": "in", + "type": "rgba" + }, + { + "default": "1.0", + "function": true, + "label": "", + "name": "mask", + "type": "f" + } + ], + "instance": "vec4 splatter_$(name)(vec2 uv, int count, vec2 seed) {\n\tvec4 c = vec4(0.0);\n\tfor (int i = 0; i < count; ++i) {\n\t\tseed = rand2(seed);\n\t\tfloat mask = $mask(seed+vec2(0.5));\n\t\tif (mask > 0.01) {\n\t\t\tvec2 pv = fract(uv - seed)-vec2(0.5);\n\t\t\tseed = rand2(seed);\n\t\t\tfloat angle = (seed.x * 2.0 - 1.0) * $rotate;\n\t\t\tfloat ca = cos(angle);\n\t\t\tfloat sa = sin(angle);\n\t\t\tpv = vec2(ca*pv.x+sa*pv.y, -sa*pv.x+ca*pv.y);\n\t\t\tpv *= (seed.y-0.5)*2.0*$scale+1.0;\n\t\t\tpv += vec2(0.5);\n\t\t\t$select_inputs\n\t\t\tvec4 n = $in(pv);\n\t\t\tfloat na = n.a*mask;\n\t\t\tfloat a = (1.0-c.a)*(1.0*na);\n\t\t\tc = mix(c, n, na);\n\t\t}\n\t}\n\treturn c;\n}\n", + "name": "Color Splatter", + "outputs": [ + { + "rgba": "splatter_$(name)($uv, int($count), vec2($seed))", + "type": "rgba" + } + ], + "parameters": [ + { + "control": "None", + "default": 10, + "label": "Count", + "max": 100, + "min": 1, + "name": "count", + "step": 1, + "type": "float" + }, + { + "default": 0, + "label": "Inputs", + "name": "select_inputs", + "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": "Rotate", + "max": 180, + "min": 0, + "name": "rotate", + "step": 0.1, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Scale", + "max": 1, + "min": 0, + "name": "scale", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_apply.mmg b/addons/material_maker/nodes/tex3d_apply.mmg new file mode 100644 index 0000000..22e9b86 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_apply.mmg @@ -0,0 +1,46 @@ +{ + "name": "tex3d_apply", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "Height", + "name": "z", + "type": "f" + }, + { + "default": "0.0", + "label": "Color", + "name": "c", + "type": "f" + }, + { + "default": "vec3(1.0)", + "label": "Texture", + "name": "t", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Apply", + "outputs": [ + { + "rgb": "$t(vec4($uv, $z($uv), $c($uv)))", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_blend.mmg b/addons/material_maker/nodes/tex3d_blend.mmg new file mode 100644 index 0000000..1436b34 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_blend.mmg @@ -0,0 +1,108 @@ +{ + "name": "tex3d_blend", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "amount": 1, + "blend_type": 1 + }, + "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(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*max(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*min(c1, c2) + (1.0-opacity)*c2;\n}\n\nvec3 blend3d_difference(vec2 uv, vec3 c1, vec3 c2, float opacity) {\n\treturn opacity*clamp(c2-c1, vec3(0.0), vec3(1.0)) + (1.0-opacity)*c2;\n}\n", + "inputs": [ + { + "default": "vec3($uv.x, 1.0, 1.0)", + "label": "Source1", + "name": "s1", + "type": "tex3d" + }, + { + "default": "vec3(1.0, $uv.y, 1.0)", + "label": "Source2", + "name": "s2", + "type": "tex3d" + }, + { + "default": "vec3(1.0)", + "label": "Opacity", + "name": "a", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Blend", + "outputs": [ + { + "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": "", + "name": "blend_type", + "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:", + "max": 1, + "min": 0, + "name": "amount", + "step": 0, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_colorize.mmg b/addons/material_maker/nodes/tex3d_colorize.mmg new file mode 100644 index 0000000..522deb7 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_colorize.mmg @@ -0,0 +1,99 @@ +{ + "name": "tex3d_colorize", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "Color": { + "a": 1, + "b": 0, + "g": 0.381909, + "r": 1, + "type": "Color" + }, + "bevel": 0, + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 1, + "type": "Color" + }, + "cx": 0, + "cy": 0, + "g": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0.071126, + "pos": 0, + "r": 0.119792 + }, + { + "a": 1, + "b": 0.372549, + "g": 0.756863, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + }, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec3($uv.x+0.5)", + "label": "", + "name": "in", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Colorize", + "outputs": [ + { + "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": "", + "name": "g", + "type": "gradient" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_distort.mmg b/addons/material_maker/nodes/tex3d_distort.mmg new file mode 100644 index 0000000..8ec2811 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_distort.mmg @@ -0,0 +1,71 @@ +{ + "name": "tex3d_distort", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "Color": { + "a": 1, + "b": 0.145098, + "g": 0.443137, + "r": 0.92549, + "type": "Color" + }, + "Distort": 0.3, + "bevel": 0, + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 1, + "type": "Color" + }, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec3(1.0)", + "label": "", + "name": "in1", + "type": "tex3d" + }, + { + "default": "vec3(0.0)", + "label": "", + "name": "in2", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Distort", + "outputs": [ + { + "tex3d": "$in1(vec4($uv.xyz+($in2($uv)*$Distort*0.5-0.5), 0.0))", + "type": "tex3d" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "Distort", + "max": 1, + "min": 0, + "name": "Distort", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_fbm.mmg b/addons/material_maker/nodes/tex3d_fbm.mmg new file mode 100644 index 0000000..dc496d5 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_fbm.mmg @@ -0,0 +1,103 @@ +{ + "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(float(seed), 1.0-float(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(float(seed), 1.0-float(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(float(seed), 1.0-float(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", + "name": "TEX3D FBM", + "outputs": [ + { + "tex3d": "vec3($(name)_fbm($(uv).xyz, vec3($(scale_x), $(scale_y), $(scale_z)), int($(iterations)), $(persistence), $(seed)))", + "type": "tex3d" + } + ], + "parameters": [ + { + "default": 2, + "label": "Noise", + "name": "noise", + "type": "enum", + "values": [ + { + "name": "Value", + "value": "value" + }, + { + "name": "Perlin", + "value": "perlin" + }, + { + "name": "Cellular", + "value": "cellular" + } + ] + }, + { + "control": "None", + "default": 4, + "label": "Scale X", + "max": 32, + "min": 1, + "name": "scale_x", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Scale Y", + "max": 32, + "min": 1, + "name": "scale_y", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Scale Z", + "max": 32, + "min": 1, + "name": "scale_z", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 3, + "label": "Iterations", + "max": 10, + "min": 1, + "name": "iterations", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "Persistance", + "max": 1, + "min": 0, + "name": "persistence", + "step": 0.05, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_from2d.mmg b/addons/material_maker/nodes/tex3d_from2d.mmg new file mode 100644 index 0000000..6333853 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_from2d.mmg @@ -0,0 +1,34 @@ +{ + "name": "tex3d_from2d", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec3(0.5)", + "label": "", + "name": "in", + "type": "rgb" + } + ], + "instance": "", + "name": "TEX3D From2D", + "outputs": [ + { + "tex3d": "$in($uv.xy+vec2(0.5))", + "type": "tex3d" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_pattern.mmg b/addons/material_maker/nodes/tex3d_pattern.mmg new file mode 100644 index 0000000..9fcfc74 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_pattern.mmg @@ -0,0 +1,192 @@ +{ + "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 mix_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}", + "name": "TEX3D Pattern", + "outputs": [ + { + "tex3d": "vec3($(name)_fct($(uv).xyz))", + "type": "tex3d" + } + ], + "parameters": [ + { + "default": 0, + "label": "Combiner", + "name": "mix", + "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", + "name": "x_wave", + "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:", + "max": 32, + "min": 0, + "name": "x_scale", + "step": 1, + "type": "float" + }, + { + "default": 0, + "label": "Y", + "name": "y_wave", + "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:", + "max": 32, + "min": 0, + "name": "y_scale", + "step": 1, + "type": "float" + }, + { + "default": 0, + "label": "Z", + "name": "z_wave", + "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:", + "max": 32, + "min": 0, + "name": "z_scale", + "step": 1, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_rotate.mmg b/addons/material_maker/nodes/tex3d_rotate.mmg new file mode 100644 index 0000000..4108577 --- /dev/null +++ b/addons/material_maker/nodes/tex3d_rotate.mmg @@ -0,0 +1,69 @@ +{ + "name": "tex3d_rotate", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "a": 0, + "ax": 0, + "ay": 0, + "az": 0, + "x": 0.35, + "y": 0, + "z": 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": "", + "name": "in", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Rotate", + "outputs": [ + { + "tex3d": "$in(vec4(tex3d_rotate($uv.xyz, -vec3($ax, $ay, $az)*0.01745329251), $uv.w))", + "type": "tex3d" + } + ], + "parameters": [ + { + "control": "None", + "default": 0, + "label": "X", + "max": 180, + "min": -180, + "name": "ax", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Y", + "max": 180, + "min": -180, + "name": "ay", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Z", + "max": 180, + "min": -180, + "name": "az", + "step": 1, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tex3d_select.mmg b/addons/material_maker/nodes/tex3d_select.mmg new file mode 100644 index 0000000..132fe7e --- /dev/null +++ b/addons/material_maker/nodes/tex3d_select.mmg @@ -0,0 +1,60 @@ +{ + "name": "tex3d_select", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "t": 0.01, + "v": 0.5 + }, + "shader_model": { + "code": "float $(name_uv)_d = ($uv.w-$v)/$t;", + "global": "", + "inputs": [ + { + "default": "vec3(0.5)", + "label": "", + "name": "in1", + "type": "tex3d" + }, + { + "default": "vec3(0.5)", + "label": "", + "name": "in2", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Select", + "outputs": [ + { + "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", + "max": 1, + "min": 0, + "name": "v", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0.1, + "label": "Tolerance", + "max": 1, + "min": 0.01, + "name": "t", + "step": 0.001, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/tile2x2.mmg b/addons/material_maker/nodes/tile2x2.mmg new file mode 100644 index 0000000..764fb83 --- /dev/null +++ b/addons/material_maker/nodes/tile2x2.mmg @@ -0,0 +1,52 @@ +{ + "name": "tile2x2", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec4(0.0)", + "label": "", + "name": "in1", + "type": "rgba" + }, + { + "default": "vec4(0.0)", + "label": "", + "name": "in2", + "type": "rgba" + }, + { + "default": "vec4(0.0)", + "label": "", + "name": "in3", + "type": "rgba" + }, + { + "default": "vec4(0.0)", + "label": "", + "name": "in4", + "type": "rgba" + } + ], + "instance": "", + "name": "Tile2x2", + "outputs": [ + { + "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))))", + "type": "rgba" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/plugin.gd b/addons/material_maker/plugin.gd index 67eaec6..b6b6011 100644 --- a/addons/material_maker/plugin.gd +++ b/addons/material_maker/plugin.gd @@ -13,7 +13,7 @@ func _exit_tree() -> void: importer = null func generate_material(ptex_filename: String) -> Material: - var generator = MMGenLoader.load_gen(ptex_filename) + var generator = mm_loader.load_gen(ptex_filename) add_child(generator) if generator.has_node("Material"): var gen_material = generator.get_node("Material") diff --git a/demo/demo.tscn b/demo/demo.tscn index 524bc97..adebca3 100644 --- a/demo/demo.tscn +++ b/demo/demo.tscn @@ -1,13 +1,16 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=10 format=2] -[ext_resource path="res://material_maker/examples/skulls.ptex" type="Material" id=1] +[ext_resource path="res://material_maker/examples/bricks.ptex" type="Material" id=1] [ext_resource path="res://material_maker/preview/panoramas/studio_sky.tres" type="Environment" id=2] +[ext_resource path="res://demo/object.tscn" type="PackedScene" id=3] +[ext_resource path="res://material_maker/examples/marble.ptex" type="Material" id=4] +[ext_resource path="res://material_maker/examples/medieval_wall.ptex" type="Material" id=5] +[ext_resource path="res://material_maker/examples/floor1.ptex" type="Material" id=6] +[ext_resource path="res://material_maker/examples/beehive.ptex" type="Material" id=7] -[sub_resource type="SphereMesh" id=1] - -[sub_resource type="Animation" id=2] +[sub_resource type="Animation" id=1] resource_name = "rotate" -length = 10.0 +length = 5.0 loop = true tracks/0/type = "value" tracks/0/path = NodePath("CamPivot:rotation_degrees") @@ -16,68 +19,66 @@ tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 10 ), +"times": PoolRealArray( 0, 5 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, "values": [ Vector3( 0, 0, 0 ), Vector3( 0, 360, 0 ) ] } -[sub_resource type="SpatialMaterial" id=4] -flags_unshaded = true -flags_do_not_receive_shadows = true - -[sub_resource type="SphereMesh" id=5] -material = SubResource( 4 ) -radius = 0.1 -height = 0.2 - -[sub_resource type="Animation" id=3] -resource_name = "rotate" -length = 5.0 +[sub_resource type="Animation" id=2] +resource_name = "move" +length = 50.0 loop = true tracks/0/type = "value" -tracks/0/path = NodePath("LightPivot:rotation_degrees") +tracks/0/path = NodePath("CamPivot:translation") tracks/0/interp = 1 tracks/0/loop_wrap = true tracks/0/imported = false tracks/0/enabled = true tracks/0/keys = { -"times": PoolRealArray( 0, 5 ), -"transitions": PoolRealArray( 1, 1 ), +"times": PoolRealArray( 0, 4, 5, 9, 10, 14, 15, 19, 20, 24, 25, 29, 30, 34, 35, 39, 40, 44, 45, 49 ), +"transitions": PoolRealArray( 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 ), "update": 0, -"values": [ Vector3( 0, 0, 0 ), Vector3( 360, 0, 0 ) ] +"values": [ Vector3( 0, 0, 0 ), Vector3( 0, 0, 0 ), Vector3( 0, 0, -5 ), Vector3( 0, 0, -5 ), Vector3( 0, 0, -10 ), Vector3( 0, 0, -10 ), Vector3( 0, 0, -15 ), Vector3( 0, 0, -15 ), Vector3( 0, 0, -20 ), Vector3( 0, 0, -20 ), Vector3( 0, 0, -25 ), Vector3( 0, 0, -25 ), Vector3( 0, 0, -20 ), Vector3( 0, 0, -20 ), Vector3( 0, 0, -15 ), Vector3( 0, 0, -15 ), Vector3( 0, 0, -10 ), Vector3( 0, 0, -10 ), Vector3( 0, 0, -5 ), Vector3( 0, 0, -5 ) ] } [node name="Spatial" type="Spatial"] -[node name="MeshInstance" type="MeshInstance" parent="."] -mesh = SubResource( 1 ) -material/0 = ExtResource( 1 ) - [node name="CamPivot" type="Spatial" parent="."] -transform = Transform( 0.982287, 0, 0.187381, 0, 1, 0, -0.187381, 0, 0.982287, 0, 0, 0 ) +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5 ) [node name="Camera" type="Camera" parent="CamPivot"] transform = Transform( 0.999487, 0.0319038, 0.00268748, -0.0319038, 0.985399, 0.167245, 0.00268751, -0.167245, 0.985912, 0.28563, 0.826821, 2.79088 ) [node name="CamRotate" type="AnimationPlayer" parent="."] autoplay = "rotate" -anims/rotate = SubResource( 2 ) +anims/rotate = SubResource( 1 ) -[node name="LightPivot" type="Spatial" parent="."] -transform = Transform( 1, 0, 0, 0, 0.929776, -0.368125, 0, 0.368125, 0.929776, 0, 0, 0 ) +[node name="CamMove" type="AnimationPlayer" parent="."] +autoplay = "move" +anims/move = SubResource( 2 ) -[node name="OmniLight" type="OmniLight" parent="LightPivot"] -transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0746527, 1.74306, 0 ) +[node name="Skulls" parent="." instance=ExtResource( 3 )] -[node name="MeshInstance" type="MeshInstance" parent="LightPivot/OmniLight"] -cast_shadow = 0 -mesh = SubResource( 5 ) -material/0 = null +[node name="Bricks" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -5 ) +material/0 = ExtResource( 1 ) -[node name="LightRotate" type="AnimationPlayer" parent="."] -autoplay = "rotate" -anims/rotate = SubResource( 3 ) +[node name="Floor" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -10 ) +material/0 = ExtResource( 6 ) + +[node name="Marble" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -15 ) +material/0 = ExtResource( 4 ) + +[node name="MedievalWall" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -20 ) +material/0 = ExtResource( 5 ) + +[node name="BeeHive" parent="." instance=ExtResource( 3 )] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -25 ) +material/0 = ExtResource( 7 ) [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = ExtResource( 2 ) diff --git a/demo/object.tscn b/demo/object.tscn new file mode 100644 index 0000000..ac597a8 --- /dev/null +++ b/demo/object.tscn @@ -0,0 +1,49 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://material_maker/examples/skulls.ptex" type="Material" id=1] + +[sub_resource type="SphereMesh" id=1] + +[sub_resource type="SpatialMaterial" id=2] +flags_unshaded = true +flags_do_not_receive_shadows = true + +[sub_resource type="SphereMesh" id=3] +material = SubResource( 2 ) +radius = 0.1 +height = 0.2 + +[sub_resource type="Animation" id=4] +length = 5.0 +loop = true +tracks/0/type = "value" +tracks/0/path = NodePath("LightPivot:rotation_degrees") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"times": PoolRealArray( 0, 5 ), +"transitions": PoolRealArray( 1, 1 ), +"update": 0, +"values": [ Vector3( 0, 0, 0 ), Vector3( 360, 0, 0 ) ] +} + +[node name="MeshInstance" type="MeshInstance"] +mesh = SubResource( 1 ) +material/0 = ExtResource( 1 ) + +[node name="LightPivot" type="Spatial" parent="."] +transform = Transform( 1, 0, 0, 0, 0.929776, -0.368125, 0, 0.368125, 0.929776, 0, 0, 0 ) + +[node name="OmniLight" type="OmniLight" parent="LightPivot"] +transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0.0746527, 1.74306, 0 ) + +[node name="MeshInstance" type="MeshInstance" parent="LightPivot/OmniLight"] +cast_shadow = 0 +mesh = SubResource( 3 ) +material/0 = null + +[node name="LightRotate" type="AnimationPlayer" parent="."] +autoplay = "rotate" +anims/rotate = SubResource( 4 ) diff --git a/export_presets.cfg b/export_presets.cfg index 3389fe6..5a32dec 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -1,8 +1,8 @@ [preset.0] -name="Windows Desktop" +name="Windows" platform="Windows Desktop" -runnable=true +runnable=false custom_features="" export_filter="resources" export_files=PoolStringArray( "res://addons/material_maker/common.shader", "res://addons/material_maker/engine/gen_base.gd", "res://addons/material_maker/engine/gen_buffer.gd", "res://addons/material_maker/engine/gen_comment.gd", "res://addons/material_maker/engine/gen_context.gd", "res://addons/material_maker/engine/gen_convolution.gd", "res://addons/material_maker/engine/gen_debug.gd", "res://addons/material_maker/engine/gen_export.gd", "res://addons/material_maker/engine/gen_graph.gd", "res://addons/material_maker/engine/gen_image.gd", "res://addons/material_maker/engine/gen_ios.gd", "res://addons/material_maker/engine/gen_material.gd", "res://addons/material_maker/engine/gen_remote.gd", "res://addons/material_maker/engine/gen_shader.gd", "res://addons/material_maker/engine/gen_switch.gd", "res://addons/material_maker/engine/gen_texture.gd", "res://addons/material_maker/engine/loader.gd", "res://addons/material_maker/engine/renderer.gd", "res://addons/material_maker/engine/renderer.tscn", "res://addons/material_maker/types/gradient.gd", "res://addons/material_maker/types/types.gd", "res://default_env.tres", "res://icon.png", "res://material_maker/environment.gd", "res://material_maker/fonts/hack.ttf", "res://material_maker/graph_edit.gd", "res://material_maker/graph_edit.tscn", "res://material_maker/icons/icon.png", "res://material_maker/icons/icons.svg", "res://material_maker/icons/link.tres", "res://material_maker/icons/randomness_locked.tres", "res://material_maker/icons/randomness_unlocked.tres", "res://material_maker/icons/remove.tres", "res://material_maker/library.gd", "res://material_maker/library.tscn", "res://material_maker/library_tree.gd", "res://material_maker/main_window.gd", "res://material_maker/main_window.tscn", "res://material_maker/node_factory.gd", "res://material_maker/nodes/base.gd", "res://material_maker/nodes/comment.gd", "res://material_maker/nodes/comment.tscn", "res://material_maker/nodes/debug.gd", "res://material_maker/nodes/debug.tscn", "res://material_maker/nodes/debug/debug_popup.gd", "res://material_maker/nodes/debug/debug_popup.tscn", "res://material_maker/nodes/edit_buttons.gd", "res://material_maker/nodes/edit_buttons.tscn", "res://material_maker/nodes/generic.gd", "res://material_maker/nodes/generic.tscn", "res://material_maker/nodes/image.gd", "res://material_maker/nodes/image.tscn", "res://material_maker/nodes/image/godot_logo.png", "res://material_maker/nodes/ios.gd", "res://material_maker/nodes/ios.tscn", "res://material_maker/nodes/ios/add.tscn", "res://material_maker/nodes/ios/port.gd", "res://material_maker/nodes/ios/port.tscn", "res://material_maker/nodes/remote.gd", "res://material_maker/nodes/remote.tscn", "res://material_maker/nodes/switch.gd", "res://material_maker/nodes/switch.tscn", "res://material_maker/preview/control_point.gd", "res://material_maker/preview/control_point.tscn", "res://material_maker/preview/panoramas/epping_forest_01.hdr", "res://material_maker/preview/panoramas/moonless_golf.hdr", "res://material_maker/preview/panoramas/studio_sky.tres", "res://material_maker/preview/preview_2d.gd", "res://material_maker/preview/preview_2d.tscn", "res://material_maker/preview/preview_3d.gd", "res://material_maker/preview/preview_3d.tscn", "res://material_maker/preview/preview_3d_scene.tscn", "res://material_maker/preview/preview_3d_ui.gd", "res://material_maker/preview/preview_3d_ui.tscn", "res://material_maker/preview/preview_light.gd", "res://material_maker/preview/preview_light.tscn", "res://material_maker/preview/preview_objects.tscn", "res://material_maker/widgets/about/about.gd", "res://material_maker/widgets/about/about.tscn", "res://material_maker/widgets/about/facebook.png", "res://material_maker/widgets/about/github.png", "res://material_maker/widgets/about/itchio.png", "res://material_maker/widgets/about/twitter.png", "res://material_maker/widgets/about/youtube.png", "res://material_maker/widgets/add_node_popup.gd", "res://material_maker/widgets/add_node_popup.tscn", "res://material_maker/widgets/float_edit.gd", "res://material_maker/widgets/float_edit.tscn", "res://material_maker/widgets/gradient_editor.gd", "res://material_maker/widgets/gradient_editor.tscn", "res://material_maker/widgets/gradient_popup.gd", "res://material_maker/widgets/gradient_popup.tscn", "res://material_maker/widgets/graph_tree/graph_tree.gd", "res://material_maker/widgets/graph_tree/graph_tree.tscn", "res://material_maker/widgets/hslider.gd", "res://material_maker/widgets/hslider.tscn", "res://material_maker/widgets/icon.png", "res://material_maker/widgets/line_dialog.gd", "res://material_maker/widgets/line_dialog.tscn", "res://material_maker/widgets/linked_widgets/editable_label.gd", "res://material_maker/widgets/linked_widgets/editable_label.tscn", "res://material_maker/widgets/linked_widgets/link.gd", "res://material_maker/widgets/node_editor.tscn", "res://material_maker/widgets/node_editor/enum_editor.gd", "res://material_maker/widgets/node_editor/enum_editor.tscn", "res://material_maker/widgets/node_editor/input.gd", "res://material_maker/widgets/node_editor/input.tscn", "res://material_maker/widgets/node_editor/node_editor.gd", "res://material_maker/widgets/node_editor/node_editor.tscn", "res://material_maker/widgets/node_editor/node_editor_item_list.gd", "res://material_maker/widgets/node_editor/output.gd", "res://material_maker/widgets/node_editor/output.tscn", "res://material_maker/widgets/node_editor/parameter.gd", "res://material_maker/widgets/node_editor/parameter.tscn", "res://material_maker/widgets/node_editor/parameter_boolean.gd", "res://material_maker/widgets/node_editor/parameter_boolean.tscn", "res://material_maker/widgets/node_editor/parameter_color.gd", "res://material_maker/widgets/node_editor/parameter_color.tscn", "res://material_maker/widgets/node_editor/parameter_enum.gd", "res://material_maker/widgets/node_editor/parameter_enum.tscn", "res://material_maker/widgets/node_editor/parameter_float.gd", "res://material_maker/widgets/node_editor/parameter_float.tscn", "res://material_maker/widgets/node_editor/parameter_gradient.gd", "res://material_maker/widgets/node_editor/parameter_gradient.tscn", "res://material_maker/widgets/node_editor/parameter_size.gd", "res://material_maker/widgets/node_editor/parameter_size.tscn", "res://material_maker/widgets/preview_button.tscn", "res://material_maker/widgets/size_option_button.gd", "res://material_maker/widgets/tabs.gd", "res://material_maker/widgets/text_dialog.gd", "res://material_maker/widgets/text_dialog.tscn", "res://material_maker/window_dialog.tscn", "res://rodz_labs_logo.png" ) @@ -126,3 +126,47 @@ html/custom_html_shell="" html/head_include="" custom_template/release="" custom_template/debug="" + +[preset.4] + +name="Windows Demo" +platform="Windows Desktop" +runnable=true +custom_features="" +export_filter="resources" +export_files=PoolStringArray( "res://addons/material_maker/common.shader", "res://addons/material_maker/engine/gen_base.gd", "res://addons/material_maker/engine/gen_buffer.gd", "res://addons/material_maker/engine/gen_comment.gd", "res://addons/material_maker/engine/gen_context.gd", "res://addons/material_maker/engine/gen_convolution.gd", "res://addons/material_maker/engine/gen_debug.gd", "res://addons/material_maker/engine/gen_export.gd", "res://addons/material_maker/engine/gen_graph.gd", "res://addons/material_maker/engine/gen_image.gd", "res://addons/material_maker/engine/gen_ios.gd", "res://addons/material_maker/engine/gen_material.gd", "res://addons/material_maker/engine/gen_remote.gd", "res://addons/material_maker/engine/gen_shader.gd", "res://addons/material_maker/engine/gen_switch.gd", "res://addons/material_maker/engine/gen_texture.gd", "res://addons/material_maker/engine/loader.gd", "res://addons/material_maker/engine/renderer.gd", "res://addons/material_maker/engine/renderer.tscn", "res://addons/material_maker/import_plugin/ptex_spatial_material.gd", "res://addons/material_maker/import_plugin/tesselated.shader", "res://addons/material_maker/types/gradient.gd", "res://addons/material_maker/types/types.gd", "res://default_env.tres", "res://demo/demo.tscn", "res://icon.png", "res://rodz_labs_logo.png", "res://start.gd", "res://start.tscn" ) +include_filter="*.mmg,*.json" +exclude_filter="" +export_path="../../Releases/material_maker_demo.exe" +patch_list=PoolStringArray( ) +script_export_mode=1 +script_encryption_key="" + +[preset.4.options] + +texture_format/bptc=false +texture_format/s3tc=true +texture_format/etc=true +texture_format/etc2=true +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true +binary_format/embed_pck=false +custom_template/release="" +custom_template/debug="" +codesign/enable=false +codesign/identity_type=0 +codesign/identity="" +codesign/password="" +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PoolStringArray( ) +application/icon="res://icon.ico" +application/file_version="0.8" +application/product_version="0.8" +application/company_name="Rodz Labs" +application/product_name="Material Maker" +application/file_description="" +application/copyright="" +application/trademarks="" diff --git a/addons/material_maker/doc/.gdignore b/material_maker/doc/.gdignore similarity index 100% rename from addons/material_maker/doc/.gdignore rename to material_maker/doc/.gdignore diff --git a/addons/material_maker/doc/.vscode/tasks.json b/material_maker/doc/.vscode/tasks.json similarity index 100% rename from addons/material_maker/doc/.vscode/tasks.json rename to material_maker/doc/.vscode/tasks.json diff --git a/addons/material_maker/doc/Makefile b/material_maker/doc/Makefile similarity index 100% rename from addons/material_maker/doc/Makefile rename to material_maker/doc/Makefile diff --git a/addons/material_maker/doc/base_library.rst b/material_maker/doc/base_library.rst similarity index 100% rename from addons/material_maker/doc/base_library.rst rename to material_maker/doc/base_library.rst diff --git a/addons/material_maker/doc/conf.py b/material_maker/doc/conf.py similarity index 100% rename from addons/material_maker/doc/conf.py rename to material_maker/doc/conf.py diff --git a/addons/material_maker/doc/images/add_linked_widget.png b/material_maker/doc/images/add_linked_widget.png similarity index 100% rename from addons/material_maker/doc/images/add_linked_widget.png rename to material_maker/doc/images/add_linked_widget.png diff --git a/addons/material_maker/doc/images/bricks.png b/material_maker/doc/images/bricks.png similarity index 100% rename from addons/material_maker/doc/images/bricks.png rename to material_maker/doc/images/bricks.png diff --git a/addons/material_maker/doc/images/colorize.png b/material_maker/doc/images/colorize.png similarity index 100% rename from addons/material_maker/doc/images/colorize.png rename to material_maker/doc/images/colorize.png diff --git a/addons/material_maker/doc/images/connect_nodes.gif b/material_maker/doc/images/connect_nodes.gif similarity index 100% rename from addons/material_maker/doc/images/connect_nodes.gif rename to material_maker/doc/images/connect_nodes.gif diff --git a/addons/material_maker/doc/images/create_configuration_widget.png b/material_maker/doc/images/create_configuration_widget.png similarity index 100% rename from addons/material_maker/doc/images/create_configuration_widget.png rename to material_maker/doc/images/create_configuration_widget.png diff --git a/addons/material_maker/doc/images/create_linked_widget.png b/material_maker/doc/images/create_linked_widget.png similarity index 100% rename from addons/material_maker/doc/images/create_linked_widget.png rename to material_maker/doc/images/create_linked_widget.png diff --git a/addons/material_maker/doc/images/create_node.gif b/material_maker/doc/images/create_node.gif similarity index 100% rename from addons/material_maker/doc/images/create_node.gif rename to material_maker/doc/images/create_node.gif diff --git a/addons/material_maker/doc/images/editable_node.png b/material_maker/doc/images/editable_node.png similarity index 100% rename from addons/material_maker/doc/images/editable_node.png rename to material_maker/doc/images/editable_node.png diff --git a/addons/material_maker/doc/images/emboss.png b/material_maker/doc/images/emboss.png similarity index 100% rename from addons/material_maker/doc/images/emboss.png rename to material_maker/doc/images/emboss.png diff --git a/addons/material_maker/doc/images/gradient_editor.png b/material_maker/doc/images/gradient_editor.png similarity index 100% rename from addons/material_maker/doc/images/gradient_editor.png rename to material_maker/doc/images/gradient_editor.png diff --git a/addons/material_maker/doc/images/graph_navigation_button.png b/material_maker/doc/images/graph_navigation_button.png similarity index 100% rename from addons/material_maker/doc/images/graph_navigation_button.png rename to material_maker/doc/images/graph_navigation_button.png diff --git a/addons/material_maker/doc/images/graph_pane.png b/material_maker/doc/images/graph_pane.png similarity index 100% rename from addons/material_maker/doc/images/graph_pane.png rename to material_maker/doc/images/graph_pane.png diff --git a/addons/material_maker/doc/images/graph_up_button.png b/material_maker/doc/images/graph_up_button.png similarity index 100% rename from addons/material_maker/doc/images/graph_up_button.png rename to material_maker/doc/images/graph_up_button.png diff --git a/addons/material_maker/doc/images/grid_button.png b/material_maker/doc/images/grid_button.png similarity index 100% rename from addons/material_maker/doc/images/grid_button.png rename to material_maker/doc/images/grid_button.png diff --git a/addons/material_maker/doc/images/group_randomness_button.png b/material_maker/doc/images/group_randomness_button.png similarity index 100% rename from addons/material_maker/doc/images/group_randomness_button.png rename to material_maker/doc/images/group_randomness_button.png diff --git a/addons/material_maker/doc/images/library_filter.gif b/material_maker/doc/images/library_filter.gif similarity index 100% rename from addons/material_maker/doc/images/library_filter.gif rename to material_maker/doc/images/library_filter.gif diff --git a/material_maker/doc/images/node_3d_box.png b/material_maker/doc/images/node_3d_box.png new file mode 100644 index 0000000..d62260d Binary files /dev/null and b/material_maker/doc/images/node_3d_box.png differ diff --git a/addons/material_maker/doc/images/node_3d_box_samples.png b/material_maker/doc/images/node_3d_box_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_3d_box_samples.png rename to material_maker/doc/images/node_3d_box_samples.png diff --git a/material_maker/doc/images/node_3d_sdf_color.png b/material_maker/doc/images/node_3d_sdf_color.png new file mode 100644 index 0000000..431b5ee Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_color.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_boolean.png b/material_maker/doc/images/node_3d_sdf_operators_boolean.png new file mode 100644 index 0000000..98be274 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_boolean.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png b/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png new file mode 100644 index 0000000..464af2b Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_circlerepeat.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_elongation.png b/material_maker/doc/images/node_3d_sdf_operators_elongation.png new file mode 100644 index 0000000..f3a29e2 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_elongation.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_elongation_sample.png b/material_maker/doc/images/node_3d_sdf_operators_elongation_sample.png new file mode 100644 index 0000000..2fc7034 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_elongation_sample.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_extrusion.png b/material_maker/doc/images/node_3d_sdf_operators_extrusion.png new file mode 100644 index 0000000..4075bfc Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_extrusion.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_morph.png b/material_maker/doc/images/node_3d_sdf_operators_morph.png new file mode 100644 index 0000000..af66bc7 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_morph.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_repeat.png b/material_maker/doc/images/node_3d_sdf_operators_repeat.png new file mode 100644 index 0000000..11a2778 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_repeat.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_revolution.png b/material_maker/doc/images/node_3d_sdf_operators_revolution.png new file mode 100644 index 0000000..5b6c20a Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_revolution.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_rounded.png b/material_maker/doc/images/node_3d_sdf_operators_rounded.png new file mode 100644 index 0000000..7b668f5 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_rounded.png differ diff --git a/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png b/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png new file mode 100644 index 0000000..2086e88 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_operators_smoothboolean.png differ diff --git a/material_maker/doc/images/node_3d_sdf_render.png b/material_maker/doc/images/node_3d_sdf_render.png new file mode 100644 index 0000000..2b564d3 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_render.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_box.png b/material_maker/doc/images/node_3d_sdf_shapes_box.png new file mode 100644 index 0000000..b16d867 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_box.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_capsule.png b/material_maker/doc/images/node_3d_sdf_shapes_capsule.png new file mode 100644 index 0000000..ca0e322 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_capsule.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_cone.png b/material_maker/doc/images/node_3d_sdf_shapes_cone.png new file mode 100644 index 0000000..230631c Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_cone.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png b/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png new file mode 100644 index 0000000..b6db531 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_cylinder.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_sphere.png b/material_maker/doc/images/node_3d_sdf_shapes_sphere.png new file mode 100644 index 0000000..a6ab5b5 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_sphere.png differ diff --git a/material_maker/doc/images/node_3d_sdf_shapes_torus.png b/material_maker/doc/images/node_3d_sdf_shapes_torus.png new file mode 100644 index 0000000..51df11e Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_shapes_torus.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_rotate.png b/material_maker/doc/images/node_3d_sdf_transforms_rotate.png new file mode 100644 index 0000000..9cee4c5 Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_transforms_rotate.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_scale.png b/material_maker/doc/images/node_3d_sdf_transforms_scale.png new file mode 100644 index 0000000..66276ee Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_transforms_scale.png differ diff --git a/material_maker/doc/images/node_3d_sdf_transforms_translate.png b/material_maker/doc/images/node_3d_sdf_transforms_translate.png new file mode 100644 index 0000000..a24b9cd Binary files /dev/null and b/material_maker/doc/images/node_3d_sdf_transforms_translate.png differ diff --git a/material_maker/doc/images/node_3d_sphere.png b/material_maker/doc/images/node_3d_sphere.png new file mode 100644 index 0000000..0c0cd7f Binary files /dev/null and b/material_maker/doc/images/node_3d_sphere.png differ diff --git a/addons/material_maker/doc/images/node_3d_sphere_samples.png b/material_maker/doc/images/node_3d_sphere_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_3d_sphere_samples.png rename to material_maker/doc/images/node_3d_sphere_samples.png diff --git a/material_maker/doc/images/node_3d_texture_apply.png b/material_maker/doc/images/node_3d_texture_apply.png new file mode 100644 index 0000000..93a8092 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_apply.png differ diff --git a/material_maker/doc/images/node_3d_texture_blend.png b/material_maker/doc/images/node_3d_texture_blend.png new file mode 100644 index 0000000..1f9d6c8 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_blend.png differ diff --git a/material_maker/doc/images/node_3d_texture_blend_sample.png b/material_maker/doc/images/node_3d_texture_blend_sample.png new file mode 100644 index 0000000..4943ab0 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_blend_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_colorize.png b/material_maker/doc/images/node_3d_texture_colorize.png new file mode 100644 index 0000000..154e7b7 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_colorize.png differ diff --git a/material_maker/doc/images/node_3d_texture_colorize_sample.png b/material_maker/doc/images/node_3d_texture_colorize_sample.png new file mode 100644 index 0000000..e99ecad Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_colorize_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_distort.png b/material_maker/doc/images/node_3d_texture_distort.png new file mode 100644 index 0000000..f84f571 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_distort.png differ diff --git a/material_maker/doc/images/node_3d_texture_distort_sample.png b/material_maker/doc/images/node_3d_texture_distort_sample.png new file mode 100644 index 0000000..d9c8fd5 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_distort_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_fbm.png b/material_maker/doc/images/node_3d_texture_fbm.png new file mode 100644 index 0000000..6d76100 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_fbm.png differ diff --git a/material_maker/doc/images/node_3d_texture_fbm_sample.png b/material_maker/doc/images/node_3d_texture_fbm_sample.png new file mode 100644 index 0000000..8d4e349 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_fbm_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_from2d.png b/material_maker/doc/images/node_3d_texture_from2d.png new file mode 100644 index 0000000..951ff93 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_from2d.png differ diff --git a/material_maker/doc/images/node_3d_texture_from2d_sample.png b/material_maker/doc/images/node_3d_texture_from2d_sample.png new file mode 100644 index 0000000..fa16b6f Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_from2d_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_pattern.png b/material_maker/doc/images/node_3d_texture_pattern.png new file mode 100644 index 0000000..b9a7e47 Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_pattern.png differ diff --git a/material_maker/doc/images/node_3d_texture_pattern_sample.png b/material_maker/doc/images/node_3d_texture_pattern_sample.png new file mode 100644 index 0000000..8121a6c Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_pattern_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_rotate.png b/material_maker/doc/images/node_3d_texture_rotate.png new file mode 100644 index 0000000..d04338f Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_rotate.png differ diff --git a/material_maker/doc/images/node_3d_texture_rotate_sample.png b/material_maker/doc/images/node_3d_texture_rotate_sample.png new file mode 100644 index 0000000..e57b19f Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_rotate_sample.png differ diff --git a/material_maker/doc/images/node_3d_texture_select.png b/material_maker/doc/images/node_3d_texture_select.png new file mode 100644 index 0000000..d46aafc Binary files /dev/null and b/material_maker/doc/images/node_3d_texture_select.png differ diff --git a/addons/material_maker/doc/images/node_adjust_hsv_samples.png b/material_maker/doc/images/node_adjust_hsv_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_adjust_hsv_samples.png rename to material_maker/doc/images/node_adjust_hsv_samples.png diff --git a/addons/material_maker/doc/images/node_blend_samples.png b/material_maker/doc/images/node_blend_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_blend_samples.png rename to material_maker/doc/images/node_blend_samples.png diff --git a/addons/material_maker/doc/images/node_blur_samples.png b/material_maker/doc/images/node_blur_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_blur_samples.png rename to material_maker/doc/images/node_blur_samples.png diff --git a/addons/material_maker/doc/images/node_bricks_samples.png b/material_maker/doc/images/node_bricks_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_bricks_samples.png rename to material_maker/doc/images/node_bricks_samples.png diff --git a/addons/material_maker/doc/images/node_brightness_contrast_samples.png b/material_maker/doc/images/node_brightness_contrast_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_brightness_contrast_samples.png rename to material_maker/doc/images/node_brightness_contrast_samples.png diff --git a/addons/material_maker/doc/images/node_color_noise_samples.png b/material_maker/doc/images/node_color_noise_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_color_noise_samples.png rename to material_maker/doc/images/node_color_noise_samples.png diff --git a/addons/material_maker/doc/images/node_colorize_samples.png b/material_maker/doc/images/node_colorize_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_colorize_samples.png rename to material_maker/doc/images/node_colorize_samples.png diff --git a/addons/material_maker/doc/images/node_comment.png b/material_maker/doc/images/node_comment.png similarity index 100% rename from addons/material_maker/doc/images/node_comment.png rename to material_maker/doc/images/node_comment.png diff --git a/addons/material_maker/doc/images/node_debug_pane.png b/material_maker/doc/images/node_debug_pane.png similarity index 100% rename from addons/material_maker/doc/images/node_debug_pane.png rename to material_maker/doc/images/node_debug_pane.png diff --git a/addons/material_maker/doc/images/node_directional_blur_samples.png b/material_maker/doc/images/node_directional_blur_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_directional_blur_samples.png rename to material_maker/doc/images/node_directional_blur_samples.png diff --git a/addons/material_maker/doc/images/node_edge_detect_samples.png b/material_maker/doc/images/node_edge_detect_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_edge_detect_samples.png rename to material_maker/doc/images/node_edge_detect_samples.png diff --git a/addons/material_maker/doc/images/node_editor_general.png b/material_maker/doc/images/node_editor_general.png similarity index 100% rename from addons/material_maker/doc/images/node_editor_general.png rename to material_maker/doc/images/node_editor_general.png diff --git a/addons/material_maker/doc/images/node_editor_global.png b/material_maker/doc/images/node_editor_global.png similarity index 100% rename from addons/material_maker/doc/images/node_editor_global.png rename to material_maker/doc/images/node_editor_global.png diff --git a/addons/material_maker/doc/images/node_editor_instance.png b/material_maker/doc/images/node_editor_instance.png similarity index 100% rename from addons/material_maker/doc/images/node_editor_instance.png rename to material_maker/doc/images/node_editor_instance.png diff --git a/addons/material_maker/doc/images/node_editor_main.png b/material_maker/doc/images/node_editor_main.png similarity index 100% rename from addons/material_maker/doc/images/node_editor_main.png rename to material_maker/doc/images/node_editor_main.png diff --git a/addons/material_maker/doc/images/node_editor_outputs.png b/material_maker/doc/images/node_editor_outputs.png similarity index 100% rename from addons/material_maker/doc/images/node_editor_outputs.png rename to material_maker/doc/images/node_editor_outputs.png diff --git a/addons/material_maker/doc/images/node_emboss_samples.png b/material_maker/doc/images/node_emboss_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_emboss_samples.png rename to material_maker/doc/images/node_emboss_samples.png diff --git a/addons/material_maker/doc/images/node_example.png b/material_maker/doc/images/node_example.png similarity index 100% rename from addons/material_maker/doc/images/node_example.png rename to material_maker/doc/images/node_example.png diff --git a/addons/material_maker/doc/images/node_fibers_samples.png b/material_maker/doc/images/node_fibers_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_fibers_samples.png rename to material_maker/doc/images/node_fibers_samples.png diff --git a/material_maker/doc/images/node_filter_adjusthsv.png b/material_maker/doc/images/node_filter_adjusthsv.png new file mode 100644 index 0000000..25d01ce Binary files /dev/null and b/material_maker/doc/images/node_filter_adjusthsv.png differ diff --git a/material_maker/doc/images/node_filter_blend.png b/material_maker/doc/images/node_filter_blend.png new file mode 100644 index 0000000..cf5f98f Binary files /dev/null and b/material_maker/doc/images/node_filter_blend.png differ diff --git a/material_maker/doc/images/node_filter_blur.png b/material_maker/doc/images/node_filter_blur.png new file mode 100644 index 0000000..399a74c Binary files /dev/null and b/material_maker/doc/images/node_filter_blur.png differ diff --git a/material_maker/doc/images/node_filter_blur_directional.png b/material_maker/doc/images/node_filter_blur_directional.png new file mode 100644 index 0000000..b90b3a5 Binary files /dev/null and b/material_maker/doc/images/node_filter_blur_directional.png differ diff --git a/material_maker/doc/images/node_filter_brightnesscontrast.png b/material_maker/doc/images/node_filter_brightnesscontrast.png new file mode 100644 index 0000000..d762c4c Binary files /dev/null and b/material_maker/doc/images/node_filter_brightnesscontrast.png differ diff --git a/material_maker/doc/images/node_filter_colorize.png b/material_maker/doc/images/node_filter_colorize.png new file mode 100644 index 0000000..22f36e5 Binary files /dev/null and b/material_maker/doc/images/node_filter_colorize.png differ diff --git a/material_maker/doc/images/node_filter_colorize_invert.png b/material_maker/doc/images/node_filter_colorize_invert.png new file mode 100644 index 0000000..75eabd1 Binary files /dev/null and b/material_maker/doc/images/node_filter_colorize_invert.png differ diff --git a/material_maker/doc/images/node_filter_colorize_rainbow.png b/material_maker/doc/images/node_filter_colorize_rainbow.png new file mode 100644 index 0000000..0e8db05 Binary files /dev/null and b/material_maker/doc/images/node_filter_colorize_rainbow.png differ diff --git a/material_maker/doc/images/node_filter_combine.png b/material_maker/doc/images/node_filter_combine.png new file mode 100644 index 0000000..0189b8e Binary files /dev/null and b/material_maker/doc/images/node_filter_combine.png differ diff --git a/material_maker/doc/images/node_filter_decompose.png b/material_maker/doc/images/node_filter_decompose.png new file mode 100644 index 0000000..ff0ffef Binary files /dev/null and b/material_maker/doc/images/node_filter_decompose.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect.png b/material_maker/doc/images/node_filter_edge_detect.png new file mode 100644 index 0000000..9f7f30e Binary files /dev/null and b/material_maker/doc/images/node_filter_edge_detect.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png b/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png new file mode 100644 index 0000000..06d8f09 Binary files /dev/null and b/material_maker/doc/images/node_filter_edge_detect_axis_aligned.png differ diff --git a/material_maker/doc/images/node_filter_edge_detect_diagonal.png b/material_maker/doc/images/node_filter_edge_detect_diagonal.png new file mode 100644 index 0000000..4b2cbd6 Binary files /dev/null and b/material_maker/doc/images/node_filter_edge_detect_diagonal.png differ diff --git a/material_maker/doc/images/node_filter_emboss.png b/material_maker/doc/images/node_filter_emboss.png new file mode 100644 index 0000000..020fea3 Binary files /dev/null and b/material_maker/doc/images/node_filter_emboss.png differ diff --git a/material_maker/doc/images/node_filter_greyscale.png b/material_maker/doc/images/node_filter_greyscale.png new file mode 100644 index 0000000..c9c2987 Binary files /dev/null and b/material_maker/doc/images/node_filter_greyscale.png differ diff --git a/material_maker/doc/images/node_filter_invert.png b/material_maker/doc/images/node_filter_invert.png new file mode 100644 index 0000000..9084982 Binary files /dev/null and b/material_maker/doc/images/node_filter_invert.png differ diff --git a/material_maker/doc/images/node_filter_normal_map.png b/material_maker/doc/images/node_filter_normal_map.png new file mode 100644 index 0000000..638909f Binary files /dev/null and b/material_maker/doc/images/node_filter_normal_map.png differ diff --git a/material_maker/doc/images/node_filter_occlusion.png b/material_maker/doc/images/node_filter_occlusion.png new file mode 100644 index 0000000..b7e8ee1 Binary files /dev/null and b/material_maker/doc/images/node_filter_occlusion.png differ diff --git a/material_maker/doc/images/node_filter_quantize.png b/material_maker/doc/images/node_filter_quantize.png new file mode 100644 index 0000000..501e6b3 Binary files /dev/null and b/material_maker/doc/images/node_filter_quantize.png differ diff --git a/material_maker/doc/images/node_filter_sharpen.png b/material_maker/doc/images/node_filter_sharpen.png new file mode 100644 index 0000000..0d19d98 Binary files /dev/null and b/material_maker/doc/images/node_filter_sharpen.png differ diff --git a/material_maker/doc/images/node_filter_swapchannels.png b/material_maker/doc/images/node_filter_swapchannels.png new file mode 100644 index 0000000..a4e4073 Binary files /dev/null and b/material_maker/doc/images/node_filter_swapchannels.png differ diff --git a/addons/material_maker/doc/images/node_gradient.png b/material_maker/doc/images/node_gradient.png similarity index 100% rename from addons/material_maker/doc/images/node_gradient.png rename to material_maker/doc/images/node_gradient.png diff --git a/addons/material_maker/doc/images/node_gradient_samples.png b/material_maker/doc/images/node_gradient_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_gradient_samples.png rename to material_maker/doc/images/node_gradient_samples.png diff --git a/addons/material_maker/doc/images/node_greyscale_samples.png b/material_maker/doc/images/node_greyscale_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_greyscale_samples.png rename to material_maker/doc/images/node_greyscale_samples.png diff --git a/addons/material_maker/doc/images/node_image.png b/material_maker/doc/images/node_image.png similarity index 100% rename from addons/material_maker/doc/images/node_image.png rename to material_maker/doc/images/node_image.png diff --git a/addons/material_maker/doc/images/node_invert_samples.png b/material_maker/doc/images/node_invert_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_invert_samples.png rename to material_maker/doc/images/node_invert_samples.png diff --git a/addons/material_maker/doc/images/node_kaleidoscope_samples.png b/material_maker/doc/images/node_kaleidoscope_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_kaleidoscope_samples.png rename to material_maker/doc/images/node_kaleidoscope_samples.png diff --git a/addons/material_maker/doc/images/node_material.png b/material_maker/doc/images/node_material.png similarity index 100% rename from addons/material_maker/doc/images/node_material.png rename to material_maker/doc/images/node_material.png diff --git a/addons/material_maker/doc/images/node_mirror_samples.png b/material_maker/doc/images/node_mirror_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_mirror_samples.png rename to material_maker/doc/images/node_mirror_samples.png diff --git a/material_maker/doc/images/node_miscellaneous_buffer.png b/material_maker/doc/images/node_miscellaneous_buffer.png new file mode 100644 index 0000000..2e1b15c Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_buffer.png differ diff --git a/material_maker/doc/images/node_miscellaneous_comment.png b/material_maker/doc/images/node_miscellaneous_comment.png new file mode 100644 index 0000000..3270c92 Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_comment.png differ diff --git a/material_maker/doc/images/node_miscellaneous_custom_shader.png b/material_maker/doc/images/node_miscellaneous_custom_shader.png new file mode 100644 index 0000000..0a760fe Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_custom_shader.png differ diff --git a/material_maker/doc/images/node_miscellaneous_debug.png b/material_maker/doc/images/node_miscellaneous_debug.png new file mode 100644 index 0000000..b246446 Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_debug.png differ diff --git a/material_maker/doc/images/node_miscellaneous_export.png b/material_maker/doc/images/node_miscellaneous_export.png new file mode 100644 index 0000000..64de408 Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_export.png differ diff --git a/material_maker/doc/images/node_miscellaneous_material.png b/material_maker/doc/images/node_miscellaneous_material.png new file mode 100644 index 0000000..52bd8be Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_material.png differ diff --git a/material_maker/doc/images/node_miscellaneous_remote.png b/material_maker/doc/images/node_miscellaneous_remote.png new file mode 100644 index 0000000..976fc93 Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_remote.png differ diff --git a/material_maker/doc/images/node_miscellaneous_switch.png b/material_maker/doc/images/node_miscellaneous_switch.png new file mode 100644 index 0000000..fbae589 Binary files /dev/null and b/material_maker/doc/images/node_miscellaneous_switch.png differ diff --git a/material_maker/doc/images/node_noise.png b/material_maker/doc/images/node_noise.png new file mode 100644 index 0000000..51cfd2c Binary files /dev/null and b/material_maker/doc/images/node_noise.png differ diff --git a/material_maker/doc/images/node_noise_color.png b/material_maker/doc/images/node_noise_color.png new file mode 100644 index 0000000..61535ae Binary files /dev/null and b/material_maker/doc/images/node_noise_color.png differ diff --git a/material_maker/doc/images/node_noise_fbm.png b/material_maker/doc/images/node_noise_fbm.png new file mode 100644 index 0000000..aa405ec Binary files /dev/null and b/material_maker/doc/images/node_noise_fbm.png differ diff --git a/material_maker/doc/images/node_noise_fbm_sample.png b/material_maker/doc/images/node_noise_fbm_sample.png new file mode 100644 index 0000000..65fea15 Binary files /dev/null and b/material_maker/doc/images/node_noise_fbm_sample.png differ diff --git a/material_maker/doc/images/node_noise_perlin.png b/material_maker/doc/images/node_noise_perlin.png new file mode 100644 index 0000000..34c96b0 Binary files /dev/null and b/material_maker/doc/images/node_noise_perlin.png differ diff --git a/material_maker/doc/images/node_noise_perlin_color.png b/material_maker/doc/images/node_noise_perlin_color.png new file mode 100644 index 0000000..debba7b Binary files /dev/null and b/material_maker/doc/images/node_noise_perlin_color.png differ diff --git a/material_maker/doc/images/node_noise_perlin_warp1.png b/material_maker/doc/images/node_noise_perlin_warp1.png new file mode 100644 index 0000000..a5117ff Binary files /dev/null and b/material_maker/doc/images/node_noise_perlin_warp1.png differ diff --git a/material_maker/doc/images/node_noise_perlin_warp2.png b/material_maker/doc/images/node_noise_perlin_warp2.png new file mode 100644 index 0000000..2e93eba Binary files /dev/null and b/material_maker/doc/images/node_noise_perlin_warp2.png differ diff --git a/addons/material_maker/doc/images/node_noise_samples.png b/material_maker/doc/images/node_noise_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_noise_samples.png rename to material_maker/doc/images/node_noise_samples.png diff --git a/material_maker/doc/images/node_noise_voronoi.png b/material_maker/doc/images/node_noise_voronoi.png new file mode 100644 index 0000000..acb8888 Binary files /dev/null and b/material_maker/doc/images/node_noise_voronoi.png differ diff --git a/addons/material_maker/doc/images/node_normal_map_samples.png b/material_maker/doc/images/node_normal_map_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_normal_map_samples.png rename to material_maker/doc/images/node_normal_map_samples.png diff --git a/addons/material_maker/doc/images/node_occlusion_samples.png b/material_maker/doc/images/node_occlusion_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_occlusion_samples.png rename to material_maker/doc/images/node_occlusion_samples.png diff --git a/material_maker/doc/images/node_pattern_beehive.png b/material_maker/doc/images/node_pattern_beehive.png new file mode 100644 index 0000000..8635b95 Binary files /dev/null and b/material_maker/doc/images/node_pattern_beehive.png differ diff --git a/material_maker/doc/images/node_pattern_bricks.png b/material_maker/doc/images/node_pattern_bricks.png new file mode 100644 index 0000000..a554ad6 Binary files /dev/null and b/material_maker/doc/images/node_pattern_bricks.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_basketweave.png b/material_maker/doc/images/node_pattern_bricks_basketweave.png new file mode 100644 index 0000000..f6f2686 Binary files /dev/null and b/material_maker/doc/images/node_pattern_bricks_basketweave.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_herringbone.png b/material_maker/doc/images/node_pattern_bricks_herringbone.png new file mode 100644 index 0000000..4c16846 Binary files /dev/null and b/material_maker/doc/images/node_pattern_bricks_herringbone.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_spanishbond.png b/material_maker/doc/images/node_pattern_bricks_spanishbond.png new file mode 100644 index 0000000..a881006 Binary files /dev/null and b/material_maker/doc/images/node_pattern_bricks_spanishbond.png differ diff --git a/material_maker/doc/images/node_pattern_bricks_tiles.png b/material_maker/doc/images/node_pattern_bricks_tiles.png new file mode 100644 index 0000000..c237d38 Binary files /dev/null and b/material_maker/doc/images/node_pattern_bricks_tiles.png differ diff --git a/material_maker/doc/images/node_pattern_fibers.png b/material_maker/doc/images/node_pattern_fibers.png new file mode 100644 index 0000000..0ec5f9b Binary files /dev/null and b/material_maker/doc/images/node_pattern_fibers.png differ diff --git a/material_maker/doc/images/node_pattern_generic.png b/material_maker/doc/images/node_pattern_generic.png new file mode 100644 index 0000000..6e0d8cc Binary files /dev/null and b/material_maker/doc/images/node_pattern_generic.png differ diff --git a/material_maker/doc/images/node_pattern_generic_checkerboard.png b/material_maker/doc/images/node_pattern_generic_checkerboard.png new file mode 100644 index 0000000..b9597be Binary files /dev/null and b/material_maker/doc/images/node_pattern_generic_checkerboard.png differ diff --git a/material_maker/doc/images/node_pattern_runes.png b/material_maker/doc/images/node_pattern_runes.png new file mode 100644 index 0000000..452a49e Binary files /dev/null and b/material_maker/doc/images/node_pattern_runes.png differ diff --git a/addons/material_maker/doc/images/node_pattern_samples.png b/material_maker/doc/images/node_pattern_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_pattern_samples.png rename to material_maker/doc/images/node_pattern_samples.png diff --git a/material_maker/doc/images/node_pattern_scratches.png b/material_maker/doc/images/node_pattern_scratches.png new file mode 100644 index 0000000..4db13f8 Binary files /dev/null and b/material_maker/doc/images/node_pattern_scratches.png differ diff --git a/material_maker/doc/images/node_pattern_truchet.png b/material_maker/doc/images/node_pattern_truchet.png new file mode 100644 index 0000000..9da9aef Binary files /dev/null and b/material_maker/doc/images/node_pattern_truchet.png differ diff --git a/material_maker/doc/images/node_pattern_weave.png b/material_maker/doc/images/node_pattern_weave.png new file mode 100644 index 0000000..c4ea665 Binary files /dev/null and b/material_maker/doc/images/node_pattern_weave.png differ diff --git a/addons/material_maker/doc/images/node_perlin_samples.png b/material_maker/doc/images/node_perlin_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_perlin_samples.png rename to material_maker/doc/images/node_perlin_samples.png diff --git a/addons/material_maker/doc/images/node_perlin_variations.png b/material_maker/doc/images/node_perlin_variations.png similarity index 100% rename from addons/material_maker/doc/images/node_perlin_variations.png rename to material_maker/doc/images/node_perlin_variations.png diff --git a/addons/material_maker/doc/images/node_quantize_samples.png b/material_maker/doc/images/node_quantize_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_quantize_samples.png rename to material_maker/doc/images/node_quantize_samples.png diff --git a/addons/material_maker/doc/images/node_runes_samples.png b/material_maker/doc/images/node_runes_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_runes_samples.png rename to material_maker/doc/images/node_runes_samples.png diff --git a/addons/material_maker/doc/images/node_scratches_samples.png b/material_maker/doc/images/node_scratches_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_scratches_samples.png rename to material_maker/doc/images/node_scratches_samples.png diff --git a/addons/material_maker/doc/images/node_sdannularshape_sample.png b/material_maker/doc/images/node_sdannularshape_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdannularshape_sample.png rename to material_maker/doc/images/node_sdannularshape_sample.png diff --git a/addons/material_maker/doc/images/node_sdboolean_sample.png b/material_maker/doc/images/node_sdboolean_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdboolean_sample.png rename to material_maker/doc/images/node_sdboolean_sample.png diff --git a/addons/material_maker/doc/images/node_sdbox_sample.png b/material_maker/doc/images/node_sdbox_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdbox_sample.png rename to material_maker/doc/images/node_sdbox_sample.png diff --git a/addons/material_maker/doc/images/node_sdcircle_sample.png b/material_maker/doc/images/node_sdcircle_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdcircle_sample.png rename to material_maker/doc/images/node_sdcircle_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_boolean_sample.png b/material_maker/doc/images/node_sdf3d_boolean_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_boolean_sample.png rename to material_maker/doc/images/node_sdf3d_boolean_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_box_sample.png b/material_maker/doc/images/node_sdf3d_box_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_box_sample.png rename to material_maker/doc/images/node_sdf3d_box_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_capsule_sample.png b/material_maker/doc/images/node_sdf3d_capsule_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_capsule_sample.png rename to material_maker/doc/images/node_sdf3d_capsule_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_circlerepeat_sample.png b/material_maker/doc/images/node_sdf3d_circlerepeat_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_circlerepeat_sample.png rename to material_maker/doc/images/node_sdf3d_circlerepeat_sample.png diff --git a/material_maker/doc/images/node_sdf3d_color.png b/material_maker/doc/images/node_sdf3d_color.png new file mode 100644 index 0000000..fdc2972 Binary files /dev/null and b/material_maker/doc/images/node_sdf3d_color.png differ diff --git a/addons/material_maker/doc/images/node_sdf3d_cone_sample.png b/material_maker/doc/images/node_sdf3d_cone_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_cone_sample.png rename to material_maker/doc/images/node_sdf3d_cone_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png b/material_maker/doc/images/node_sdf3d_cylinder_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png rename to material_maker/doc/images/node_sdf3d_cylinder_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_extrusion_sample.png b/material_maker/doc/images/node_sdf3d_extrusion_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_extrusion_sample.png rename to material_maker/doc/images/node_sdf3d_extrusion_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_morph_sample.png b/material_maker/doc/images/node_sdf3d_morph_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_morph_sample.png rename to material_maker/doc/images/node_sdf3d_morph_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_repeat_sample.png b/material_maker/doc/images/node_sdf3d_repeat_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_repeat_sample.png rename to material_maker/doc/images/node_sdf3d_repeat_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_revolution_sample.png b/material_maker/doc/images/node_sdf3d_revolution_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_revolution_sample.png rename to material_maker/doc/images/node_sdf3d_revolution_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_roundedshape_sample.png b/material_maker/doc/images/node_sdf3d_roundedshape_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_roundedshape_sample.png rename to material_maker/doc/images/node_sdf3d_roundedshape_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_samples.png b/material_maker/doc/images/node_sdf3d_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_samples.png rename to material_maker/doc/images/node_sdf3d_samples.png diff --git a/addons/material_maker/doc/images/node_sdf3d_smoothboolean_sample.png b/material_maker/doc/images/node_sdf3d_smoothboolean_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_smoothboolean_sample.png rename to material_maker/doc/images/node_sdf3d_smoothboolean_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_sphere_sample.png b/material_maker/doc/images/node_sdf3d_sphere_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_sphere_sample.png rename to material_maker/doc/images/node_sdf3d_sphere_sample.png diff --git a/addons/material_maker/doc/images/node_sdf3d_torus_sample.png b/material_maker/doc/images/node_sdf3d_torus_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf3d_torus_sample.png rename to material_maker/doc/images/node_sdf3d_torus_sample.png diff --git a/addons/material_maker/doc/images/node_sdf_samples.png b/material_maker/doc/images/node_sdf_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_sdf_samples.png rename to material_maker/doc/images/node_sdf_samples.png diff --git a/addons/material_maker/doc/images/node_sdline_sample.png b/material_maker/doc/images/node_sdline_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdline_sample.png rename to material_maker/doc/images/node_sdline_sample.png diff --git a/addons/material_maker/doc/images/node_sdmorph_sample.png b/material_maker/doc/images/node_sdmorph_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdmorph_sample.png rename to material_maker/doc/images/node_sdmorph_sample.png diff --git a/addons/material_maker/doc/images/node_sdrhombus_sample.png b/material_maker/doc/images/node_sdrhombus_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdrhombus_sample.png rename to material_maker/doc/images/node_sdrhombus_sample.png diff --git a/addons/material_maker/doc/images/node_sdroundedshape_sample.png b/material_maker/doc/images/node_sdroundedshape_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdroundedshape_sample.png rename to material_maker/doc/images/node_sdroundedshape_sample.png diff --git a/addons/material_maker/doc/images/node_sdsmoothboolean_sample.png b/material_maker/doc/images/node_sdsmoothboolean_sample.png similarity index 100% rename from addons/material_maker/doc/images/node_sdsmoothboolean_sample.png rename to material_maker/doc/images/node_sdsmoothboolean_sample.png diff --git a/addons/material_maker/doc/images/node_shape_samples.png b/material_maker/doc/images/node_shape_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_shape_samples.png rename to material_maker/doc/images/node_shape_samples.png diff --git a/addons/material_maker/doc/images/node_sharpen_samples.png b/material_maker/doc/images/node_sharpen_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_sharpen_samples.png rename to material_maker/doc/images/node_sharpen_samples.png diff --git a/material_maker/doc/images/node_simple_gradient.png b/material_maker/doc/images/node_simple_gradient.png new file mode 100644 index 0000000..212a337 Binary files /dev/null and b/material_maker/doc/images/node_simple_gradient.png differ diff --git a/material_maker/doc/images/node_simple_gradient_circular.png b/material_maker/doc/images/node_simple_gradient_circular.png new file mode 100644 index 0000000..4bacd89 Binary files /dev/null and b/material_maker/doc/images/node_simple_gradient_circular.png differ diff --git a/material_maker/doc/images/node_simple_gradient_radial.png b/material_maker/doc/images/node_simple_gradient_radial.png new file mode 100644 index 0000000..c4716d9 Binary files /dev/null and b/material_maker/doc/images/node_simple_gradient_radial.png differ diff --git a/material_maker/doc/images/node_simple_image.png b/material_maker/doc/images/node_simple_image.png new file mode 100644 index 0000000..4471555 Binary files /dev/null and b/material_maker/doc/images/node_simple_image.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png b/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png new file mode 100644 index 0000000..1493dd1 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_operators_sdannularshape.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png b/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png new file mode 100644 index 0000000..a35b5fb Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_operators_sdboolean.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png b/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png new file mode 100644 index 0000000..a508f7a Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_operators_sdmorph.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png b/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png new file mode 100644 index 0000000..500fe2c Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_operators_sdroundedshape.png differ diff --git a/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png b/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png new file mode 100644 index 0000000..0fd83f1 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_operators_sdsmoothboolean.png differ diff --git a/material_maker/doc/images/node_simple_sdf_sdshow.png b/material_maker/doc/images/node_simple_sdf_sdshow.png new file mode 100644 index 0000000..ae69b3e Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_sdshow.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png b/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png new file mode 100644 index 0000000..d9244d4 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_shapes_sdarc.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png b/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png new file mode 100644 index 0000000..c32215e Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_shapes_sdbox.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png b/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png new file mode 100644 index 0000000..bfc95cf Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_shapes_sdcircle.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdline.png b/material_maker/doc/images/node_simple_sdf_shapes_sdline.png new file mode 100644 index 0000000..87ddc9c Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_shapes_sdline.png differ diff --git a/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png b/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png new file mode 100644 index 0000000..c4fbf70 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_shapes_sdrhombus.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_rotate.png b/material_maker/doc/images/node_simple_sdf_transforms_rotate.png new file mode 100644 index 0000000..251b6ed Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_transforms_rotate.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_scale.png b/material_maker/doc/images/node_simple_sdf_transforms_scale.png new file mode 100644 index 0000000..6f4e5f9 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_transforms_scale.png differ diff --git a/material_maker/doc/images/node_simple_sdf_transforms_translate.png b/material_maker/doc/images/node_simple_sdf_transforms_translate.png new file mode 100644 index 0000000..baeed70 Binary files /dev/null and b/material_maker/doc/images/node_simple_sdf_transforms_translate.png differ diff --git a/material_maker/doc/images/node_simple_shape.png b/material_maker/doc/images/node_simple_shape.png new file mode 100644 index 0000000..55cafd0 Binary files /dev/null and b/material_maker/doc/images/node_simple_shape.png differ diff --git a/material_maker/doc/images/node_simple_shape_circle.png b/material_maker/doc/images/node_simple_shape_circle.png new file mode 100644 index 0000000..173412f Binary files /dev/null and b/material_maker/doc/images/node_simple_shape_circle.png differ diff --git a/material_maker/doc/images/node_simple_shape_curved_star.png b/material_maker/doc/images/node_simple_shape_curved_star.png new file mode 100644 index 0000000..39dabee Binary files /dev/null and b/material_maker/doc/images/node_simple_shape_curved_star.png differ diff --git a/material_maker/doc/images/node_simple_shape_rays.png b/material_maker/doc/images/node_simple_shape_rays.png new file mode 100644 index 0000000..b2fbde8 Binary files /dev/null and b/material_maker/doc/images/node_simple_shape_rays.png differ diff --git a/material_maker/doc/images/node_simple_shape_star.png b/material_maker/doc/images/node_simple_shape_star.png new file mode 100644 index 0000000..8e56573 Binary files /dev/null and b/material_maker/doc/images/node_simple_shape_star.png differ diff --git a/material_maker/doc/images/node_simple_uniform.png b/material_maker/doc/images/node_simple_uniform.png new file mode 100644 index 0000000..a9dbc54 Binary files /dev/null and b/material_maker/doc/images/node_simple_uniform.png differ diff --git a/material_maker/doc/images/node_simple_uniform_greyscale.png b/material_maker/doc/images/node_simple_uniform_greyscale.png new file mode 100644 index 0000000..0f4dd4b Binary files /dev/null and b/material_maker/doc/images/node_simple_uniform_greyscale.png differ diff --git a/addons/material_maker/doc/images/node_switch.png b/material_maker/doc/images/node_switch.png similarity index 100% rename from addons/material_maker/doc/images/node_switch.png rename to material_maker/doc/images/node_switch.png diff --git a/material_maker/doc/images/node_transform.png b/material_maker/doc/images/node_transform.png new file mode 100644 index 0000000..7f9f8da Binary files /dev/null and b/material_maker/doc/images/node_transform.png differ diff --git a/material_maker/doc/images/node_transform_circlemap.png b/material_maker/doc/images/node_transform_circlemap.png new file mode 100644 index 0000000..ad89f23 Binary files /dev/null and b/material_maker/doc/images/node_transform_circlemap.png differ diff --git a/material_maker/doc/images/node_transform_customuv.png b/material_maker/doc/images/node_transform_customuv.png new file mode 100644 index 0000000..4f0677c Binary files /dev/null and b/material_maker/doc/images/node_transform_customuv.png differ diff --git a/material_maker/doc/images/node_transform_kaleidoscope.png b/material_maker/doc/images/node_transform_kaleidoscope.png new file mode 100644 index 0000000..a980894 Binary files /dev/null and b/material_maker/doc/images/node_transform_kaleidoscope.png differ diff --git a/material_maker/doc/images/node_transform_mirror.png b/material_maker/doc/images/node_transform_mirror.png new file mode 100644 index 0000000..86cae76 Binary files /dev/null and b/material_maker/doc/images/node_transform_mirror.png differ diff --git a/addons/material_maker/doc/images/node_transform_samples.png b/material_maker/doc/images/node_transform_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_transform_samples.png rename to material_maker/doc/images/node_transform_samples.png diff --git a/material_maker/doc/images/node_transform_splatter.png b/material_maker/doc/images/node_transform_splatter.png new file mode 100644 index 0000000..6ffe833 Binary files /dev/null and b/material_maker/doc/images/node_transform_splatter.png differ diff --git a/material_maker/doc/images/node_transform_splatter_color.png b/material_maker/doc/images/node_transform_splatter_color.png new file mode 100644 index 0000000..6ec2e3e Binary files /dev/null and b/material_maker/doc/images/node_transform_splatter_color.png differ diff --git a/material_maker/doc/images/node_transform_splatter_samples.png b/material_maker/doc/images/node_transform_splatter_samples.png new file mode 100644 index 0000000..b8a8dc6 Binary files /dev/null and b/material_maker/doc/images/node_transform_splatter_samples.png differ diff --git a/material_maker/doc/images/node_transform_tile2x2.png b/material_maker/doc/images/node_transform_tile2x2.png new file mode 100644 index 0000000..cc182f6 Binary files /dev/null and b/material_maker/doc/images/node_transform_tile2x2.png differ diff --git a/material_maker/doc/images/node_transform_tile2x2_sample.png b/material_maker/doc/images/node_transform_tile2x2_sample.png new file mode 100644 index 0000000..6ecdeac Binary files /dev/null and b/material_maker/doc/images/node_transform_tile2x2_sample.png differ diff --git a/material_maker/doc/images/node_transform_warp.png b/material_maker/doc/images/node_transform_warp.png new file mode 100644 index 0000000..39175ef Binary files /dev/null and b/material_maker/doc/images/node_transform_warp.png differ diff --git a/addons/material_maker/doc/images/node_truchet_samples.png b/material_maker/doc/images/node_truchet_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_truchet_samples.png rename to material_maker/doc/images/node_truchet_samples.png diff --git a/addons/material_maker/doc/images/node_uniform.png b/material_maker/doc/images/node_uniform.png similarity index 100% rename from addons/material_maker/doc/images/node_uniform.png rename to material_maker/doc/images/node_uniform.png diff --git a/addons/material_maker/doc/images/node_voronoi_samples.png b/material_maker/doc/images/node_voronoi_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_voronoi_samples.png rename to material_maker/doc/images/node_voronoi_samples.png diff --git a/addons/material_maker/doc/images/node_warp_samples.png b/material_maker/doc/images/node_warp_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_warp_samples.png rename to material_maker/doc/images/node_warp_samples.png diff --git a/addons/material_maker/doc/images/node_weave_samples.png b/material_maker/doc/images/node_weave_samples.png similarity index 100% rename from addons/material_maker/doc/images/node_weave_samples.png rename to material_maker/doc/images/node_weave_samples.png diff --git a/material_maker/doc/images/node_workflow_applymap.png b/material_maker/doc/images/node_workflow_applymap.png new file mode 100644 index 0000000..e836f4c Binary files /dev/null and b/material_maker/doc/images/node_workflow_applymap.png differ diff --git a/material_maker/doc/images/node_workflow_createmap.png b/material_maker/doc/images/node_workflow_createmap.png new file mode 100644 index 0000000..da63591 Binary files /dev/null and b/material_maker/doc/images/node_workflow_createmap.png differ diff --git a/material_maker/doc/images/node_workflow_materials_marble.png b/material_maker/doc/images/node_workflow_materials_marble.png new file mode 100644 index 0000000..b42d314 Binary files /dev/null and b/material_maker/doc/images/node_workflow_materials_marble.png differ diff --git a/material_maker/doc/images/node_workflow_materials_metal.png b/material_maker/doc/images/node_workflow_materials_metal.png new file mode 100644 index 0000000..25b7f83 Binary files /dev/null and b/material_maker/doc/images/node_workflow_materials_metal.png differ diff --git a/material_maker/doc/images/node_workflow_materials_template.png b/material_maker/doc/images/node_workflow_materials_template.png new file mode 100644 index 0000000..9a80f72 Binary files /dev/null and b/material_maker/doc/images/node_workflow_materials_template.png differ diff --git a/material_maker/doc/images/node_workflow_materials_wood.png b/material_maker/doc/images/node_workflow_materials_wood.png new file mode 100644 index 0000000..d8d105e Binary files /dev/null and b/material_maker/doc/images/node_workflow_materials_wood.png differ diff --git a/material_maker/doc/images/node_workflow_mix.png b/material_maker/doc/images/node_workflow_mix.png new file mode 100644 index 0000000..aace12f Binary files /dev/null and b/material_maker/doc/images/node_workflow_mix.png differ diff --git a/material_maker/doc/images/node_workflow_mixmap.png b/material_maker/doc/images/node_workflow_mixmap.png new file mode 100644 index 0000000..07fec0d Binary files /dev/null and b/material_maker/doc/images/node_workflow_mixmap.png differ diff --git a/material_maker/doc/images/node_workflow_output.png b/material_maker/doc/images/node_workflow_output.png new file mode 100644 index 0000000..f7e702e Binary files /dev/null and b/material_maker/doc/images/node_workflow_output.png differ diff --git a/addons/material_maker/doc/images/pattern.png b/material_maker/doc/images/pattern.png similarity index 100% rename from addons/material_maker/doc/images/pattern.png rename to material_maker/doc/images/pattern.png diff --git a/addons/material_maker/doc/images/perlin.png b/material_maker/doc/images/perlin.png similarity index 100% rename from addons/material_maker/doc/images/perlin.png rename to material_maker/doc/images/perlin.png diff --git a/addons/material_maker/doc/images/preview_2d.png b/material_maker/doc/images/preview_2d.png similarity index 100% rename from addons/material_maker/doc/images/preview_2d.png rename to material_maker/doc/images/preview_2d.png diff --git a/addons/material_maker/doc/images/preview_3d.png b/material_maker/doc/images/preview_3d.png similarity index 100% rename from addons/material_maker/doc/images/preview_3d.png rename to material_maker/doc/images/preview_3d.png diff --git a/addons/material_maker/doc/images/random_node.png b/material_maker/doc/images/random_node.png similarity index 100% rename from addons/material_maker/doc/images/random_node.png rename to material_maker/doc/images/random_node.png diff --git a/addons/material_maker/doc/images/remote_configuration_widget.gif b/material_maker/doc/images/remote_configuration_widget.gif similarity index 100% rename from addons/material_maker/doc/images/remote_configuration_widget.gif rename to material_maker/doc/images/remote_configuration_widget.gif diff --git a/addons/material_maker/doc/images/remote_create_linked_widget.gif b/material_maker/doc/images/remote_create_linked_widget.gif similarity index 100% rename from addons/material_maker/doc/images/remote_create_linked_widget.gif rename to material_maker/doc/images/remote_create_linked_widget.gif diff --git a/addons/material_maker/doc/images/remove_linked_widget.png b/material_maker/doc/images/remove_linked_widget.png similarity index 100% rename from addons/material_maker/doc/images/remove_linked_widget.png rename to material_maker/doc/images/remove_linked_widget.png diff --git a/addons/material_maker/doc/images/screenshot.png b/material_maker/doc/images/screenshot.png similarity index 100% rename from addons/material_maker/doc/images/screenshot.png rename to material_maker/doc/images/screenshot.png diff --git a/material_maker/doc/images/screenshot_3d_box.png b/material_maker/doc/images/screenshot_3d_box.png new file mode 100644 index 0000000..a823240 Binary files /dev/null and b/material_maker/doc/images/screenshot_3d_box.png differ diff --git a/material_maker/doc/images/screenshot_noise.png b/material_maker/doc/images/screenshot_noise.png new file mode 100644 index 0000000..757e9bb Binary files /dev/null and b/material_maker/doc/images/screenshot_noise.png differ diff --git a/material_maker/doc/images/screenshot_pattern_generic.png b/material_maker/doc/images/screenshot_pattern_generic.png new file mode 100644 index 0000000..ccd9f21 Binary files /dev/null and b/material_maker/doc/images/screenshot_pattern_generic.png differ diff --git a/material_maker/doc/images/screenshot_simple_uniform.png b/material_maker/doc/images/screenshot_simple_uniform.png new file mode 100644 index 0000000..f9a4387 Binary files /dev/null and b/material_maker/doc/images/screenshot_simple_uniform.png differ diff --git a/addons/material_maker/doc/images/subgraph.png b/material_maker/doc/images/subgraph.png similarity index 100% rename from addons/material_maker/doc/images/subgraph.png rename to material_maker/doc/images/subgraph.png diff --git a/addons/material_maker/doc/images/warp.png b/material_maker/doc/images/warp.png similarity index 100% rename from addons/material_maker/doc/images/warp.png rename to material_maker/doc/images/warp.png diff --git a/addons/material_maker/doc/images/workflow_applied_map.png b/material_maker/doc/images/workflow_applied_map.png similarity index 100% rename from addons/material_maker/doc/images/workflow_applied_map.png rename to material_maker/doc/images/workflow_applied_map.png diff --git a/addons/material_maker/doc/images/workflow_base_material.png b/material_maker/doc/images/workflow_base_material.png similarity index 100% rename from addons/material_maker/doc/images/workflow_base_material.png rename to material_maker/doc/images/workflow_base_material.png diff --git a/addons/material_maker/doc/images/workflow_final.png b/material_maker/doc/images/workflow_final.png similarity index 100% rename from addons/material_maker/doc/images/workflow_final.png rename to material_maker/doc/images/workflow_final.png diff --git a/addons/material_maker/doc/images/workflow_map.png b/material_maker/doc/images/workflow_map.png similarity index 100% rename from addons/material_maker/doc/images/workflow_map.png rename to material_maker/doc/images/workflow_map.png diff --git a/addons/material_maker/doc/images/workflow_mix.png b/material_maker/doc/images/workflow_mix.png similarity index 100% rename from addons/material_maker/doc/images/workflow_mix.png rename to material_maker/doc/images/workflow_mix.png diff --git a/addons/material_maker/doc/images/workflow_mixed_maps.png b/material_maker/doc/images/workflow_mixed_maps.png similarity index 100% rename from addons/material_maker/doc/images/workflow_mixed_maps.png rename to material_maker/doc/images/workflow_mixed_maps.png diff --git a/addons/material_maker/doc/images/zoom_in_button.png b/material_maker/doc/images/zoom_in_button.png similarity index 100% rename from addons/material_maker/doc/images/zoom_in_button.png rename to material_maker/doc/images/zoom_in_button.png diff --git a/addons/material_maker/doc/images/zoom_out_button.png b/material_maker/doc/images/zoom_out_button.png similarity index 100% rename from addons/material_maker/doc/images/zoom_out_button.png rename to material_maker/doc/images/zoom_out_button.png diff --git a/addons/material_maker/doc/images/zoom_reset_button.png b/material_maker/doc/images/zoom_reset_button.png similarity index 100% rename from addons/material_maker/doc/images/zoom_reset_button.png rename to material_maker/doc/images/zoom_reset_button.png diff --git a/addons/material_maker/doc/index.rst b/material_maker/doc/index.rst similarity index 100% rename from addons/material_maker/doc/index.rst rename to material_maker/doc/index.rst diff --git a/addons/material_maker/doc/intro.rst b/material_maker/doc/intro.rst similarity index 100% rename from addons/material_maker/doc/intro.rst rename to material_maker/doc/intro.rst diff --git a/addons/material_maker/doc/make.bat b/material_maker/doc/make.bat similarity index 100% rename from addons/material_maker/doc/make.bat rename to material_maker/doc/make.bat diff --git a/addons/material_maker/doc/node_3d_box.rst b/material_maker/doc/node_3d_box.rst similarity index 100% rename from addons/material_maker/doc/node_3d_box.rst rename to material_maker/doc/node_3d_box.rst diff --git a/addons/material_maker/doc/node_3d_sdf.rst b/material_maker/doc/node_3d_sdf.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf.rst rename to material_maker/doc/node_3d_sdf.rst index 1f0e9c0..54b0ce7 100644 --- a/addons/material_maker/doc/node_3d_sdf.rst +++ b/material_maker/doc/node_3d_sdf.rst @@ -11,6 +11,9 @@ Describing 3D objects using SDF primitives is more difficult than using existing method integrates smoothly with shader generation, and (as many nodes in Material Maker) is resolution independant. +All shapes can be associated to a color index that can be used to apply different (2D or 3D) textures +to the result. + All output samples shown in this section are preview images. All Signed Distance Functions nodes are based on code written by Inigo Quilez that can be found @@ -24,6 +27,7 @@ __ sdf3dpage_ :maxdepth: 1 node_3d_sdf_render + node_3d_sdf_color Shapes ++++++ @@ -47,6 +51,7 @@ Operators node_3d_sdf_operators_boolean node_3d_sdf_operators_smoothboolean node_3d_sdf_operators_rounded + node_3d_sdf_operators_elongation node_3d_sdf_operators_repeat node_3d_sdf_operators_circlerepeat node_3d_sdf_operators_extrusion diff --git a/material_maker/doc/node_3d_sdf_color.rst b/material_maker/doc/node_3d_sdf_color.rst new file mode 100644 index 0000000..bd352e9 --- /dev/null +++ b/material_maker/doc/node_3d_sdf_color.rst @@ -0,0 +1,24 @@ +Color node +.......... + +The **Color** node assigns a color index to the 3D signed distance function it receives as input. +The color index map is generated when rendering the 3D scene using the **Render** node and can be +used later to assign different materials to different shapes. + +.. image:: images/node_3d_sdf_color.png + :align: center + +Inputs +:::::: + +The **Color** node accepts 1 input in 3D signed distance function format. + +Outputs +::::::: + +The **Color** node generates a colored signed distance function. + +Parameters +:::::::::: + +The **Color** node accepts the color index (a float value between 0 and 1) that will be assigned. diff --git a/addons/material_maker/doc/node_3d_sdf_operators_boolean.rst b/material_maker/doc/node_3d_sdf_operators_boolean.rst similarity index 74% rename from addons/material_maker/doc/node_3d_sdf_operators_boolean.rst rename to material_maker/doc/node_3d_sdf_operators_boolean.rst index a845424..70e6ed7 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_boolean.rst +++ b/material_maker/doc/node_3d_sdf_operators_boolean.rst @@ -2,9 +2,10 @@ Boolean node ............ The **Boolean** node generates a 3D signed distance function for the combination (union, -intersection or difference) of its inputs. +intersection or difference) of its inputs. If the input shapes are associated to color indexes, the +boolean node applies them to the output. -.. image:: images/node_sdf3d_boolean.png +.. image:: images/node_3d_sdf_operators_boolean.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_circlerepeat.rst b/material_maker/doc/node_3d_sdf_operators_circlerepeat.rst similarity index 89% rename from addons/material_maker/doc/node_3d_sdf_operators_circlerepeat.rst rename to material_maker/doc/node_3d_sdf_operators_circlerepeat.rst index 3896379..a3ecc7b 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_circlerepeat.rst +++ b/material_maker/doc/node_3d_sdf_operators_circlerepeat.rst @@ -1,10 +1,10 @@ CircleRepeat node -........... +................. The **CircleRepeat** node generates a 3D signed distance image of a circular repetition of its input. The source object must be offset in the positive Y direction from the center. -.. image:: images/node_sdf3d_circlerepeat.png +.. image:: images/node_3d_sdf_operators_circlerepeat.png :align: center Inputs diff --git a/material_maker/doc/node_3d_sdf_operators_elongation.rst b/material_maker/doc/node_3d_sdf_operators_elongation.rst new file mode 100644 index 0000000..9a8cdf6 --- /dev/null +++ b/material_maker/doc/node_3d_sdf_operators_elongation.rst @@ -0,0 +1,30 @@ +Elongation node +............... + +The **Elongation** node generates a 3D signed distance function of a shape +based on its input that has been elongated from its center. + +.. image:: images/node_3d_sdf_operators_elongation.png + :align: center + +Inputs +:::::: + +The **Elongation** node accepts an input in 3D signed distance function format. + +Outputs +::::::: + +The **Elongation** node generates a signed distance function of the +elongated version of the input shape. + +Parameters +:::::::::: + +The **Elongation** node accepts 3 X, Y and Z parameters that specify the elongation amount along each axis. + +Example images +:::::::::::::: + +.. image:: images/node_3d_sdf_operators_elongation_sample.png + :align: center diff --git a/addons/material_maker/doc/node_3d_sdf_operators_extrusion.rst b/material_maker/doc/node_3d_sdf_operators_extrusion.rst similarity index 91% rename from addons/material_maker/doc/node_3d_sdf_operators_extrusion.rst rename to material_maker/doc/node_3d_sdf_operators_extrusion.rst index 27d9e3b..f93d36c 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_extrusion.rst +++ b/material_maker/doc/node_3d_sdf_operators_extrusion.rst @@ -4,7 +4,7 @@ Extrusion node The **Extrusion** node generates a 3D signed distance function of a shape based on its (2D signed function) input extruded along the Y axis. -.. image:: images/node_sdf3d_extrusion.png +.. image:: images/node_3d_sdf_operators_extrusion.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_morph.rst b/material_maker/doc/node_3d_sdf_operators_morph.rst similarity index 91% rename from addons/material_maker/doc/node_3d_sdf_operators_morph.rst rename to material_maker/doc/node_3d_sdf_operators_morph.rst index 1d562e0..f3f4538 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_morph.rst +++ b/material_maker/doc/node_3d_sdf_operators_morph.rst @@ -4,7 +4,7 @@ Morph node The **Morph** node generates a 3D signed distance function obtained by mixing two input 3D signed distance functions. -.. image:: images/node_sdf3d_morph.png +.. image:: images/node_3d_sdf_operators_morph.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_repeat.rst b/material_maker/doc/node_3d_sdf_operators_repeat.rst similarity index 93% rename from addons/material_maker/doc/node_3d_sdf_operators_repeat.rst rename to material_maker/doc/node_3d_sdf_operators_repeat.rst index e62802c..c6c0eec 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_repeat.rst +++ b/material_maker/doc/node_3d_sdf_operators_repeat.rst @@ -5,7 +5,7 @@ The **Repeat** node generates a 3D signed distance image of a repetition of its input on the X and Y axes. It can also apply a random rotation to the repeated object instances. -.. image:: images/node_sdf3d_repeat.png +.. image:: images/node_3d_sdf_operators_repeat.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_revolution.rst b/material_maker/doc/node_3d_sdf_operators_revolution.rst similarity index 91% rename from addons/material_maker/doc/node_3d_sdf_operators_revolution.rst rename to material_maker/doc/node_3d_sdf_operators_revolution.rst index 516a9de..69b7053 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_revolution.rst +++ b/material_maker/doc/node_3d_sdf_operators_revolution.rst @@ -4,7 +4,7 @@ Revolution node The **Revolution** node generates a 3D signed distance function of a shape based on the revolution along the Z axis of its (2D signed function) input. -.. image:: images/node_sdf3d_revolution.png +.. image:: images/node_3d_sdf_operators_revolution.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_rounded.rst b/material_maker/doc/node_3d_sdf_operators_rounded.rst similarity index 91% rename from addons/material_maker/doc/node_3d_sdf_operators_rounded.rst rename to material_maker/doc/node_3d_sdf_operators_rounded.rst index 7156fa6..ed9957a 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_rounded.rst +++ b/material_maker/doc/node_3d_sdf_operators_rounded.rst @@ -1,11 +1,11 @@ Rounded node -................. +............ The **Rounded** node generates a 3D signed distance function of a rounded shape based on its input, by substracting a constant from its input (i.e. "growing" it towards the outside). -.. image:: images/node_sdf3d_roundedshape.png +.. image:: images/node_3d_sdf_operators_rounded.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_operators_smoothboolean.rst b/material_maker/doc/node_3d_sdf_operators_smoothboolean.rst similarity index 75% rename from addons/material_maker/doc/node_3d_sdf_operators_smoothboolean.rst rename to material_maker/doc/node_3d_sdf_operators_smoothboolean.rst index 939806c..6a56126 100644 --- a/addons/material_maker/doc/node_3d_sdf_operators_smoothboolean.rst +++ b/material_maker/doc/node_3d_sdf_operators_smoothboolean.rst @@ -2,9 +2,10 @@ SmoothBoolean node .................. The **SmoothBoolean** node generates a 3D signed distance image for the combination (union, -intersection or difference) of its inputs. +intersection or difference) of its inputs. If the input shapes are associated to color indexes, the +smooth boolean node applies them to the output. -.. image:: images/node_sdf3d_smoothboolean.png +.. image:: images/node_3d_sdf_operators_smoothboolean.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_render.rst b/material_maker/doc/node_3d_sdf_render.rst similarity index 93% rename from addons/material_maker/doc/node_3d_sdf_render.rst rename to material_maker/doc/node_3d_sdf_render.rst index d63ba2a..250d19b 100644 --- a/addons/material_maker/doc/node_3d_sdf_render.rst +++ b/material_maker/doc/node_3d_sdf_render.rst @@ -3,7 +3,7 @@ Render node The **Render** node generates images from a 3D signed distance function inputs. -.. image:: images/node_sdf3d_render.png +.. image:: images/node_3d_sdf_render.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_box.rst b/material_maker/doc/node_3d_sdf_shapes_box.rst similarity index 92% rename from addons/material_maker/doc/node_3d_sdf_shapes_box.rst rename to material_maker/doc/node_3d_sdf_shapes_box.rst index f248317..7cb0980 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_box.rst +++ b/material_maker/doc/node_3d_sdf_shapes_box.rst @@ -3,7 +3,7 @@ Box node The **Box** node generates a 3d signed distance function for a box with rounded corners. -.. image:: images/node_sdf3d_box.png +.. image:: images/node_3d_sdf_shapes_box.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_capsule.rst b/material_maker/doc/node_3d_sdf_shapes_capsule.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf_shapes_capsule.rst rename to material_maker/doc/node_3d_sdf_shapes_capsule.rst index 15dc04d..f80bf35 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_capsule.rst +++ b/material_maker/doc/node_3d_sdf_shapes_capsule.rst @@ -3,7 +3,7 @@ Capsule node The **Capsule** node generates a 3d signed distance function for a capsule. -.. image:: images/node_sdf3d_capsule.png +.. image:: images/node_3d_sdf_shapes_capsule.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst b/material_maker/doc/node_3d_sdf_shapes_cone.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf_shapes_cone.rst rename to material_maker/doc/node_3d_sdf_shapes_cone.rst index 0fe3831..1d2b3f1 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst +++ b/material_maker/doc/node_3d_sdf_shapes_cone.rst @@ -3,7 +3,7 @@ Cone node The **Cone** node generates a 3d signed distance function for an infinite cone. -.. image:: images/node_sdf3d_cone.png +.. image:: images/node_3d_sdf_shapes_cone.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_cylinder.rst b/material_maker/doc/node_3d_sdf_shapes_cylinder.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf_shapes_cylinder.rst rename to material_maker/doc/node_3d_sdf_shapes_cylinder.rst index 409d9dc..52574c0 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_cylinder.rst +++ b/material_maker/doc/node_3d_sdf_shapes_cylinder.rst @@ -3,7 +3,7 @@ Cylinder node The **Cylinder** node generates a 3d signed distance function for a cylinder. -.. image:: images/node_sdf3d_cylinder.png +.. image:: images/node_3d_sdf_shapes_cylinder.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_sphere.rst b/material_maker/doc/node_3d_sdf_shapes_sphere.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf_shapes_sphere.rst rename to material_maker/doc/node_3d_sdf_shapes_sphere.rst index 827670c..6cf4ad0 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_sphere.rst +++ b/material_maker/doc/node_3d_sdf_shapes_sphere.rst @@ -3,7 +3,7 @@ Sphere node The **Sphere** node generates a 3d signed distance function for a sphere. -.. image:: images/node_sdf3d_sphere.png +.. image:: images/node_3d_sdf_shapes_sphere.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_torus.rst b/material_maker/doc/node_3d_sdf_shapes_torus.rst similarity index 90% rename from addons/material_maker/doc/node_3d_sdf_shapes_torus.rst rename to material_maker/doc/node_3d_sdf_shapes_torus.rst index 7d276b7..b3b8d2d 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_torus.rst +++ b/material_maker/doc/node_3d_sdf_shapes_torus.rst @@ -3,7 +3,7 @@ Torus node The **Torus** node generates a 3d signed distance function for a torus. -.. image:: images/node_sdf3d_torus.png +.. image:: images/node_3d_sdf_shapes_torus.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_transforms_rotate.rst b/material_maker/doc/node_3d_sdf_transforms_rotate.rst similarity index 69% rename from addons/material_maker/doc/node_3d_sdf_transforms_rotate.rst rename to material_maker/doc/node_3d_sdf_transforms_rotate.rst index 4b7cc1c..d074326 100644 --- a/addons/material_maker/doc/node_3d_sdf_transforms_rotate.rst +++ b/material_maker/doc/node_3d_sdf_transforms_rotate.rst @@ -1,10 +1,11 @@ Rotate node ........... -The **Rotate** node generates a 3D signed distance function of a rotated shape -based on its input. +The **Rotate** node generates a 3D signed distance function of a rotated scene +based on its input. If the input shapes are associated to color indexes, the +rotate node applies them to the output. -.. image:: images/node_sdf3d_rotate.png +.. image:: images/node_3d_sdf_transforms_rotate.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_transforms_scale.rst b/material_maker/doc/node_3d_sdf_transforms_scale.rst similarity index 70% rename from addons/material_maker/doc/node_3d_sdf_transforms_scale.rst rename to material_maker/doc/node_3d_sdf_transforms_scale.rst index b708917..6975d7d 100644 --- a/addons/material_maker/doc/node_3d_sdf_transforms_scale.rst +++ b/material_maker/doc/node_3d_sdf_transforms_scale.rst @@ -2,9 +2,10 @@ Scale node .......... The **Scale** node generates a 3D signed distance function of a scaled shape -based on its input. +based on its input. If the input shapes are associated to color indexes, the +scale node applies them to the output. -.. image:: images/node_sdf3d_scale.png +.. image:: images/node_3d_sdf_transforms_scale.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sdf_transforms_translate.rst b/material_maker/doc/node_3d_sdf_transforms_translate.rst similarity index 72% rename from addons/material_maker/doc/node_3d_sdf_transforms_translate.rst rename to material_maker/doc/node_3d_sdf_transforms_translate.rst index b577f05..a45fe33 100644 --- a/addons/material_maker/doc/node_3d_sdf_transforms_translate.rst +++ b/material_maker/doc/node_3d_sdf_transforms_translate.rst @@ -2,9 +2,10 @@ Translate node .............. The **Translate** node generates a 3D signed distance function of a translated shape -based on its input. +based on its input. If the input shapes are associated to color indexes, the +translate node applies them to the output. -.. image:: images/node_sdf3d_translate.png +.. image:: images/node_3d_sdf_transforms_translate.png :align: center Inputs diff --git a/addons/material_maker/doc/node_3d_sphere.rst b/material_maker/doc/node_3d_sphere.rst similarity index 100% rename from addons/material_maker/doc/node_3d_sphere.rst rename to material_maker/doc/node_3d_sphere.rst diff --git a/material_maker/doc/node_3d_texture.rst b/material_maker/doc/node_3d_texture.rst new file mode 100644 index 0000000..7c5bc06 --- /dev/null +++ b/material_maker/doc/node_3d_texture.rst @@ -0,0 +1,23 @@ +3D textures +~~~~~~~~~~~ + +3D textures can be applied to objects defined by a heightmap, that can be generated +either as a regular greyscale image, or from a 3D scene defined using signed distance +functions. + +In both cases, the **Apply** node is used to define 3D coordinates to query 3D textures, +and the **Select** node can be used to apply different 3D textures depending on a color +index. + +.. toctree:: + :maxdepth: 1 + + node_3d_texture_apply + node_3d_texture_select + node_3d_texture_from2d + node_3d_texture_pattern + node_3d_texture_fbm + node_3d_texture_blend + node_3d_texture_colorize + node_3d_texture_rotate + node_3d_texture_distort diff --git a/material_maker/doc/node_3d_texture_apply.rst b/material_maker/doc/node_3d_texture_apply.rst new file mode 100644 index 0000000..40d8805 --- /dev/null +++ b/material_maker/doc/node_3d_texture_apply.rst @@ -0,0 +1,27 @@ +Apply node +~~~~~~~~~~ + +The **Apply** node applies a 3D texture on a surface defined by a heightmap. It can be used +to apply several different 3D textures accoding to a color index map. + +.. image:: images/node_3d_texture_apply.png + :align: center + +Inputs +...... + +The **Apply** node accepts 3 inputs: + +* the height map defined by a greyscale texture that defines the 3D surface +* the color index map defined by a greyscale texture that can be used to define which 3D texture should be applied for each pixel of the result +* the 3D texture (or several 3D textures using the **Select** node) + +Outputs +....... + +The **Apply** node generates a color image where the 3D textures are applied to the surface. + +Parameters +.......... + +The **Apply** node does not accept parameters diff --git a/material_maker/doc/node_3d_texture_blend.rst b/material_maker/doc/node_3d_texture_blend.rst new file mode 100644 index 0000000..5214a9d --- /dev/null +++ b/material_maker/doc/node_3d_texture_blend.rst @@ -0,0 +1,43 @@ +Blend node +~~~~~~~~~~ + +The **Blend** node blends 3D texture two inputs using an optional opacity. It performs a blend operation +defined by the blend mode between both inputs, and mixes the result with the bottom input +using the opacity (defines by the *opacity* parameter, or the optional greyscale input). + +.. image:: images/node_3d_texture_blend.png + :align: center + +Inputs +...... + +The **Blend** node accepts three inputs: + +* The first input is the top layer. + +* The second input is the bottom layer. + +* The third input is an optional mask that will be use instead of the opacity parameter. + +Outputs +....... + +The **Blend** node outputs the result of the blend operation. + +Parameters +.......... + +The **Blend** node has two parameters: + +* The *blend mode*, that can be one of the following: *Normal*, *Multiply*, *Screen*, + *Overlay*, *Hard Light*, *Soft Light*, *Burn*, *Dodge*, *Lighten*, *Darken*, *Difference*. + +* The *opacity* used when mixing the result of the blend operation with the bottom input + when the corresponding input is not connected. When connected, the opacity channel is + converted to greyscale and multiplied with that parameter. + +Example images +.............. + +.. image:: images/node_3d_texture_blend_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_colorize.rst b/material_maker/doc/node_3d_texture_colorize.rst new file mode 100644 index 0000000..2d2c6e8 --- /dev/null +++ b/material_maker/doc/node_3d_texture_colorize.rst @@ -0,0 +1,31 @@ +Colorize node +~~~~~~~~~~~~~ + +The **Colorize** node applies a user-defined gradient to a 3D texture: black pixels +will be colored with the leftmost color of the gradient and white pixels will take +the rightmost color. + +.. image:: images/node_3d_texture_colorize.png + :align: center + +Inputs +...... + +The **Colorize** node inputs a 3D texture and implicitely converts it to greyscale. + +Outputs +....... + +The **Colorize** node provides a single color 3D texture. + +Parameters +.......... + +The **Colorize** node has a single parameter that defines the gradient to be applied to +the input texture. + +Example images +.............. + +.. image:: images/node_3d_texture_colorize_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_distort.rst b/material_maker/doc/node_3d_texture_distort.rst new file mode 100644 index 0000000..d60adba --- /dev/null +++ b/material_maker/doc/node_3d_texture_distort.rst @@ -0,0 +1,28 @@ +Distort node +~~~~~~~~~~~~ + +The **Distort** node distorts a 3D texture. + +.. image:: images/node_3d_texture_distort.png + :align: center + +Inputs +...... + +The **Distort** node inputs a 3D texture to be distorted and a 3D textures whose R, G and B channels define the distortion alongall 3 axes. + +Outputs +....... + +The **Distort** node provides a distorted 3D texture. + +Parameters +.......... + +The **Distort** node accepts a parameter that defines the strength of the distortion. + +Example images +.............. + +.. image:: images/node_3d_texture_distort_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_fbm.rst b/material_maker/doc/node_3d_texture_fbm.rst new file mode 100644 index 0000000..069c250 --- /dev/null +++ b/material_maker/doc/node_3d_texture_fbm.rst @@ -0,0 +1,34 @@ +FBM node +~~~~~~~~ + +The **FBM** node outputs a 3D fractional Brownian motion texture. +FBM is obtained by repeating a noise pattern with smaller and smaller details. + +.. image:: images/node_3d_texture_fbm.png + :align: center + +Inputs +...... + +The **FBM** node does not accept any input. + +Outputs +....... + +The **FBM** node provides a greyscale 3D texture. + +Parameters +.......... + +The FBM node accepts the following parameters: + +* the noise type: value noise, fractal noise or cellular noise +* the *X*, *Y* and *Z* scale of the first octave noise +* the number of iterations +* the persistance, i.e. the strength of each subsequent iteration + +Example images +.............. + +.. image:: images/node_3d_texture_fbm_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_from2d.rst b/material_maker/doc/node_3d_texture_from2d.rst new file mode 100644 index 0000000..3b46d3f --- /dev/null +++ b/material_maker/doc/node_3d_texture_from2d.rst @@ -0,0 +1,29 @@ +From2D node +~~~~~~~~~~~ + +The **From2D** node generates a 3D texture from a 2D texture by projecting it along the Z axis. + +.. image:: images/node_3d_texture_from2d.png + :align: center + +Inputs +...... + +The **From2D** node accepts a single 2D texture as input + +Outputs +....... + +The **From2D** node generates a 3D texture. + +Parameters +.......... + +The **From2D** node does not accept any parameter. + +Example images +.............. + +.. image:: images/node_3d_texture_from2d_sample.png + :align: center + diff --git a/material_maker/doc/node_3d_texture_pattern.rst b/material_maker/doc/node_3d_texture_pattern.rst new file mode 100644 index 0000000..1e2ace4 --- /dev/null +++ b/material_maker/doc/node_3d_texture_pattern.rst @@ -0,0 +1,49 @@ +Pattern node +~~~~~~~~~~~~ + +The **Pattern** node outputs a 3D pattern texture generated from common waveform shapes. + +.. image:: images/node_3d_texture_pattern.png + :align: center + +Inputs +...... + +The **Pattern** node does not accept any input. + +Outputs +....... + +The **Pattern** node provides a greyscale 3D texture obtained by mixing a pattern on each X, Y and Z axes. + +Many different patterns can be created using this node, do not hesitate to experiment. + +Parameters +.......... + +The Pattern node accepts the following parameters: + +* the *X*, *Y* and *Z* parameters define the pattern and their number of repetitions + that will be propagated along the X, Y and Y axes. + The following patterns are available: + + * Sine: the value follows a sinus waveform + + * Triangle: the value follows a triangle waveform (changes linearly from 0 to 1 and from 1 to 0) + + * Square: the value follows a square waveform (stays constant at 0, then 1) + + * Sawtooth: the value follows a sawtooth waveform (changes linearly from 0 to 1, then jumps back to 0) + + * Constant: the value is 1 + + * Bounce: the value follows a half-circle waveform + +* the *Combiner* parameter is the function used to combine the *X*, *Y* and *Z* patterns. The available + functions are *multiply*, *add*, *max*, *min*, *xor* and *pow* + +Example images +.............. + +.. image:: images/node_3d_texture_pattern_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_rotate.rst b/material_maker/doc/node_3d_texture_rotate.rst new file mode 100644 index 0000000..3c720c3 --- /dev/null +++ b/material_maker/doc/node_3d_texture_rotate.rst @@ -0,0 +1,28 @@ +Rotate node +~~~~~~~~~~~ + +The **Rotate** node applies a rotation to a 3D texture. + +.. image:: images/node_3d_texture_rotate.png + :align: center + +Inputs +...... + +The **Rotate** node inputs a 3D texture. + +Outputs +....... + +The **Rotate** node provides a rotated 3D texture. + +Parameters +.......... + +The **Rotate** node has a X, Y and Z parameters that define the rotations around each axis. + +Example images +.............. + +.. image:: images/node_3d_texture_rotate_sample.png + :align: center diff --git a/material_maker/doc/node_3d_texture_select.rst b/material_maker/doc/node_3d_texture_select.rst new file mode 100644 index 0000000..2bcf2ef --- /dev/null +++ b/material_maker/doc/node_3d_texture_select.rst @@ -0,0 +1,29 @@ +Select node +~~~~~~~~~~~ + +The **Select** node merges two 3D textures by assigning all samples to its first +input except those whose color index match the color parameter. + +.. image:: images/node_3d_texture_select.png + :align: center + +Inputs +...... + +The **Select** node accepts two 3D texture inputs: + +* the default texture, used for all samples that don't match the color parameter +* the selected texture that is assigned to all samples that match + +Outputs +....... + +The **Select** node generates a merged 3D texture. + +Parameters +.......... + +The **Select** node does accepts 2 parameters: + +* a color index that is compared with the color index of each sample +* a tolerance value used when comparing the color parameter with the sample's color index diff --git a/addons/material_maker/doc/node_filter_adjust_hsv.rst b/material_maker/doc/node_filter_adjust_hsv.rst similarity index 93% rename from addons/material_maker/doc/node_filter_adjust_hsv.rst rename to material_maker/doc/node_filter_adjust_hsv.rst index e452ca0..afdab3f 100644 --- a/addons/material_maker/doc/node_filter_adjust_hsv.rst +++ b/material_maker/doc/node_filter_adjust_hsv.rst @@ -3,7 +3,7 @@ AdjustHSV node The **AdjustHSV** node adjusts the hue, saturation and value of the input image. -.. image:: images/node_adjust_hsv.png +.. image:: images/node_filter_adjusthsv.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_blend.rst b/material_maker/doc/node_filter_blend.rst similarity index 96% rename from addons/material_maker/doc/node_filter_blend.rst rename to material_maker/doc/node_filter_blend.rst index c913f8e..1dd0d7e 100644 --- a/addons/material_maker/doc/node_filter_blend.rst +++ b/material_maker/doc/node_filter_blend.rst @@ -5,7 +5,7 @@ The **Blend** node blends two inputs using an optional opacity. It performs a bl defined by the blend mode between both inputs, and mixes the result with the bottom input using the opacity (defines by the *opacity* parameter, or the optional greyscale input). -.. image:: images/node_blend.png +.. image:: images/node_filter_blend.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_blur.rst b/material_maker/doc/node_filter_blur.rst similarity index 94% rename from addons/material_maker/doc/node_filter_blur.rst rename to material_maker/doc/node_filter_blur.rst index 834e23b..5e65692 100644 --- a/addons/material_maker/doc/node_filter_blur.rst +++ b/material_maker/doc/node_filter_blur.rst @@ -3,7 +3,7 @@ Blur node The **Blur** node applies a Gaussian blur algorithm to its input. -.. image:: images/node_blur.png +.. image:: images/node_filter_blur.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_brightness_contrast.rst b/material_maker/doc/node_filter_brightness_contrast.rst similarity index 91% rename from addons/material_maker/doc/node_filter_brightness_contrast.rst rename to material_maker/doc/node_filter_brightness_contrast.rst index 012ba21..9afa84d 100644 --- a/addons/material_maker/doc/node_filter_brightness_contrast.rst +++ b/material_maker/doc/node_filter_brightness_contrast.rst @@ -3,7 +3,7 @@ BrightnessContrast node The **BrightnessContrast** node adjusts the brightness and contrast of the input image. -.. image:: images/node_brightness_contrast.png +.. image:: images/node_filter_brightnesscontrast.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_colorize.rst b/material_maker/doc/node_filter_colorize.rst similarity index 94% rename from addons/material_maker/doc/node_filter_colorize.rst rename to material_maker/doc/node_filter_colorize.rst index 471dc8a..c34a664 100644 --- a/addons/material_maker/doc/node_filter_colorize.rst +++ b/material_maker/doc/node_filter_colorize.rst @@ -5,7 +5,7 @@ The **Colorize** node applies a user-defined gradient to a greyscale image: blac will be colored with the leftmost color of the gradient and white pixels will take the rightmost color. -.. image:: images/node_colorize.png +.. image:: images/node_filter_colorize.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_combine.rst b/material_maker/doc/node_filter_combine.rst similarity index 87% rename from addons/material_maker/doc/node_filter_combine.rst rename to material_maker/doc/node_filter_combine.rst index a73853d..4f3132d 100644 --- a/addons/material_maker/doc/node_filter_combine.rst +++ b/material_maker/doc/node_filter_combine.rst @@ -3,7 +3,7 @@ Combine node The **Combine** node combines four greyscale inputs into an RGBA output texture. -.. image:: images/node_combine.png +.. image:: images/node_filter_combine.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_decompose.rst b/material_maker/doc/node_filter_decompose.rst similarity index 87% rename from addons/material_maker/doc/node_filter_decompose.rst rename to material_maker/doc/node_filter_decompose.rst index a3c172d..26c6ea3 100644 --- a/addons/material_maker/doc/node_filter_decompose.rst +++ b/material_maker/doc/node_filter_decompose.rst @@ -3,7 +3,7 @@ Decompose node The **Decompose** node decomposes an RGBA input into four greyscale outputs. -.. image:: images/node_decompose.png +.. image:: images/node_filter_decompose.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_directional_blur.rst b/material_maker/doc/node_filter_directional_blur.rst similarity index 93% rename from addons/material_maker/doc/node_filter_directional_blur.rst rename to material_maker/doc/node_filter_directional_blur.rst index ae186b3..23001c2 100644 --- a/addons/material_maker/doc/node_filter_directional_blur.rst +++ b/material_maker/doc/node_filter_directional_blur.rst @@ -3,7 +3,7 @@ Directional Blur node The **Directional Blur** node applies a Gaussian blur algorithm to its input in a given direction. -.. image:: images/node_directional_blur.png +.. image:: images/node_filter_blur_directional.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_edge_detect.rst b/material_maker/doc/node_filter_edge_detect.rst similarity index 91% rename from addons/material_maker/doc/node_filter_edge_detect.rst rename to material_maker/doc/node_filter_edge_detect.rst index 45159a0..d004f3e 100644 --- a/addons/material_maker/doc/node_filter_edge_detect.rst +++ b/material_maker/doc/node_filter_edge_detect.rst @@ -4,7 +4,7 @@ Edge detect node There are 3 different **Edge detect** nodes that apply an edge detect filter to their input. -.. image:: images/node_edge_detect.png +.. image:: images/node_filter_edge_detect.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_emboss.rst b/material_maker/doc/node_filter_emboss.rst similarity index 94% rename from addons/material_maker/doc/node_filter_emboss.rst rename to material_maker/doc/node_filter_emboss.rst index 0b055b4..6060636 100644 --- a/addons/material_maker/doc/node_filter_emboss.rst +++ b/material_maker/doc/node_filter_emboss.rst @@ -3,7 +3,7 @@ Emboss node The **Emboss** node generates an image that simulates lighting on its input. -.. image:: images/node_emboss.png +.. image:: images/node_filter_emboss.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_greyscale.rst b/material_maker/doc/node_filter_greyscale.rst similarity index 91% rename from addons/material_maker/doc/node_filter_greyscale.rst rename to material_maker/doc/node_filter_greyscale.rst index 442d813..673dac5 100644 --- a/addons/material_maker/doc/node_filter_greyscale.rst +++ b/material_maker/doc/node_filter_greyscale.rst @@ -3,7 +3,7 @@ Greyscale node The **Greyscale** node converts a color image into greyscale. -.. image:: images/node_greyscale.png +.. image:: images/node_filter_greyscale.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_invert.rst b/material_maker/doc/node_filter_invert.rst similarity index 91% rename from addons/material_maker/doc/node_filter_invert.rst rename to material_maker/doc/node_filter_invert.rst index 91c67ea..d9e6cce 100644 --- a/addons/material_maker/doc/node_filter_invert.rst +++ b/material_maker/doc/node_filter_invert.rst @@ -4,7 +4,7 @@ Invert node The **Invert** node inverts the input image. The R, G and B channel are inverted, and the A channel is left untouched. -.. image:: images/node_invert.png +.. image:: images/node_filter_invert.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_normal_map.rst b/material_maker/doc/node_filter_normal_map.rst similarity index 93% rename from addons/material_maker/doc/node_filter_normal_map.rst rename to material_maker/doc/node_filter_normal_map.rst index 5eddcb5..c5072f9 100644 --- a/addons/material_maker/doc/node_filter_normal_map.rst +++ b/material_maker/doc/node_filter_normal_map.rst @@ -3,7 +3,7 @@ Normal map node The **Normal map** node generates a normal map from its input. -.. image:: images/node_normal_map.png +.. image:: images/node_filter_normal_map.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_occlusion.rst b/material_maker/doc/node_filter_occlusion.rst similarity index 93% rename from addons/material_maker/doc/node_filter_occlusion.rst rename to material_maker/doc/node_filter_occlusion.rst index 7f489e2..ec81dc2 100644 --- a/addons/material_maker/doc/node_filter_occlusion.rst +++ b/material_maker/doc/node_filter_occlusion.rst @@ -3,7 +3,7 @@ Occlusion node The **Occlusion** node generates an ambient occlusion texture from its input. -.. image:: images/node_occlusion.png +.. image:: images/node_filter_occlusion.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_quantize.rst b/material_maker/doc/node_filter_quantize.rst similarity index 91% rename from addons/material_maker/doc/node_filter_quantize.rst rename to material_maker/doc/node_filter_quantize.rst index 3751efd..2ff2c88 100644 --- a/addons/material_maker/doc/node_filter_quantize.rst +++ b/material_maker/doc/node_filter_quantize.rst @@ -3,7 +3,7 @@ Quantize node The **Quantize** node approximates the colors of the input image. -.. image:: images/node_quantize.png +.. image:: images/node_filter_quantize.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_sharpen.rst b/material_maker/doc/node_filter_sharpen.rst similarity index 91% rename from addons/material_maker/doc/node_filter_sharpen.rst rename to material_maker/doc/node_filter_sharpen.rst index 204dbd0..463a210 100644 --- a/addons/material_maker/doc/node_filter_sharpen.rst +++ b/material_maker/doc/node_filter_sharpen.rst @@ -3,7 +3,7 @@ Sharpen node The **Sharpen** node applies a sharpen filter (that enhances the edges of the image) to its input. -.. image:: images/node_sharpen.png +.. image:: images/node_filter_sharpen.png :align: center Inputs diff --git a/addons/material_maker/doc/node_filter_swapchannels.rst b/material_maker/doc/node_filter_swapchannels.rst similarity index 92% rename from addons/material_maker/doc/node_filter_swapchannels.rst rename to material_maker/doc/node_filter_swapchannels.rst index 9729982..970111c 100644 --- a/addons/material_maker/doc/node_filter_swapchannels.rst +++ b/material_maker/doc/node_filter_swapchannels.rst @@ -4,7 +4,7 @@ SwapChannels node The **SwapChannels** node can be used to replace each channel (R, G, B and A) of an with 0, 1 or a channel of its input (inverted or not). -.. image:: images/node_swapchannel.png +.. image:: images/node_filter_swapchannels.png :align: center Inputs diff --git a/addons/material_maker/doc/node_miscellaneous_buffer.rst b/material_maker/doc/node_miscellaneous_buffer.rst similarity index 94% rename from addons/material_maker/doc/node_miscellaneous_buffer.rst rename to material_maker/doc/node_miscellaneous_buffer.rst index 81834b0..7b5a4bb 100644 --- a/addons/material_maker/doc/node_miscellaneous_buffer.rst +++ b/material_maker/doc/node_miscellaneous_buffer.rst @@ -9,7 +9,7 @@ shader's complexity), or to create a cheap blur/pixelization effect (by using th LOD output). Note that convolution transforms that are provided in the nodes library already include buffers where necessary. -.. image:: images/node_buffer.png +.. image:: images/node_miscellaneous_buffer.png :align: center Inputs diff --git a/addons/material_maker/doc/node_miscellaneous_comment.rst b/material_maker/doc/node_miscellaneous_comment.rst similarity index 77% rename from addons/material_maker/doc/node_miscellaneous_comment.rst rename to material_maker/doc/node_miscellaneous_comment.rst index 7197c90..3c4f255 100644 --- a/addons/material_maker/doc/node_miscellaneous_comment.rst +++ b/material_maker/doc/node_miscellaneous_comment.rst @@ -4,5 +4,5 @@ Comment node The Comment node has no effect on the material and can be used to document it. Simply double-click on the contents to edit it. -.. image:: images/node_comment.png +.. image:: images/node_miscellaneous_comment.png :align: center diff --git a/addons/material_maker/doc/node_miscellaneous_custom_shader.rst b/material_maker/doc/node_miscellaneous_custom_shader.rst similarity index 100% rename from addons/material_maker/doc/node_miscellaneous_custom_shader.rst rename to material_maker/doc/node_miscellaneous_custom_shader.rst diff --git a/addons/material_maker/doc/node_miscellaneous_debug.rst b/material_maker/doc/node_miscellaneous_debug.rst similarity index 90% rename from addons/material_maker/doc/node_miscellaneous_debug.rst rename to material_maker/doc/node_miscellaneous_debug.rst index 5520a76..471dcfc 100644 --- a/addons/material_maker/doc/node_miscellaneous_debug.rst +++ b/material_maker/doc/node_miscellaneous_debug.rst @@ -3,7 +3,7 @@ Debug node The **Debug** node can be used to show the shader used to generate its input. -.. image:: images/node_debug.png +.. image:: images/node_miscellaneous_debug.png :align: center The **Show shader** button will open a pane that shows the whole shader. That code diff --git a/addons/material_maker/doc/node_miscellaneous_export.rst b/material_maker/doc/node_miscellaneous_export.rst similarity index 90% rename from addons/material_maker/doc/node_miscellaneous_export.rst rename to material_maker/doc/node_miscellaneous_export.rst index b4262ea..54668be 100644 --- a/addons/material_maker/doc/node_miscellaneous_export.rst +++ b/material_maker/doc/node_miscellaneous_export.rst @@ -4,7 +4,7 @@ Export node The **Export** node defines a a texture that will be saved together with the material textures when exporting the project. -.. image:: images/node_export.png +.. image:: images/node_miscellaneous_export.png :align: center Inputs diff --git a/addons/material_maker/doc/node_miscellaneous_material.rst b/material_maker/doc/node_miscellaneous_material.rst similarity index 97% rename from addons/material_maker/doc/node_miscellaneous_material.rst rename to material_maker/doc/node_miscellaneous_material.rst index 043ca0f..e2b0501 100644 --- a/addons/material_maker/doc/node_miscellaneous_material.rst +++ b/material_maker/doc/node_miscellaneous_material.rst @@ -16,7 +16,7 @@ and metallic textures are combined into a single file whose suffix is "orm". When using Material Maker as a Godot addon, a SpatialMaterial is generated automatically. -.. image:: images/node_material.png +.. image:: images/node_miscellaneous_material.png :align: center Inputs diff --git a/addons/material_maker/doc/node_miscellaneous_remote.rst b/material_maker/doc/node_miscellaneous_remote.rst similarity index 97% rename from addons/material_maker/doc/node_miscellaneous_remote.rst rename to material_maker/doc/node_miscellaneous_remote.rst index 9c21b2d..6215705 100644 --- a/addons/material_maker/doc/node_miscellaneous_remote.rst +++ b/material_maker/doc/node_miscellaneous_remote.rst @@ -4,7 +4,7 @@ Remote node The **Remote** node has no direct effect on the material but can be used to control key parameters of the material to configure it easily. -.. image:: images/node_remote.png +.. image:: images/node_miscellaneous_remote.png :align: center When started, the Remote node only shows 2 buttons. diff --git a/addons/material_maker/doc/node_miscellaneous_switch.rst b/material_maker/doc/node_miscellaneous_switch.rst similarity index 94% rename from addons/material_maker/doc/node_miscellaneous_switch.rst rename to material_maker/doc/node_miscellaneous_switch.rst index 13965a1..c9dc582 100644 --- a/addons/material_maker/doc/node_miscellaneous_switch.rst +++ b/material_maker/doc/node_miscellaneous_switch.rst @@ -5,7 +5,7 @@ The **Switch** node can be used to select sources for 2 to 5 output textures from a choice of 2 to five inputs sets. It is useful to create variations of a material and easily switch between them. -.. image:: images/node_switch.png +.. image:: images/node_miscellaneous_switch.png :align: center Inputs diff --git a/addons/material_maker/doc/node_noise.rst b/material_maker/doc/node_noise.rst similarity index 98% rename from addons/material_maker/doc/node_noise.rst rename to material_maker/doc/node_noise.rst index d917093..24460a4 100644 --- a/addons/material_maker/doc/node_noise.rst +++ b/material_maker/doc/node_noise.rst @@ -4,6 +4,7 @@ Noise node The **Noise** node outputs a randomly generated black and white texture. .. image:: images/node_noise.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_noise_color.rst b/material_maker/doc/node_noise_color.rst similarity index 94% rename from addons/material_maker/doc/node_noise_color.rst rename to material_maker/doc/node_noise_color.rst index 4bd801d..d6c5b42 100644 --- a/addons/material_maker/doc/node_noise_color.rst +++ b/material_maker/doc/node_noise_color.rst @@ -3,7 +3,8 @@ Color Noise node The **Color Noise** node outputs a randomly generated black and white texture. -.. image:: images/node_color_noise.png +.. image:: images/node_noise_color.png + :align: center Inputs ++++++ diff --git a/material_maker/doc/node_noise_fbm.rst b/material_maker/doc/node_noise_fbm.rst new file mode 100644 index 0000000..37c325e --- /dev/null +++ b/material_maker/doc/node_noise_fbm.rst @@ -0,0 +1,34 @@ +FBM node +~~~~~~~~ + +The **FBM** node outputs a fractional Brownian motion texture. +FBM is obtained by repeating a noise pattern with smaller and smaller details. + +.. image:: images/node_noise_fbm.png + :align: center + +Inputs +++++++ + +The **FBM** node does not accept any input. + +Outputs ++++++++ + +The **FBM** node provides a greyscale noise texture. + +Parameters +++++++++++ + +The FBM node accepts the following parameters: + +* the noise type: value noise, fractal noise or cellular noise +* the *X* and *Y* scale of the first octave noise +* the number of iterations +* the persistance, i.e. the strength of each subsequent iteration + +Example images +++++++++++++++ + +.. image:: images/node_noise_fbm_sample.png + :align: center diff --git a/addons/material_maker/doc/node_noise_perlin.rst b/material_maker/doc/node_noise_perlin.rst similarity index 95% rename from addons/material_maker/doc/node_noise_perlin.rst rename to material_maker/doc/node_noise_perlin.rst index 11805e5..9f43088 100644 --- a/addons/material_maker/doc/node_noise_perlin.rst +++ b/material_maker/doc/node_noise_perlin.rst @@ -5,7 +5,8 @@ The **Perlin** noise node outputs a texture generated as a sum of Perlin noise f with increasing frequencies and decreasing amplitudes. Perlin noise has a wide range of applications, such as stains, wood, dust... -.. image:: images/node_perlin.png +.. image:: images/node_noise_perlin.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_noise_voronoi.rst b/material_maker/doc/node_noise_voronoi.rst similarity index 95% rename from addons/material_maker/doc/node_noise_voronoi.rst rename to material_maker/doc/node_noise_voronoi.rst index 8723a40..c000887 100644 --- a/addons/material_maker/doc/node_noise_voronoi.rst +++ b/material_maker/doc/node_noise_voronoi.rst @@ -4,7 +4,8 @@ Voronoi noise node The **Voronoi** noise node outputs Voronoi noise textures that can be used for irregular tiles, animal skin or scales, cracks... -.. image:: images/node_voronoi.png +.. image:: images/node_noise_voronoi.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_bricks.rst b/material_maker/doc/node_pattern_bricks.rst similarity index 97% rename from addons/material_maker/doc/node_pattern_bricks.rst rename to material_maker/doc/node_pattern_bricks.rst index 515e505..bba61a2 100644 --- a/addons/material_maker/doc/node_pattern_bricks.rst +++ b/material_maker/doc/node_pattern_bricks.rst @@ -4,7 +4,8 @@ Bricks node The **Bricks** node outputs 4 related bricks pattern textures that can be used for walls or pavement. -.. image:: images/node_bricks.png +.. image:: images/node_pattern_bricks.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_fibers.rst b/material_maker/doc/node_pattern_fibers.rst similarity index 89% rename from addons/material_maker/doc/node_pattern_fibers.rst rename to material_maker/doc/node_pattern_fibers.rst index 8a69dc5..06a8465 100644 --- a/addons/material_maker/doc/node_pattern_fibers.rst +++ b/material_maker/doc/node_pattern_fibers.rst @@ -3,7 +3,8 @@ Fibers node The **Fibers** node outputs a fibers pattern, that can be used for cloth. -.. image:: images/node_fibers.png +.. image:: images/node_pattern_fibers.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_generic.rst b/material_maker/doc/node_pattern_generic.rst similarity index 92% rename from addons/material_maker/doc/node_pattern_generic.rst rename to material_maker/doc/node_pattern_generic.rst index aadadb0..e0f121d 100644 --- a/addons/material_maker/doc/node_pattern_generic.rst +++ b/material_maker/doc/node_pattern_generic.rst @@ -3,7 +3,8 @@ Pattern node The **Pattern** node outputs a pattern texture generated from common waveform shapes. -.. image:: images/node_pattern.png +.. image:: images/node_pattern_generic.png + :align: center Inputs ++++++ @@ -24,7 +25,7 @@ Parameters The Pattern node accepts the following parameters: * the *X* and *Y* parameters define the pattern and their number of repetitions - that will be propagated along the X axis and Y. + that will be propagated along the X and Y axes. The following patterns are available: * Sine: the value follows a sinus waveform diff --git a/addons/material_maker/doc/node_pattern_runes.rst b/material_maker/doc/node_pattern_runes.rst similarity index 90% rename from addons/material_maker/doc/node_pattern_runes.rst rename to material_maker/doc/node_pattern_runes.rst index 958cb5d..e934f12 100644 --- a/addons/material_maker/doc/node_pattern_runes.rst +++ b/material_maker/doc/node_pattern_runes.rst @@ -5,7 +5,8 @@ The **Runes** node outputs a runes pattern. It is based on code written by Otavio Good (https://www.shadertoy.com/view/MsXSRn). -.. image:: images/node_runes.png +.. image:: images/node_pattern_runes.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_scratches.rst b/material_maker/doc/node_pattern_scratches.rst similarity index 94% rename from addons/material_maker/doc/node_pattern_scratches.rst rename to material_maker/doc/node_pattern_scratches.rst index 85f49c5..a386d65 100644 --- a/addons/material_maker/doc/node_pattern_scratches.rst +++ b/material_maker/doc/node_pattern_scratches.rst @@ -7,7 +7,8 @@ scratches on any material or messy fibers. It is inspired from a the *Fuzzy scratches* shadertoy from Daedalus (https://www.shadertoy.com/view/4syXRD). -.. image:: images/node_scratches.png +.. image:: images/node_pattern_scratches.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_truchet.rst b/material_maker/doc/node_pattern_truchet.rst similarity index 93% rename from addons/material_maker/doc/node_pattern_truchet.rst rename to material_maker/doc/node_pattern_truchet.rst index e8ac2a8..3357f1b 100644 --- a/addons/material_maker/doc/node_pattern_truchet.rst +++ b/material_maker/doc/node_pattern_truchet.rst @@ -3,7 +3,8 @@ Truchet node The **Truchet** node outputs a truchet pattern. -.. image:: images/node_truchet.png +.. image:: images/node_pattern_truchet.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_pattern_weave.rst b/material_maker/doc/node_pattern_weave.rst similarity index 90% rename from addons/material_maker/doc/node_pattern_weave.rst rename to material_maker/doc/node_pattern_weave.rst index 2917e75..fa2c43c 100644 --- a/addons/material_maker/doc/node_pattern_weave.rst +++ b/material_maker/doc/node_pattern_weave.rst @@ -3,7 +3,8 @@ Weave node The **Weave** node outputs a weave pattern, that can be used for cloth. -.. image:: images/node_weave.png +.. image:: images/node_pattern_weave.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_simple_gradient.rst b/material_maker/doc/node_simple_gradient.rst similarity index 93% rename from addons/material_maker/doc/node_simple_gradient.rst rename to material_maker/doc/node_simple_gradient.rst index 23034e3..3774a40 100644 --- a/addons/material_maker/doc/node_simple_gradient.rst +++ b/material_maker/doc/node_simple_gradient.rst @@ -4,7 +4,7 @@ Gradient nodes The **Gradient**, **Circular Gradient** and **Radial Gradient** nodes generate a color, user defined gradient. -.. image:: images/node_gradient.png +.. image:: images/node_simple_gradient.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_image.rst b/material_maker/doc/node_simple_image.rst similarity index 89% rename from addons/material_maker/doc/node_simple_image.rst rename to material_maker/doc/node_simple_image.rst index 96400f3..cbcb89b 100644 --- a/addons/material_maker/doc/node_simple_image.rst +++ b/material_maker/doc/node_simple_image.rst @@ -3,7 +3,8 @@ Image node The image node outputs a single texture based on an image file. -.. image:: images/node_image.png +.. image:: images/node_simple_image.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_simple_sdf.rst b/material_maker/doc/node_simple_sdf.rst similarity index 100% rename from addons/material_maker/doc/node_simple_sdf.rst rename to material_maker/doc/node_simple_sdf.rst diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdannularshape.rst b/material_maker/doc/node_simple_sdf_operators_sdannularshape.rst similarity index 92% rename from addons/material_maker/doc/node_simple_sdf_operators_sdannularshape.rst rename to material_maker/doc/node_simple_sdf_operators_sdannularshape.rst index c61576e..7e11ab2 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdannularshape.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdannularshape.rst @@ -5,7 +5,7 @@ The **sdAnnularShape** node generates a signed distance image of an annular shap based on its input, by substracting a constant from the absolute value of the distance function (i.e. creating a ring around the shape). -.. image:: images/node_sdannularshape.png +.. image:: images/node_simple_sdf_operators_sdannularshape.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdboolean.rst b/material_maker/doc/node_simple_sdf_operators_sdboolean.rst similarity index 91% rename from addons/material_maker/doc/node_simple_sdf_operators_sdboolean.rst rename to material_maker/doc/node_simple_sdf_operators_sdboolean.rst index e243bbe..6680230 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdboolean.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdboolean.rst @@ -4,7 +4,7 @@ sdBoolean node The **sdBoolean** node generates a signed distance image for the combination (union, intersection or difference) of its inputs. -.. image:: images/node_sdboolean.png +.. image:: images/node_simple_sdf_operators_sdboolean.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst b/material_maker/doc/node_simple_sdf_operators_sdmorph.rst similarity index 90% rename from addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst rename to material_maker/doc/node_simple_sdf_operators_sdmorph.rst index fdff1ee..ae34e53 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdmorph.rst @@ -4,7 +4,7 @@ sdMorph node The **sdMorph** node generates a signed distance image obtained by mixing two input 2D signed distance functions. -.. image:: images/node_sdmorph.png +.. image:: images/node_simple_sdf_operators_sdmorph.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst b/material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst similarity index 91% rename from addons/material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst rename to material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst index ae70c84..6b1a516 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdroundedshape.rst @@ -5,7 +5,7 @@ The **sdRoundedShape** node generates a signed distance image of a rounded shape based on its input, by substracting a constant from its distance function (i.e. "growing" it towards the outside). -.. image:: images/node_sdroundedshape.png +.. image:: images/node_simple_sdf_operators_sdroundedshape.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdshow.rst b/material_maker/doc/node_simple_sdf_operators_sdshow.rst similarity index 91% rename from addons/material_maker/doc/node_simple_sdf_operators_sdshow.rst rename to material_maker/doc/node_simple_sdf_operators_sdshow.rst index 24499f3..4450b9b 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdshow.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdshow.rst @@ -5,7 +5,7 @@ The **sdShow** node converts a signed distance image into a greyscale image whose background is black and the shape described by its input is white. -.. image:: images/node_sdshow.png +.. image:: images/node_simple_sdf_sdshow.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst b/material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst similarity index 91% rename from addons/material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst rename to material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst index e1504f2..692302e 100644 --- a/addons/material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst +++ b/material_maker/doc/node_simple_sdf_operators_sdsmoothboolean.rst @@ -4,7 +4,7 @@ sdSmoothBoolean node The **sdSmoothBoolean** node generates a signed distance image for the combination (union, intersection or difference) of its inputs. -.. image:: images/node_sdsmoothboolean.png +.. image:: images/node_simple_sdf_operators_sdsmoothboolean.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_shapes_sdbox.rst b/material_maker/doc/node_simple_sdf_shapes_sdbox.rst similarity index 91% rename from addons/material_maker/doc/node_simple_sdf_shapes_sdbox.rst rename to material_maker/doc/node_simple_sdf_shapes_sdbox.rst index ecabb0d..3031118 100644 --- a/addons/material_maker/doc/node_simple_sdf_shapes_sdbox.rst +++ b/material_maker/doc/node_simple_sdf_shapes_sdbox.rst @@ -3,7 +3,7 @@ sdBox node The **sdBox** node generates a signed distance image for a rectangle. -.. image:: images/node_sdbox.png +.. image:: images/node_simple_sdf_shapes_sdbox.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_shapes_sdcircle.rst b/material_maker/doc/node_simple_sdf_shapes_sdcircle.rst similarity index 90% rename from addons/material_maker/doc/node_simple_sdf_shapes_sdcircle.rst rename to material_maker/doc/node_simple_sdf_shapes_sdcircle.rst index 5aff382..791d27c 100644 --- a/addons/material_maker/doc/node_simple_sdf_shapes_sdcircle.rst +++ b/material_maker/doc/node_simple_sdf_shapes_sdcircle.rst @@ -3,7 +3,7 @@ sdCircle node The **sdCircle** node generates a signed distance image for a circle. -.. image:: images/node_sdcircle.png +.. image:: images/node_simple_sdf_shapes_sdcircle.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_shapes_sdline.rst b/material_maker/doc/node_simple_sdf_shapes_sdline.rst similarity index 92% rename from addons/material_maker/doc/node_simple_sdf_shapes_sdline.rst rename to material_maker/doc/node_simple_sdf_shapes_sdline.rst index c8507ea..ffa78ca 100644 --- a/addons/material_maker/doc/node_simple_sdf_shapes_sdline.rst +++ b/material_maker/doc/node_simple_sdf_shapes_sdline.rst @@ -5,7 +5,7 @@ The **sdLine** node generates a signed distance image for a line segment. It can easily be turned into a capsule shape using an **sdRoundedShape** node (the result is shown in the example image below). -.. image:: images/node_sdline.png +.. image:: images/node_simple_sdf_shapes_sdline.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst b/material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst similarity index 90% rename from addons/material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst rename to material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst index 0f6299c..c6a9a4c 100644 --- a/addons/material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst +++ b/material_maker/doc/node_simple_sdf_shapes_sdrhombus.rst @@ -3,7 +3,7 @@ sdRhombus node The **sdRhombus** node generates a signed distance image for a rhombus. -.. image:: images/node_sdrhombus.png +.. image:: images/node_simple_sdf_shapes_sdrhombus.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_shape.rst b/material_maker/doc/node_simple_shape.rst similarity index 93% rename from addons/material_maker/doc/node_simple_shape.rst rename to material_maker/doc/node_simple_shape.rst index 4c5b5aa..3981a9a 100644 --- a/addons/material_maker/doc/node_simple_shape.rst +++ b/material_maker/doc/node_simple_shape.rst @@ -3,7 +3,7 @@ Shape node The **Shape** node outputs a simple greyscale shape. -.. image:: images/node_shape.png +.. image:: images/node_simple_shape.png :align: center Inputs diff --git a/addons/material_maker/doc/node_simple_uniform.rst b/material_maker/doc/node_simple_uniform.rst similarity index 89% rename from addons/material_maker/doc/node_simple_uniform.rst rename to material_maker/doc/node_simple_uniform.rst index 5f59264..b0c5d6e 100644 --- a/addons/material_maker/doc/node_simple_uniform.rst +++ b/material_maker/doc/node_simple_uniform.rst @@ -4,7 +4,8 @@ Uniform nodes The **Uniform** and **Uniform/Greyscale** node output a single uniform image whose color is configurable. -.. image:: images/node_uniform.png +.. image:: images/node_simple_uniform.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_transform.rst b/material_maker/doc/node_transform.rst similarity index 98% rename from addons/material_maker/doc/node_transform.rst rename to material_maker/doc/node_transform.rst index 8aa8718..81a93f1 100644 --- a/addons/material_maker/doc/node_transform.rst +++ b/material_maker/doc/node_transform.rst @@ -4,6 +4,7 @@ Transform node The **Transform** node applies a scale operation, a rotation and a translation to the input image. .. image:: images/node_transform.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_transform_customuv.rst b/material_maker/doc/node_transform_customuv.rst similarity index 88% rename from addons/material_maker/doc/node_transform_customuv.rst rename to material_maker/doc/node_transform_customuv.rst index 833af99..d56008e 100644 --- a/addons/material_maker/doc/node_transform_customuv.rst +++ b/material_maker/doc/node_transform_customuv.rst @@ -3,7 +3,8 @@ CustomUV node The **CustomUV** node deforms an input image according to a custom UV map given as input. -.. image:: images/node_customuv.png +.. image:: images/node_transform_customuv.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_transform_kaleidoscope.rst b/material_maker/doc/node_transform_kaleidoscope.rst similarity index 89% rename from addons/material_maker/doc/node_transform_kaleidoscope.rst rename to material_maker/doc/node_transform_kaleidoscope.rst index df229b9..21d08fa 100644 --- a/addons/material_maker/doc/node_transform_kaleidoscope.rst +++ b/material_maker/doc/node_transform_kaleidoscope.rst @@ -4,7 +4,8 @@ Kaleidoscope node The **Kaleidoscope** node applies a kaleidoscope effect, i.e. copies an angle (by default the upper one) all around the image to its input. -.. image:: images/node_kaleidoscope.png +.. image:: images/node_transform_kaleidoscope.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_transform_mirror.rst b/material_maker/doc/node_transform_mirror.rst similarity index 89% rename from addons/material_maker/doc/node_transform_mirror.rst rename to material_maker/doc/node_transform_mirror.rst index f9387b0..57e57b6 100644 --- a/addons/material_maker/doc/node_transform_mirror.rst +++ b/material_maker/doc/node_transform_mirror.rst @@ -3,7 +3,8 @@ Mirror node The **Mirror** node applies a mirror filter on its input. -.. image:: images/node_mirror.png +.. image:: images/node_transform_mirror.png + :align: center Inputs ++++++ diff --git a/material_maker/doc/node_transform_splatter.rst b/material_maker/doc/node_transform_splatter.rst new file mode 100644 index 0000000..5fd449e --- /dev/null +++ b/material_maker/doc/node_transform_splatter.rst @@ -0,0 +1,42 @@ +Splatter node +~~~~~~~~~~~~~ + +The **Splatter** node splats several instances of its input with optional scale and rotation variations. +instances are mixed with each other using a *lighten* filter. + +The **Splatter** also has a color version whose input is in RGBA format. + +.. image:: images/node_transform_splatter.png + :align: center + +Inputs +++++++ + +The **Splatter** node accepts two inputs: + +* The *Source* inputs is the image to be splat into the output. + +* The *Mask* input is a greyscale image that is used as a mask and affects each instance's value. + +Outputs ++++++++ + +The **Splatter** node outputs the splat image. + +Parameters +++++++++++ + +The **Splatter** node has two parameters: + +* *Count*, the number of instances of the source image in the result, including those canceled by the mask. +* *Inputs* is the number of alternate shapes in the input (1, 4 or 16). Images containing several + shapes can easily be created using the **Tile2x2** node. +* *Rotate* is the maximum angle of the random rotation applied to each instance. +* *Scale* is the amount of scaling applied to each instance. + + +Example images +++++++++++++++ + +.. image:: images/node_transform_splatter_samples.png + :align: center diff --git a/material_maker/doc/node_transform_tile2x2.rst b/material_maker/doc/node_transform_tile2x2.rst new file mode 100644 index 0000000..0d6f003 --- /dev/null +++ b/material_maker/doc/node_transform_tile2x2.rst @@ -0,0 +1,28 @@ +Tile2x2 node +~~~~~~~~~~~~ + +The **Tile2x2** node combines 4 input images into a single output by tiling them. + +.. image:: images/node_transform_tile2x2.png + :align: center + +Inputs +++++++ + +The **Tile2x2** node accepts 4 RGBA inputs. + +Outputs ++++++++ + +The **Tile2x2** node outputs the tiled RGBA image. + +Parameters +++++++++++ + +The **Tile2x2** does not have any parameter. + +Example images +++++++++++++++ + +.. image:: images/node_transform_tile2x2_sample.png + :align: center diff --git a/addons/material_maker/doc/node_transform_warp.rst b/material_maker/doc/node_transform_warp.rst similarity index 91% rename from addons/material_maker/doc/node_transform_warp.rst rename to material_maker/doc/node_transform_warp.rst index 4a09031..d4748e9 100644 --- a/addons/material_maker/doc/node_transform_warp.rst +++ b/material_maker/doc/node_transform_warp.rst @@ -3,7 +3,8 @@ Warp node The **Warp** node deforms an input image according to the derivative of the second input image. -.. image:: images/node_warp.png +.. image:: images/node_transform_warp.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_workflow_applymap.rst b/material_maker/doc/node_workflow_applymap.rst similarity index 97% rename from addons/material_maker/doc/node_workflow_applymap.rst rename to material_maker/doc/node_workflow_applymap.rst index b67974a..fc1d5f2 100644 --- a/addons/material_maker/doc/node_workflow_applymap.rst +++ b/material_maker/doc/node_workflow_applymap.rst @@ -5,6 +5,7 @@ The **ApplyMap** node applys a map to a simple material by adjusting its orienta and outputs the modified map and the height information. .. image:: images/node_workflow_applymap.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_workflow_createmap.rst b/material_maker/doc/node_workflow_createmap.rst similarity index 97% rename from addons/material_maker/doc/node_workflow_createmap.rst rename to material_maker/doc/node_workflow_createmap.rst index 8560ef2..b2a2f40 100644 --- a/addons/material_maker/doc/node_workflow_createmap.rst +++ b/material_maker/doc/node_workflow_createmap.rst @@ -5,6 +5,7 @@ The **CreateMap** node creates a map holding height, orientation and offset info used to combine simple materials. .. image:: images/node_workflow_createmap.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_workflow_mix.rst b/material_maker/doc/node_workflow_mix.rst similarity index 96% rename from addons/material_maker/doc/node_workflow_mix.rst rename to material_maker/doc/node_workflow_mix.rst index c86333a..5df5321 100644 --- a/addons/material_maker/doc/node_workflow_mix.rst +++ b/material_maker/doc/node_workflow_mix.rst @@ -4,6 +4,7 @@ Mix node The **Mix** node mixes two applied maps based on the height information. .. image:: images/node_workflow_mix.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_workflow_mixmaps.rst b/material_maker/doc/node_workflow_mixmaps.rst similarity index 82% rename from addons/material_maker/doc/node_workflow_mixmaps.rst rename to material_maker/doc/node_workflow_mixmaps.rst index d98bb0a..3075b3e 100644 --- a/addons/material_maker/doc/node_workflow_mixmaps.rst +++ b/material_maker/doc/node_workflow_mixmaps.rst @@ -1,9 +1,10 @@ MixMaps node -~~~~~~~~~ +~~~~~~~~~~~~ The **MixMaps** node combines up to 4 maps holding height, orientation and offset information. -.. image:: images/node_workflow_mixmaps.png +.. image:: images/node_workflow_mixmap.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/node_workflow_output.rst b/material_maker/doc/node_workflow_output.rst similarity index 97% rename from addons/material_maker/doc/node_workflow_output.rst rename to material_maker/doc/node_workflow_output.rst index 5b999c5..fda960e 100644 --- a/addons/material_maker/doc/node_workflow_output.rst +++ b/material_maker/doc/node_workflow_output.rst @@ -5,6 +5,7 @@ The **Output** node converts an applied map into a material. It uses the height generate the normal and occlusion maps. .. image:: images/node_workflow_output.png + :align: center Inputs ++++++ diff --git a/addons/material_maker/doc/nodes.rst b/material_maker/doc/nodes.rst similarity index 100% rename from addons/material_maker/doc/nodes.rst rename to material_maker/doc/nodes.rst diff --git a/addons/material_maker/doc/nodes_3d.rst b/material_maker/doc/nodes_3d.rst similarity index 91% rename from addons/material_maker/doc/nodes_3d.rst rename to material_maker/doc/nodes_3d.rst index f52e10a..988ca11 100644 --- a/addons/material_maker/doc/nodes_3d.rst +++ b/material_maker/doc/nodes_3d.rst @@ -9,4 +9,5 @@ The simple nodes are nodes that do not accept any input and generate one or seve node_3d_box node_3d_sphere node_3d_sdf + node_3d_texture \ No newline at end of file diff --git a/addons/material_maker/doc/nodes_common.rst b/material_maker/doc/nodes_common.rst similarity index 100% rename from addons/material_maker/doc/nodes_common.rst rename to material_maker/doc/nodes_common.rst diff --git a/addons/material_maker/doc/nodes_filter.rst b/material_maker/doc/nodes_filter.rst similarity index 100% rename from addons/material_maker/doc/nodes_filter.rst rename to material_maker/doc/nodes_filter.rst diff --git a/addons/material_maker/doc/nodes_miscellaneous.rst b/material_maker/doc/nodes_miscellaneous.rst similarity index 100% rename from addons/material_maker/doc/nodes_miscellaneous.rst rename to material_maker/doc/nodes_miscellaneous.rst diff --git a/addons/material_maker/doc/nodes_noise.rst b/material_maker/doc/nodes_noise.rst similarity index 93% rename from addons/material_maker/doc/nodes_noise.rst rename to material_maker/doc/nodes_noise.rst index 9c99667..a68b26e 100644 --- a/addons/material_maker/doc/nodes_noise.rst +++ b/material_maker/doc/nodes_noise.rst @@ -11,3 +11,4 @@ made from random patterns. node_noise_color node_noise_perlin node_noise_voronoi + node_noise_fbm diff --git a/addons/material_maker/doc/nodes_pattern.rst b/material_maker/doc/nodes_pattern.rst similarity index 100% rename from addons/material_maker/doc/nodes_pattern.rst rename to material_maker/doc/nodes_pattern.rst diff --git a/addons/material_maker/doc/nodes_simple.rst b/material_maker/doc/nodes_simple.rst similarity index 100% rename from addons/material_maker/doc/nodes_simple.rst rename to material_maker/doc/nodes_simple.rst diff --git a/addons/material_maker/doc/nodes_transform.rst b/material_maker/doc/nodes_transform.rst similarity index 83% rename from addons/material_maker/doc/nodes_transform.rst rename to material_maker/doc/nodes_transform.rst index 05f4fce..5fb522b 100644 --- a/addons/material_maker/doc/nodes_transform.rst +++ b/material_maker/doc/nodes_transform.rst @@ -11,3 +11,5 @@ The transform nodes are nodes that affect the geometry of their input. node_transform_mirror node_transform_warp node_transform_customuv + node_transform_tile2x2 + node_transform_splatter diff --git a/addons/material_maker/doc/nodes_workflow.rst b/material_maker/doc/nodes_workflow.rst similarity index 100% rename from addons/material_maker/doc/nodes_workflow.rst rename to material_maker/doc/nodes_workflow.rst diff --git a/addons/material_maker/doc/remote_nodes.rst b/material_maker/doc/remote_nodes.rst similarity index 100% rename from addons/material_maker/doc/remote_nodes.rst rename to material_maker/doc/remote_nodes.rst diff --git a/addons/material_maker/doc/shader_nodes.rst b/material_maker/doc/shader_nodes.rst similarity index 100% rename from addons/material_maker/doc/shader_nodes.rst rename to material_maker/doc/shader_nodes.rst diff --git a/addons/material_maker/doc/subgraph_nodes.rst b/material_maker/doc/subgraph_nodes.rst similarity index 100% rename from addons/material_maker/doc/subgraph_nodes.rst rename to material_maker/doc/subgraph_nodes.rst diff --git a/addons/material_maker/doc/texture_nodes.rst b/material_maker/doc/texture_nodes.rst similarity index 100% rename from addons/material_maker/doc/texture_nodes.rst rename to material_maker/doc/texture_nodes.rst diff --git a/addons/material_maker/doc/user_interface.rst b/material_maker/doc/user_interface.rst similarity index 100% rename from addons/material_maker/doc/user_interface.rst rename to material_maker/doc/user_interface.rst diff --git a/material_maker/examples/3d_shapes.ptex b/material_maker/examples/3d_shapes.ptex index 2d7284d..dbc1134 100644 --- a/material_maker/examples/3d_shapes.ptex +++ b/material_maker/examples/3d_shapes.ptex @@ -624,7 +624,7 @@ "name": "sphere", "node_position": { "x": -989.422119, - "y": -246.039063 + "y": -247.039063 }, "parameters": { "cx": 0.5, diff --git a/material_maker/examples/beehive.ptex b/material_maker/examples/beehive.ptex index 40ee775..c8e3bc2 100644 --- a/material_maker/examples/beehive.ptex +++ b/material_maker/examples/beehive.ptex @@ -215,6 +215,8 @@ "param0": 11, "param1": 1.02, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" diff --git a/material_maker/examples/beehive.ptex.import b/material_maker/examples/beehive.ptex.import index 9f04d7b..87348a2 100644 --- a/material_maker/examples/beehive.ptex.import +++ b/material_maker/examples/beehive.ptex.import @@ -12,4 +12,4 @@ dest_files=[ "res://.import/beehive.ptex-51715262d81c1a144e9a7e141a45db7f.tres" [params] render=false -scale=1.0 +scale=3.0 diff --git a/material_maker/examples/biohazard.ptex b/material_maker/examples/biohazard.ptex index 24b975d..c7b61fa 100644 --- a/material_maker/examples/biohazard.ptex +++ b/material_maker/examples/biohazard.ptex @@ -245,6 +245,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -302,7 +303,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -402,6 +404,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -431,6 +434,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -460,6 +464,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -612,6 +617,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -643,6 +649,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" diff --git a/material_maker/examples/brick_rotated.ptex b/material_maker/examples/brick_rotated.ptex index 6ca816a..bce9a5e 100644 --- a/material_maker/examples/brick_rotated.ptex +++ b/material_maker/examples/brick_rotated.ptex @@ -88,7 +88,8 @@ "metallic": 1, "normal_scale": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -258,6 +259,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -296,6 +298,13 @@ "type": "transform" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment", "node_position": { "x": -391.274048, @@ -309,6 +318,7 @@ "y": 85 }, "text": "This example shows how to use the 3rd and 4th outputs of the bricks node to get the center of each brick.", + "title": "Comment", "type": "comment" }, { @@ -318,8 +328,13 @@ "y": -40.645294 }, "parameters": { + "amount": 0.5, "param0": 11, - "param1": 0.995 + "param1": 0.995, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 }, "type": "normal_map" } diff --git a/material_maker/examples/bricks.ptex.import b/material_maker/examples/bricks.ptex.import index 91014ce..b0ee3fc 100644 --- a/material_maker/examples/bricks.ptex.import +++ b/material_maker/examples/bricks.ptex.import @@ -12,4 +12,4 @@ dest_files=[ "res://.import/bricks.ptex-8a4a409b5b41c018677a6156ef3f93e5.tres" ] [params] render=false -scale=1.0 +scale=3.0 diff --git a/material_maker/examples/clump_of_grass.ptex b/material_maker/examples/clump_of_grass.ptex index 1c2bb01..8de76a6 100644 --- a/material_maker/examples/clump_of_grass.ptex +++ b/material_maker/examples/clump_of_grass.ptex @@ -126,6 +126,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -171,6 +172,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 0, @@ -234,7 +236,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -247,7 +250,11 @@ "parameters": { "amount": 0.5, "param0": 10, - "param1": 0.995 + "param1": 0.995, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 }, "type": "normal_map" } diff --git a/material_maker/examples/crocodile_skin.ptex b/material_maker/examples/crocodile_skin.ptex index 75d32f0..10966ce 100644 --- a/material_maker/examples/crocodile_skin.ptex +++ b/material_maker/examples/crocodile_skin.ptex @@ -77,7 +77,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -89,6 +90,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -118,6 +120,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -166,7 +169,9 @@ "intensity": 0.4, "randomness": 1, "scale_x": 16, - "scale_y": 16 + "scale_y": 16, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -178,6 +183,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -216,6 +222,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" diff --git a/material_maker/examples/doc_tools.ptex b/material_maker/examples/doc_tools.ptex index 58eb054..8a4bf4a 100644 --- a/material_maker/examples/doc_tools.ptex +++ b/material_maker/examples/doc_tools.ptex @@ -18,18 +18,6 @@ "to": "blend", "to_port": 2 }, - { - "from": "sdf3d_cylinder", - "from_port": 0, - "to": "raymarching", - "to_port": 0 - }, - { - "from": "blend_2", - "from_port": 0, - "to": "Material", - "to_port": 0 - }, { "from": "shape", "from_port": 0, @@ -71,6 +59,102 @@ "from_port": 0, "to": "blend", "to_port": 1 + }, + { + "from": "tex3d_fbm_4", + "from_port": 0, + "to": "tex3d_distort_2", + "to_port": 1 + }, + { + "from": "tex3d_pattern_2", + "from_port": 0, + "to": "tex3d_distort_2", + "to_port": 0 + }, + { + "from": "tex3d_distort_2", + "from_port": 0, + "to": "4330", + "to_port": 0 + }, + { + "from": "sdf3d_elongation", + "from_port": 0, + "to": "raymarching", + "to_port": 0 + }, + { + "from": "sdf3d_torus", + "from_port": 0, + "to": "sdf3d_elongation", + "to_port": 0 + }, + { + "from": "shape_2", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "shape_2_3", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "shape_2_2", + "from_port": 0, + "to": "colorize_2_2", + "to_port": 0 + }, + { + "from": "shape_2_2_2", + "from_port": 0, + "to": "colorize_2_2_2", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "tile2x2", + "to_port": 0 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "tile2x2", + "to_port": 1 + }, + { + "from": "colorize_2_2", + "from_port": 0, + "to": "tile2x2", + "to_port": 2 + }, + { + "from": "colorize_2_2_2", + "from_port": 0, + "to": "tile2x2", + "to_port": 3 + }, + { + "from": "tile2x2", + "from_port": 0, + "to": "splatter", + "to_port": 0 + }, + { + "from": "tile2x2", + "from_port": 0, + "to": "splatter_color", + "to_port": 0 + }, + { + "from": "splatter_color", + "from_port": 0, + "to": "Material", + "to_port": 0 } ], "label": "Graph", @@ -83,8 +167,8 @@ { "name": "Material", "node_position": { - "x": 501.544006, - "y": 288.080017 + "x": 23.544006, + "y": 381.080017 }, "parameters": { "albedo_color": { @@ -100,7 +184,7 @@ "metallic": 1, "normal_scale": 1, "roughness": 1, - "size": 9, + "size": 8, "subsurf_scatter_strength": 0 }, "type": "material" @@ -225,8 +309,8 @@ "label": "Tile Inputs", "name": "graph", "node_position": { - "x": 197.541992, - "y": 137.266541 + "x": 608.541992, + "y": 541.266541 }, "nodes": [ { @@ -505,8 +589,8 @@ "label": "Arrow", "name": "graph_2", "node_position": { - "x": 196.827515, - "y": 248.753479 + "x": 607.827515, + "y": 652.753479 }, "nodes": [ { @@ -519,7 +603,6 @@ "cx": -0.07, "cy": 0, "h": 0.04, - "r": 0.3, "w": 0.08 }, "type": "sdbox" @@ -534,7 +617,6 @@ "cx": -0.02, "cy": 0, "h": 0.12, - "r": 0.3, "w": 0.15 }, "type": "sdrhombus" @@ -549,7 +631,6 @@ "cx": -0.23, "cy": 0, "h": 0.35, - "r": 0.3, "w": 0.21 }, "type": "sdbox" @@ -561,13 +642,7 @@ "y": 205.972443 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdboolean" }, @@ -578,13 +653,7 @@ "y": 282.510315 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdboolean" }, @@ -670,12 +739,7 @@ "y": 365.52536 }, "parameters": { - "bevel": 0.01, - "cx": 0, - "cy": 0, - "h": 0.08, - "r": 0.3, - "w": 0.28 + "bevel": 0.01 }, "type": "sdshow" } @@ -709,8 +773,8 @@ "label": "Gradient", "name": "graph_3", "node_position": { - "x": -226.787903, - "y": 711.143799 + "x": -298.787903, + "y": 716.143799 }, "nodes": [ { @@ -902,8 +966,8 @@ { "name": "blend", "node_position": { - "x": 138.235168, - "y": 415.099731 + "x": 549.235168, + "y": 819.099731 }, "parameters": { "amount": 1, @@ -914,8 +978,8 @@ { "name": "blend_2", "node_position": { - "x": 142.235168, - "y": 326.099731 + "x": 553.235168, + "y": 730.099731 }, "parameters": { "amount": 1, @@ -926,8 +990,8 @@ { "name": "raymarching", "node_position": { - "x": 380.468536, - "y": 2.145508 + "x": -249.531464, + "y": 322.145508 }, "parameters": { @@ -1179,14 +1243,8 @@ "y": 938.422729 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.04, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_smoothboolean" }, @@ -1210,14 +1268,8 @@ "y": 873.422729 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.17, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_smoothboolean" }, @@ -1301,13 +1353,9 @@ "y": 1471.172852 }, "parameters": { - "a": 0, "ax": -30, "ay": 45, - "az": 0, - "x": 0.35, - "y": 0, - "z": 0 + "az": 0 }, "shader_model": { "code": "", @@ -1380,14 +1428,8 @@ "y": 1236.172852 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.09, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_smoothboolean" }, @@ -1398,14 +1440,8 @@ "y": 1073.172852 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.15, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_smoothboolean" }, @@ -1429,14 +1465,8 @@ "y": 1454.672852 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.03, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_smoothboolean" }, @@ -1460,9 +1490,7 @@ "y": 1762.672852 }, "parameters": { - "x": 0.15, - "y": 0, - "z": 0.18 + }, "shader_model": { "code": "", @@ -1603,13 +1631,9 @@ "y": 1829.119385 }, "parameters": { - "a": 0, "ax": 0, "ay": 0, - "az": 45, - "x": 0.35, - "y": 0, - "z": 0 + "az": 45 }, "shader_model": { "code": "", @@ -1669,15 +1693,7 @@ "y": 2035.119385 }, "parameters": { - "a": 0, - "c": 15, - "r": 0.24, - "rx": 4, - "ry": 4, - "s": 0.3, - "x": 0.35, - "y": 0, - "z": 0 + "c": 15 }, "shader_model": { "code": "", @@ -1719,13 +1735,9 @@ "y": 1859.869385 }, "parameters": { - "a": 0, "ax": -90, "ay": 0, - "az": 0, - "x": 0.35, - "y": 0, - "z": 0 + "az": 0 }, "shader_model": { "code": "", @@ -1799,10 +1811,7 @@ }, "parameters": { "l": 0.06, - "r": 0.15, - "sx": 0.25, - "sy": 0.25, - "sz": 0.5 + "r": 0.15 }, "type": "sdf3d_cylinder" }, @@ -1813,14 +1822,8 @@ "y": 815.75 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.1, - "op": 1, - "r": 0.3, - "w": 0.28 + "op": 1 }, "type": "sdf3d_smoothboolean" }, @@ -1845,14 +1848,8 @@ "y": 1761.75 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, "k": 0.05, - "op": 0, - "r": 0.3, - "w": 0.28 + "op": 0 }, "type": "sdf3d_smoothboolean" }, @@ -1887,13 +1884,7 @@ "y": 2076 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 2, - "r": 0.3, - "w": 0.28 + "op": 2 }, "type": "sdf3d_boolean" }, @@ -1904,14 +1895,7 @@ "y": 2070.75 }, "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "k": 0.15, - "op": 0, - "r": 0.01, - "w": 0.28 + "r": 0.01 }, "shader_model": { "code": "", @@ -1953,13 +1937,9 @@ "y": 2085.75 }, "parameters": { - "a": 0, "ax": 0, "ay": 0, - "az": 11, - "x": 0.35, - "y": 0, - "z": 0 + "az": 11 }, "shader_model": { "code": "", @@ -2019,11 +1999,7 @@ "y": 772.643799 }, "parameters": { - "a": 0, - "s": 0.48, - "x": 0.35, - "y": 0, - "z": 0 + "s": 0.48 }, "type": "sdf3d_scale" } @@ -2040,35 +2016,27 @@ "y": -191.970337 }, "parameters": { - "a": 0, - "d": -0.53, - "s": 1, - "x": 0.35, - "y": 0, - "z": 0 + "d": -0.53 }, "type": "sdf3d_extrusion" }, { "name": "sdf3d_cylinder", "node_position": { - "x": 115.056458, - "y": -125.498108 + "x": -701.943542, + "y": 10.501892 }, "parameters": { "l": 0.25, - "r": 0.25, - "sx": 0.25, - "sy": 0.25, - "sz": 0.5 + "r": 0.25 }, "type": "sdf3d_cylinder" }, { "name": "edge_detect_1", "node_position": { - "x": -275.198914, - "y": 265.017395 + "x": 135.801086, + "y": 669.017395 }, "parameters": { "size": 7 @@ -2078,8 +2046,8 @@ { "name": "shape", "node_position": { - "x": -651.198914, - "y": 310.517395 + "x": -284.198914, + "y": 863.517395 }, "parameters": { "edge": 0.754975, @@ -2092,46 +2060,449 @@ { "name": "edge_detect_2", "node_position": { - "x": -275.198914, - "y": 318.017395 + "x": 135.801086, + "y": 722.017395 }, "parameters": { "size": 6 }, + "seed_value": 27531, "type": "edge_detect_2" }, { "name": "edge_detect_3", "node_position": { - "x": -276.198914, - "y": 371.017395 + "x": 134.801086, + "y": 775.017395 }, "parameters": { "size": 6 }, + "seed_value": 18749, "type": "edge_detect_3" }, { "name": "sharpen", "node_position": { - "x": -288.198914, - "y": 505.017395 + "x": 122.801086, + "y": 909.017395 }, "parameters": { "size": 6 }, + "seed_value": 55115, "type": "sharpen" }, { "name": "quantize", "node_position": { - "x": -497.198914, - "y": 378.517395 + "x": -84.198914, + "y": 926.517395 }, "parameters": { "steps": 4 }, "type": "quantize" + }, + { + "name": "4330", + "node_position": { + "x": -240.982361, + "y": 435.636383 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "float calcdist(vec3 p) {\n return length(p)-0.4;\n}\n\nfloat raymarch(vec3 ro, vec3 rd) {\n float d=0.0;\n for (int i = 0; i < 250; i++) {\n vec3 p = ro + rd*d;\n float dstep = calcdist(p);\n d += dstep;\n if (dstep < 0.0000001) break;\n }\n return d;\n}\nvec3 normal(vec3 p) {\n float d = calcdist(p);\n float e = .0001;\n 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)));\n return normalize(n);\n}\n\n", + "inputs": [ + { + "default": "vec3(1.0)", + "function": true, + "label": "", + "name": "in", + "type": "tex3d" + } + ], + "instance": "vec4 pvt3d(vec2 uv) {\n uv -= vec2(0.5);\n vec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n vec3 n = normal(p);\n vec3 l = vec3(5.0, 5.0, 10.0);\n vec3 ld = normalize(l-p);\n float o = step(p.z, 0.001);\n float shadow = 1.0-0.75*step(raymarch(l, -ld), length(l-p)-0.01);\n float light = 0.3+0.7*dot(n, ld)*shadow;\n return vec4($in(vec4(p, 0.0))*light, 1.0);\n}\n", + "name": "TEX3D preview", + "outputs": [ + { + "rgba": "pvt3d($uv)", + "type": "rgba" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "name": "tex3d_pattern_2", + "node_position": { + "x": -973.849976, + "y": 562.386353 + }, + "parameters": { + "mix": 4, + "x_scale": 2, + "x_wave": 2, + "y_scale": 2, + "y_wave": 2, + "z_scale": 2, + "z_wave": 2 + }, + "type": "tex3d_pattern" + }, + { + "name": "tex3d_fbm_4", + "node_position": { + "x": -967.880981, + "y": 383.243591 + }, + "parameters": { + "iterations": 3, + "noise": 2, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8, + "scale_z": 8 + }, + "type": "tex3d_fbm" + }, + { + "name": "tex3d_distort_2", + "node_position": { + "x": -606.474854, + "y": 463.950104 + }, + "parameters": { + "Distort": 0.3 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec3(1.0)", + "label": "", + "name": "in1", + "type": "tex3d" + }, + { + "default": "vec3(0.0)", + "label": "", + "name": "in2", + "type": "tex3d" + } + ], + "instance": "", + "name": "TEX3D Distort", + "outputs": [ + { + "tex3d": "$in1(vec4($uv.xyz+($in2($uv)*$Distort*0.5-0.5), 0.0))", + "type": "tex3d" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "Distort", + "max": 1, + "min": 0, + "name": "Distort", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_elongation", + "node_position": { + "x": -493.474854, + "y": 290.950104 + }, + "parameters": { + "x": 0.2, + "y": 0, + "z": 0 + }, + "type": "sdf3d_elongation" + }, + { + "name": "sdf3d_torus", + "node_position": { + "x": -505.208618, + "y": 190.516663 + }, + "parameters": { + "R": 0.180551, + "r": 0.097392 + }, + "type": "sdf3d_torus" + }, + { + "name": "fbm", + "node_position": { + "x": -264.208618, + "y": 128.516663 + }, + "parameters": { + "iterations": 6, + "noise": 2, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8 + }, + "type": "fbm" + }, + { + "name": "splatter", + "node_position": { + "x": -342.208618, + "y": 502.266663 + }, + "parameters": { + "count": 25, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "type": "splatter" + }, + { + "name": "colorize_2_2_2", + "node_position": { + "x": -819.442566, + "y": 1165.332642 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 0, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 0.093751, + "pos": 0.045455, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "shape_2_2", + "node_position": { + "x": -1016.442627, + "y": 1034.332642 + }, + "parameters": { + "edge": 1, + "radius": 0.21, + "shape": 0, + "sides": 6 + }, + "type": "shape" + }, + { + "name": "colorize_2_2", + "node_position": { + "x": -840.442566, + "y": 1029.332642 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 0, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 1, + "pos": 0.036364, + "r": 0.21875 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "shape_2", + "node_position": { + "x": -1019.442627, + "y": 754.082642 + }, + "parameters": { + "edge": 1, + "radius": 0.18, + "shape": 1, + "sides": 6 + }, + "type": "shape" + }, + { + "name": "shape_2_3", + "node_position": { + "x": -1022.442627, + "y": 897.332642 + }, + "parameters": { + "edge": 1, + "radius": 0.06, + "shape": 2, + "sides": 5 + }, + "type": "shape" + }, + { + "name": "colorize_2", + "node_position": { + "x": -838.442566, + "y": 893.332642 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 0, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 0.9375, + "pos": 0.045455, + "r": 1 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize", + "node_position": { + "x": -840.442566, + "y": 748.082642 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 0, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.036364, + "r": 1 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "shape_2_2_2", + "node_position": { + "x": -1016.442627, + "y": 1170.332642 + }, + "parameters": { + "edge": 1, + "radius": 0.13, + "shape": 3, + "sides": 7 + }, + "type": "shape" + }, + { + "name": "tile2x2", + "node_position": { + "x": -522.442566, + "y": 943.082642 + }, + "parameters": { + + }, + "type": "tile2x2" + }, + { + "name": "splatter_color", + "node_position": { + "x": -328.164795, + "y": 1041.0271 + }, + "parameters": { + "count": 100, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "type": "splatter_color" } ], "parameters": { diff --git a/material_maker/examples/dry_earth.ptex b/material_maker/examples/dry_earth.ptex index 63bea08..c6082be 100644 --- a/material_maker/examples/dry_earth.ptex +++ b/material_maker/examples/dry_earth.ptex @@ -114,7 +114,9 @@ "intensity": 0.6, "randomness": 1, "scale_x": 4, - "scale_y": 4 + "scale_y": 4, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -126,6 +128,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -169,6 +172,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -225,7 +229,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -237,6 +242,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -305,6 +311,9 @@ "amount": 0.35, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -317,6 +326,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -346,6 +356,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/emmental.ptex b/material_maker/examples/emmental.ptex index 924c326..6f216cc 100644 --- a/material_maker/examples/emmental.ptex +++ b/material_maker/examples/emmental.ptex @@ -97,7 +97,9 @@ "intensity": 1, "randomness": 0.49, "scale_x": 6, - "scale_y": 6 + "scale_y": 6, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -196,6 +198,8 @@ "param0": 11, "param1": 0.945, "param2": 1, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" diff --git a/material_maker/examples/floor1.ptex b/material_maker/examples/floor1.ptex index 49dad63..16f8408 100644 --- a/material_maker/examples/floor1.ptex +++ b/material_maker/examples/floor1.ptex @@ -228,6 +228,9 @@ "amount": 0.15, "param0": 11, "param1": 0.185, + "param2": 0, + "param3": 0, + "param4": 1, "size": 5 }, "type": "normal_map" @@ -240,6 +243,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -269,6 +273,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -298,6 +303,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -327,6 +333,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -392,6 +399,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -422,9 +430,11 @@ "parameters": { "bevel": 0.03, "columns": 6, + "corner": 0, "mortar": 0.01, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0, "rows": 6 }, @@ -497,6 +507,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -526,6 +537,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -592,7 +604,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, diff --git a/material_maker/examples/floor1.ptex.import b/material_maker/examples/floor1.ptex.import index f05886b..724f11b 100644 --- a/material_maker/examples/floor1.ptex.import +++ b/material_maker/examples/floor1.ptex.import @@ -12,4 +12,4 @@ dest_files=[ "res://.import/floor1.ptex-fb54baf7242d73ad5e0d97d70fc2ffe8.tres" ] [params] render=false -scale=1.0 +scale=3.0 diff --git a/material_maker/examples/floor2.ptex b/material_maker/examples/floor2.ptex index a09f3a5..86998ee 100644 --- a/material_maker/examples/floor2.ptex +++ b/material_maker/examples/floor2.ptex @@ -83,7 +83,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -110,9 +111,11 @@ "parameters": { "bevel": 0.01, "columns": 4, + "corner": 0, "mortar": 0.01, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0, "rows": 4 }, @@ -128,6 +131,9 @@ "amount": 0.2, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -140,6 +146,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -169,6 +176,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/grass_with_flowers.ptex b/material_maker/examples/grass_with_flowers.ptex index 2be9bcb..5221399 100644 --- a/material_maker/examples/grass_with_flowers.ptex +++ b/material_maker/examples/grass_with_flowers.ptex @@ -94,6 +94,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -136,7 +137,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -150,6 +152,9 @@ "amount": 0.8, "param0": 11, "param1": 0.25, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -162,6 +167,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -191,6 +197,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -265,7 +272,9 @@ "intensity": 1, "randomness": 1, "scale_x": 14, - "scale_y": 14 + "scale_y": 14, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, diff --git a/material_maker/examples/halloween.ptex b/material_maker/examples/halloween.ptex index c275a79..6396e9b 100644 --- a/material_maker/examples/halloween.ptex +++ b/material_maker/examples/halloween.ptex @@ -478,6 +478,8 @@ "param0": 10, "param1": 0.185, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -615,6 +617,13 @@ "type": "colorize" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment", "node_position": { "x": 40.787872, @@ -628,6 +637,7 @@ "y": 69 }, "text": "Best viewed on \"Sphere\" mesh", + "title": "Comment", "type": "comment" } ], diff --git a/material_maker/examples/improved_brick.ptex b/material_maker/examples/improved_brick.ptex index 80c9f2a..f48ab71 100644 --- a/material_maker/examples/improved_brick.ptex +++ b/material_maker/examples/improved_brick.ptex @@ -226,7 +226,8 @@ "metallic": 0, "normal_scale": 1, "roughness": 0.85, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -239,9 +240,11 @@ "parameters": { "bevel": 0, "columns": 6, + "corner": 0, "mortar": 0.087751, "pattern": 1, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 20 }, @@ -255,6 +258,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -310,6 +314,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -353,6 +358,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 0.898039, @@ -396,6 +402,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 0.588235, @@ -468,6 +475,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -497,6 +505,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -526,6 +535,13 @@ "type": "colorize" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment", "node_position": { "x": -1405.656738, @@ -539,6 +555,7 @@ "y": 165.399994 }, "text": "Realistic Bricks by Rafe Hall\n\nProcedural brick material that supports brick color, wear, ambient occlusion, grime, and depth.\n\nTODO: Edge wear, plaster and better layering.", + "title": "Comment", "type": "comment" }, { @@ -575,6 +592,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -604,6 +622,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -653,9 +672,11 @@ "parameters": { "bevel": 0.087751, "columns": 6, + "corner": 0, "mortar": 0, "pattern": 1, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 20 }, @@ -671,6 +692,9 @@ "amount": 0.5, "param0": 11, "param1": 1, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -683,6 +707,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -726,6 +751,9 @@ "amount": 0.5, "param0": 11, "param1": 1, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -738,6 +766,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -769,6 +798,9 @@ "amount": 0.5, "param0": 11, "param1": 0.42, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -786,6 +818,13 @@ "type": "blend" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2", "node_position": { "x": -202.672852, @@ -799,6 +838,7 @@ "y": 49 }, "text": "Improved bricks, by Rafe Hall (aka MrDiamondGold)", + "title": "Comment", "type": "comment" } ], diff --git a/material_maker/examples/lava.ptex b/material_maker/examples/lava.ptex index dd72b13..be28f9a 100644 --- a/material_maker/examples/lava.ptex +++ b/material_maker/examples/lava.ptex @@ -125,7 +125,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -137,6 +138,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -187,6 +189,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -216,6 +219,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -254,6 +258,9 @@ "amount": 0.9, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -266,6 +273,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -322,7 +330,9 @@ "intensity": 0.55, "randomness": 1, "scale_x": 6, - "scale_y": 6 + "scale_y": 6, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, diff --git a/material_maker/examples/mandala.ptex b/material_maker/examples/mandala.ptex index effadb6..36ecd3e 100644 --- a/material_maker/examples/mandala.ptex +++ b/material_maker/examples/mandala.ptex @@ -118,7 +118,8 @@ "metallic": 0.25, "normal_scale": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -164,6 +165,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -230,8 +232,13 @@ "y": -82.444458 }, "parameters": { + "amount": 0.5, "param0": 11, - "param1": 0.995 + "param1": 0.995, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 }, "type": "normal_map" } @@ -335,6 +342,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -371,6 +379,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -465,6 +474,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -508,6 +518,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -591,6 +602,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -753,6 +765,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -829,6 +842,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -877,6 +891,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -921,6 +936,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1092,6 +1108,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1161,6 +1178,7 @@ "widget": "count" } ], + "name": "param0", "type": "linked_control" }, { @@ -1171,6 +1189,7 @@ "widget": "radius" } ], + "name": "param1", "type": "linked_control" } ] @@ -1408,6 +1427,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1491,6 +1511,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1539,6 +1560,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1583,6 +1605,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1737,6 +1760,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -1806,6 +1830,7 @@ "widget": "count" } ], + "name": "param0", "type": "linked_control" }, { @@ -1816,6 +1841,7 @@ "widget": "radius" } ], + "name": "param1", "type": "linked_control" } ] @@ -2045,6 +2071,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -2088,6 +2115,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/mandelbrot.ptex b/material_maker/examples/mandelbrot.ptex index 8397764..33b092b 100644 --- a/material_maker/examples/mandelbrot.ptex +++ b/material_maker/examples/mandelbrot.ptex @@ -41,7 +41,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -116,6 +117,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/marble.ptex.import b/material_maker/examples/marble.ptex.import index 610c826..728a21d 100644 --- a/material_maker/examples/marble.ptex.import +++ b/material_maker/examples/marble.ptex.import @@ -12,4 +12,4 @@ dest_files=[ "res://.import/marble.ptex-0b7e8ced36657d462bfe938e53d1f73b.tres" ] [params] render=false -scale=1.0 +scale=3.0 diff --git a/material_maker/examples/medieval_wall.ptex b/material_maker/examples/medieval_wall.ptex index a687fb0..54658c6 100644 --- a/material_maker/examples/medieval_wall.ptex +++ b/material_maker/examples/medieval_wall.ptex @@ -2449,6 +2449,13 @@ "type": "uniform" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment", "node_position": { "x": -2427.006836, @@ -2462,13 +2469,21 @@ "y": 124 }, "text": "This example first defines shapes (with heigth and material rotation information) then associated them a material and finally merges the result into a single material.", + "title": "Comment", "type": "comment" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2", "node_position": { - "x": -1648.280762, - "y": 291.200073 + "x": -1653.280762, + "y": 272.200073 }, "parameters": { "size": 4 @@ -2478,13 +2493,21 @@ "y": 50 }, "text": "Wood shapes", + "title": "Comment", "type": "comment" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2_2", "node_position": { - "x": -1502.780762, - "y": 375.700073 + "x": -1504.780762, + "y": 354.700073 }, "parameters": { "size": 4 @@ -2494,13 +2517,21 @@ "y": 73 }, "text": "Wood shapes with material applied", + "title": "Comment", "type": "comment" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2_2_2", "node_position": { - "x": -1491.280762, - "y": 697.200073 + "x": -1502.280762, + "y": 788.200073 }, "parameters": { "size": 4 @@ -2510,13 +2541,21 @@ "y": 44 }, "text": "Bricks", + "title": "Comment", "type": "comment" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2_2_2_2", "node_position": { - "x": -1342.280762, - "y": 344.700073 + "x": -1350.280762, + "y": 318.700073 }, "parameters": { "size": 4 @@ -2526,9 +2565,17 @@ "y": 128 }, "text": "Wood shapes blended with bricks based on height information", + "title": "Comment", "type": "comment" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment_2_2_2_2_2", "node_position": { "x": -1175.626587, @@ -2542,6 +2589,7 @@ "y": 72 }, "text": "This node converts material+shapes data into what Material expects", + "title": "Comment", "type": "comment" }, { @@ -2571,8 +2619,8 @@ { "name": "mwf_map", "node_position": { - "x": -1508.537354, - "y": 583.016724 + "x": -1514.537354, + "y": 628.016724 }, "parameters": { @@ -2699,8 +2747,8 @@ { "name": "brightness_contrast", "node_position": { - "x": -1468.755005, - "y": 754.429321 + "x": -1481.755005, + "y": 892.429321 }, "parameters": { "brightness": 0, diff --git a/material_maker/examples/medieval_wall.ptex.import b/material_maker/examples/medieval_wall.ptex.import index a2050c7..6458ce3 100644 --- a/material_maker/examples/medieval_wall.ptex.import +++ b/material_maker/examples/medieval_wall.ptex.import @@ -12,4 +12,4 @@ dest_files=[ "res://.import/medieval_wall.ptex-28369316aeb5d9dfca15a3cfe9753817. [params] render=false -scale=1.0 +scale=3.0 diff --git a/material_maker/examples/metal_pattern.ptex b/material_maker/examples/metal_pattern.ptex index de52ad9..52bb7d5 100644 --- a/material_maker/examples/metal_pattern.ptex +++ b/material_maker/examples/metal_pattern.ptex @@ -180,6 +180,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -222,7 +223,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -246,6 +248,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -292,6 +295,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -335,6 +339,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -364,6 +369,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -393,6 +399,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -442,6 +449,9 @@ "amount": 0.6, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -506,6 +516,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/metal_pattern_2.ptex b/material_maker/examples/metal_pattern_2.ptex index 3712126..407f3f8 100644 --- a/material_maker/examples/metal_pattern_2.ptex +++ b/material_maker/examples/metal_pattern_2.ptex @@ -73,6 +73,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -146,7 +147,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 0.75, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -160,6 +162,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" diff --git a/material_maker/examples/metal_pattern_3.ptex b/material_maker/examples/metal_pattern_3.ptex index ce390f3..aba9945 100644 --- a/material_maker/examples/metal_pattern_3.ptex +++ b/material_maker/examples/metal_pattern_3.ptex @@ -70,6 +70,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -112,7 +113,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -126,6 +128,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -231,6 +236,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/mmm_donuts.ptex b/material_maker/examples/mmm_donuts.ptex new file mode 100644 index 0000000..dc30143 --- /dev/null +++ b/material_maker/examples/mmm_donuts.ptex @@ -0,0 +1,2530 @@ +{ + "connections": [ + { + "from": "graph", + "from_port": 0, + "to": "sdf3d_scale_2", + "to_port": 0 + }, + { + "from": "sdf3d_scale_2", + "from_port": 0, + "to": "sdf3d_repeat", + "to_port": 0 + }, + { + "from": "sdf3d_scale_2", + "from_port": 0, + "to": "sdf3d_repeat_2", + "to_port": 0 + }, + { + "from": "sdf3d_repeat_2", + "from_port": 0, + "to": "sdf3d_translate_3_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_repeat", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 0 + }, + { + "from": "sdf3d_translate_3_2_2", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 1 + }, + { + "from": "sdf3d_boolean", + "from_port": 0, + "to": "sdf3d_translate_3_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_3_2_2_2", + "from_port": 0, + "to": "raymarching", + "to_port": 0 + }, + { + "from": "mwf_create_map", + "from_port": 0, + "to": "mwf_map", + "to_port": 0 + }, + { + "from": "mwf_create_map_3", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 0 + }, + { + "from": "mwf_create_map_2", + "from_port": 0, + "to": "mwf_map_2_2", + "to_port": 0 + }, + { + "from": "uniform", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 1 + }, + { + "from": "mwf_map_2", + "from_port": 0, + "to": "mwf_mix", + "to_port": 0 + }, + { + "from": "mwf_map_2", + "from_port": 1, + "to": "mwf_mix", + "to_port": 1 + }, + { + "from": "mwf_map_2", + "from_port": 2, + "to": "mwf_mix", + "to_port": 2 + }, + { + "from": "mwf_map_2", + "from_port": 3, + "to": "mwf_mix", + "to_port": 3 + }, + { + "from": "mwf_map_2", + "from_port": 4, + "to": "mwf_mix", + "to_port": 4 + }, + { + "from": "mwf_map_2_2", + "from_port": 0, + "to": "mwf_mix", + "to_port": 5 + }, + { + "from": "mwf_map_2_2", + "from_port": 1, + "to": "mwf_mix", + "to_port": 6 + }, + { + "from": "mwf_map_2_2", + "from_port": 2, + "to": "mwf_mix", + "to_port": 7 + }, + { + "from": "mwf_map_2_2", + "from_port": 3, + "to": "mwf_mix", + "to_port": 8 + }, + { + "from": "mwf_map_2_2", + "from_port": 4, + "to": "mwf_mix", + "to_port": 9 + }, + { + "from": "mwf_mix", + "from_port": 4, + "to": "mwf_mix_2", + "to_port": 9 + }, + { + "from": "mwf_mix", + "from_port": 3, + "to": "mwf_mix_2", + "to_port": 8 + }, + { + "from": "mwf_mix", + "from_port": 2, + "to": "mwf_mix_2", + "to_port": 7 + }, + { + "from": "mwf_mix", + "from_port": 1, + "to": "mwf_mix_2", + "to_port": 6 + }, + { + "from": "mwf_mix", + "from_port": 0, + "to": "mwf_mix_2", + "to_port": 5 + }, + { + "from": "mwf_mix_2", + "from_port": 0, + "to": "mwf_output", + "to_port": 0 + }, + { + "from": "mwf_mix_2", + "from_port": 1, + "to": "mwf_output", + "to_port": 1 + }, + { + "from": "mwf_mix_2", + "from_port": 2, + "to": "mwf_output", + "to_port": 2 + }, + { + "from": "mwf_mix_2", + "from_port": 3, + "to": "mwf_output", + "to_port": 3 + }, + { + "from": "mwf_mix_2", + "from_port": 4, + "to": "mwf_output", + "to_port": 4 + }, + { + "from": "mwf_output", + "from_port": 0, + "to": "Material", + "to_port": 0 + }, + { + "from": "mwf_output", + "from_port": 1, + "to": "Material", + "to_port": 1 + }, + { + "from": "mwf_output", + "from_port": 2, + "to": "Material", + "to_port": 2 + }, + { + "from": "mwf_output", + "from_port": 3, + "to": "Material", + "to_port": 3 + }, + { + "from": "mwf_output", + "from_port": 5, + "to": "Material", + "to_port": 5 + }, + { + "from": "uniform_2", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 2 + }, + { + "from": "uniform_3", + "from_port": 0, + "to": "mwf_map", + "to_port": 1 + }, + { + "from": "uniform_2_2", + "from_port": 0, + "to": "mwf_map", + "to_port": 2 + }, + { + "from": "uniform_2_3_2", + "from_port": 0, + "to": "mwf_map_2_2", + "to_port": 2 + }, + { + "from": "raymarching", + "from_port": 1, + "to": "Material", + "to_port": 4 + }, + { + "from": "mwf_map", + "from_port": 4, + "to": "mwf_mix_3", + "to_port": 9 + }, + { + "from": "mwf_map", + "from_port": 3, + "to": "mwf_mix_3", + "to_port": 8 + }, + { + "from": "mwf_map", + "from_port": 2, + "to": "mwf_mix_3", + "to_port": 7 + }, + { + "from": "mwf_map", + "from_port": 1, + "to": "mwf_mix_3", + "to_port": 6 + }, + { + "from": "mwf_map", + "from_port": 0, + "to": "mwf_mix_3", + "to_port": 5 + }, + { + "from": "mwf_mix_3", + "from_port": 0, + "to": "mwf_mix_2", + "to_port": 0 + }, + { + "from": "mwf_mix_3", + "from_port": 1, + "to": "mwf_mix_2", + "to_port": 1 + }, + { + "from": "mwf_mix_3", + "from_port": 2, + "to": "mwf_mix_2", + "to_port": 2 + }, + { + "from": "mwf_mix_3", + "from_port": 3, + "to": "mwf_mix_2", + "to_port": 3 + }, + { + "from": "mwf_mix_3", + "from_port": 4, + "to": "mwf_mix_2", + "to_port": 4 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "mwf_mix_3", + "to_port": 0 + }, + { + "from": "uniform_4", + "from_port": 0, + "to": "mwf_mix_3", + "to_port": 1 + }, + { + "from": "uniform_4_2", + "from_port": 0, + "to": "mwf_mix_3", + "to_port": 2 + }, + { + "from": "colorize", + "from_port": 0, + "to": "mwf_map_2_2", + "to_port": 1 + }, + { + "from": "perlin", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "mwf_output", + "from_port": 6, + "to": "Material", + "to_port": 6 + }, + { + "from": "raymarching", + "from_port": 0, + "to": "mul_detect", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 2, + "to": "mul_detect", + "to_port": 1 + }, + { + "from": "mul_detect", + "from_port": 0, + "to": "mwf_create_map", + "to_port": 0 + }, + { + "from": "mul_detect_2", + "from_port": 0, + "to": "mwf_create_map_3", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 0, + "to": "mul_detect_2", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 2, + "to": "mul_detect_2", + "to_port": 1 + }, + { + "from": "raymarching", + "from_port": 0, + "to": "mul_detect_2_2", + "to_port": 0 + }, + { + "from": "mul_detect_2_2", + "from_port": 0, + "to": "mwf_create_map_2", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 2, + "to": "mul_detect_2_2", + "to_port": 1 + } + ], + "label": "Graph", + "name": "53", + "node_position": { + "x": 0, + "y": 0 + }, + "nodes": [ + { + "name": "Material", + "node_position": { + "x": 1596.135986, + "y": -86.800011 + }, + "parameters": { + "albedo_color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "ao_light_affect": 1, + "depth_scale": 0.3, + "emission_energy": 1, + "metallic": 1, + "normal_scale": 1, + "roughness": 1, + "size": 11, + "subsurf_scatter_strength": 0 + }, + "type": "material" + }, + { + "name": "raymarching", + "node_position": { + "x": -93.107498, + "y": 112.625015 + }, + "parameters": { + + }, + "shader_model": { + "code": "vec2 $(name_uv)_d = raymarch_$name($uv);\n", + "global": "", + "inputs": [ + { + "default": "0.0", + "function": true, + "label": "", + "name": "sdf", + "type": "sdf3dc" + } + ], + "instance": "vec2 raymarch_$name(vec2 uv) {\n\tvec3 ro = vec3(uv-vec2(0.5), 1.0);\n\tvec3 rd = vec3(0.0, 0.0, -1.0);\n\tfloat dO = 0.0;\n\tfloat c = 0.0;\n for (int i=0; i < 100; i++) {\n \tvec3 p = ro + rd*dO;\n vec2 dS = $sdf(p);\n dO += dS.x;\n\n if (dO >= 1.0) {\n\t\t\tbreak;\n\t\t} else if (dS.x < 0.0001) {\n\t\t\tc = dS.y;\n\t\t\tbreak;\n\t\t}\n }\n \n return vec2(dO, c);\n}\n\nvec3 normal_$name(vec3 p) {\n\tif (p.z <= 0.0) {\n\t\treturn vec3(0.0, 0.0, 1.0);\n\t}\n\n\tfloat d = $sdf(p).x;\n float e = .001;\n \n vec3 n = d - vec3(\n $sdf(p-vec3(e, 0.0, 0.0)).x,\n $sdf(p-vec3(0.0, e, 0.0)).x,\n $sdf(p-vec3(0.0, 0.0, e)).x);\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n", + "name": "Raymarching", + "outputs": [ + { + "f": "1.0-$(name_uv)_d.x", + "type": "f" + }, + { + "rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d.x))", + "type": "rgb" + }, + { + "f": "$(name_uv)_d.y", + "type": "f" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "connections": [ + { + "from": "sdf3d_translate_3_2_2", + "from_port": 0, + "to": "sdf3d_rounded_2", + "to_port": 0 + }, + { + "from": "sdf3d_rounded_2_2", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 0 + }, + { + "from": "sdf3d_rounded_2", + "from_port": 0, + "to": "sdf3d_boolean", + "to_port": 1 + }, + { + "from": "sdf3d_torus", + "from_port": 0, + "to": "sdf3d_rounded_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_torus_2", + "from_port": 0, + "to": "sdf3d_translate_3_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_capsule", + "from_port": 0, + "to": "sdf3d_repeat", + "to_port": 0 + }, + { + "from": "sdf3d_repeat", + "from_port": 0, + "to": "sdf3d_boolean_2", + "to_port": 0 + }, + { + "from": "sdf3d_translate_3_2_2_2", + "from_port": 0, + "to": "sdf3d_boolean_2", + "to_port": 1 + }, + { + "from": "sdf3d_torus_2", + "from_port": 0, + "to": "sdf3d_translate_3_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_boolean_2", + "from_port": 0, + "to": "sdf3d_rounded_2_3", + "to_port": 0 + }, + { + "from": "sdf3d_rounded_2_3", + "from_port": 0, + "to": "sdf3d_boolean_3", + "to_port": 1 + }, + { + "from": "sdf3d_boolean", + "from_port": 0, + "to": "sdf3d_boolean_3", + "to_port": 0 + }, + { + "from": "sdf3d_boolean_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Donut", + "name": "graph", + "node_position": { + "x": -664.759155, + "y": -18.094296 + }, + "nodes": [ + { + "name": "sdf3d_rounded_2_3", + "node_position": { + "x": -552.595459, + "y": 249.420105 + }, + "parameters": { + "bevel": 0, + "c": 0.31, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Color", + "outputs": [ + { + "sdf3dc": "vec2($in($uv), $c)", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "c", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_boolean_2", + "node_position": { + "x": -557.354126, + "y": 320.541656 + }, + "parameters": { + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 2, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "vec2 sdf3dc_union(vec2 a, vec2 b) {\n\treturn vec2(min(a.x, b.x), mix(b.y, a.y, step(a.x, b.x)));\n}\nvec2 sdf3dc_sub(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, -b.x), a.y);\n}\nvec2 sdf3dc_inter(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, b.x), mix(a.y, b.y, step(a.x, b.x)));\n}\n", + "inputs": [ + { + "default": "vec2(0.0)", + "label": "", + "name": "in1", + "type": "sdf3dc" + }, + { + "default": "vec2(0.0)", + "label": "", + "name": "in2", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Boolean", + "outputs": [ + { + "sdf3dc": "$op($in1($uv), $in2($uv))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "default": 2, + "label": "", + "name": "op", + "type": "enum", + "values": [ + { + "name": "Union", + "value": "sdf3dc_union" + }, + { + "name": "Subtraction", + "value": "sdf3dc_sub" + }, + { + "name": "Intersection", + "value": "sdf3dc_inter" + } + ] + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_translate_3_2_2_2", + "node_position": { + "x": -768.354126, + "y": 429.041656 + }, + "parameters": { + "x": 0, + "y": 0, + "z": 0.05 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_repeat", + "node_position": { + "x": -768.854126, + "y": 276.291656 + }, + "parameters": { + "a": 0, + "r": 0.51, + "rx": 16, + "ry": 16, + "rz": 16, + "s": 0.3, + "x": 0.35, + "y": 0, + "z": 0 + }, + "shader_model": { + "code": "", + "global": "vec3 sdf3d_repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 i = floor(p/r+0.5);\n\tvec3 a = rand3(i.xy+i.yz+vec2(seed))*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\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": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Repeat", + "outputs": [ + { + "sdf3dc": "$in(sdf3d_repeat($uv, vec3(1.0/$rx, 1.0/$ry, 1.0/$rz), $seed, $r))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 4, + "label": "X", + "max": 32, + "min": 1, + "name": "rx", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Y", + "max": 32, + "min": 1, + "name": "ry", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 1, + "label": "Z", + "max": 32, + "min": 1, + "name": "rz", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "R", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_capsule", + "node_position": { + "x": -786.854126, + "y": 197.291656 + }, + "parameters": { + "l": 0.02, + "r": 0.01, + "sx": 0.25, + "sy": 0.25, + "sz": 0.5 + }, + "type": "sdf3d_capsule" + }, + { + "name": "sdf3d_torus_2", + "node_position": { + "x": -768.354126, + "y": -82.208344 + }, + "parameters": { + "R": 0.3, + "r": 0.14, + "sx": 0.1, + "sy": 0.1, + "sz": 0.02 + }, + "type": "sdf3d_torus" + }, + { + "name": "sdf3d_torus", + "node_position": { + "x": -759.854126, + "y": -236.708344 + }, + "parameters": { + "R": 0.3, + "r": 0.15, + "sx": 0.1, + "sy": 0.1, + "sz": 0.02 + }, + "type": "sdf3d_torus" + }, + { + "name": "sdf3d_boolean", + "node_position": { + "x": -521.333313, + "y": -3.083344 + }, + "parameters": { + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "vec2 sdf3dc_union(vec2 a, vec2 b) {\n\treturn vec2(min(a.x, b.x), mix(b.y, a.y, step(a.x, b.x)));\n}\nvec2 sdf3dc_sub(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, -b.x), a.y);\n}\nvec2 sdf3dc_inter(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, b.x), mix(a.y, b.y, step(a.x, b.x)));\n}\n", + "inputs": [ + { + "default": "vec2(0.0)", + "label": "", + "name": "in1", + "type": "sdf3dc" + }, + { + "default": "vec2(0.0)", + "label": "", + "name": "in2", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Boolean", + "outputs": [ + { + "sdf3dc": "$op($in1($uv), $in2($uv))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "default": 2, + "label": "", + "name": "op", + "type": "enum", + "values": [ + { + "name": "Union", + "value": "sdf3dc_union" + }, + { + "name": "Subtraction", + "value": "sdf3dc_sub" + }, + { + "name": "Intersection", + "value": "sdf3dc_inter" + } + ] + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_rounded_2_2", + "node_position": { + "x": -751.833313, + "y": -156.583344 + }, + "parameters": { + "bevel": 0, + "c": 0.08, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Color", + "outputs": [ + { + "sdf3dc": "vec2($in($uv), $c)", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "c", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_translate_3_2_2", + "node_position": { + "x": -774.833313, + "y": 16.666656 + }, + "parameters": { + "x": 0, + "y": 0, + "z": 0.03 + }, + "type": "sdf3d_translate" + }, + { + "name": "sdf3d_rounded_2", + "node_position": { + "x": -763.333313, + "y": 130.166656 + }, + "parameters": { + "bevel": 0, + "c": 0.87, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.15, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Color", + "outputs": [ + { + "sdf3dc": "vec2($in($uv), $c)", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "c", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_boolean_3", + "node_position": { + "x": -526.595459, + "y": 127.920105 + }, + "parameters": { + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "vec2 sdf3dc_union(vec2 a, vec2 b) {\n\treturn vec2(min(a.x, b.x), mix(b.y, a.y, step(a.x, b.x)));\n}\nvec2 sdf3dc_sub(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, -b.x), a.y);\n}\nvec2 sdf3dc_inter(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, b.x), mix(a.y, b.y, step(a.x, b.x)));\n}\n", + "inputs": [ + { + "default": "vec2(0.0)", + "label": "", + "name": "in1", + "type": "sdf3dc" + }, + { + "default": "vec2(0.0)", + "label": "", + "name": "in2", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Boolean", + "outputs": [ + { + "sdf3dc": "$op($in1($uv), $in2($uv))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "default": 2, + "label": "", + "name": "op", + "type": "enum", + "values": [ + { + "name": "Union", + "value": "sdf3dc_union" + }, + { + "name": "Subtraction", + "value": "sdf3dc_sub" + }, + { + "name": "Intersection", + "value": "sdf3dc_inter" + } + ] + } + ] + }, + "type": "shader" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1086.854126, + "y": 105.729713 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -221.333313, + "y": 105.729713 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "sdf3dc" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -891.679138, + "y": -536.708374 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + } + ], + "parameters": { + + }, + "type": "graph" + }, + { + "name": "sdf3d_repeat", + "node_position": { + "x": -482.202179, + "y": -14.881774 + }, + "parameters": { + "a": 0, + "r": 0.2, + "rx": 3, + "ry": 3, + "s": 0.3, + "x": 0.35, + "y": 0, + "z": 0 + }, + "shader_model": { + "code": "", + "global": "vec3 repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 a = (rand3(floor(mod((p.xy+0.5*r.xy)/r.xy, 1.0/r.xy)+vec2(seed)))-0.5)*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\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": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Repeat", + "outputs": [ + { + "sdf3dc": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 4, + "label": "X", + "max": 32, + "min": 1, + "name": "rx", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Y", + "max": 32, + "min": 1, + "name": "ry", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "R", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_scale_2", + "node_position": { + "x": -670.842224, + "y": 66.030228 + }, + "parameters": { + "a": 0, + "s": 0.37, + "x": 0.35, + "y": 0, + "z": 0 + }, + "shader_model": { + "code": "vec2 $(name_uv)_in = $in(($uv)/$s);", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Scale", + "outputs": [ + { + "sdf3dc": "vec2($(name_uv)_in.x*$s, $(name_uv)_in.y)", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "Scale1.x", + "default": 1, + "label": "", + "max": 5, + "min": 0, + "name": "s", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_repeat_2", + "node_position": { + "x": -480.202179, + "y": 110.618225 + }, + "parameters": { + "a": 0, + "r": 0.21, + "rx": 3, + "ry": 3, + "s": 0.3, + "x": 0.35, + "y": 0, + "z": 0 + }, + "shader_model": { + "code": "", + "global": "vec3 repeat(vec3 p, vec3 r, float seed, float randomness) {\n\tvec3 a = (rand3(floor(mod((p.xy+0.5*r.xy)/r.xy, 1.0/r.xy)+vec2(seed)))-0.5)*6.28*randomness;\n\tp = mod(p+0.5*r,r)-0.5*r;\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": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Repeat", + "outputs": [ + { + "sdf3dc": "$in(repeat($uv, vec3(1.0/$rx, 1.0/$ry, 0.0), $seed, $r))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "None", + "default": 4, + "label": "X", + "max": 32, + "min": 1, + "name": "rx", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 4, + "label": "Y", + "max": 32, + "min": 1, + "name": "ry", + "step": 1, + "type": "float" + }, + { + "control": "None", + "default": 0.5, + "label": "R", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_translate_3_2_2", + "node_position": { + "x": -479.952209, + "y": 213.034912 + }, + "parameters": { + "x": 0.14, + "y": 0.11, + "z": 0.2 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Translate", + "outputs": [ + { + "sdf3dc": "$in($uv-vec3($x, $y, $z))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "P1.x", + "default": 0, + "label": "X", + "max": 1, + "min": -1, + "name": "x", + "step": 0.01, + "type": "float" + }, + { + "control": "P1.y", + "default": 0, + "label": "Y", + "max": 1, + "min": -1, + "name": "y", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Z", + "max": 1, + "min": -1, + "name": "z", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_boolean", + "node_position": { + "x": -252.248795, + "y": 76.092621 + }, + "parameters": { + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "vec2 sdf3dc_union(vec2 a, vec2 b) {\n\treturn vec2(min(a.x, b.x), mix(b.y, a.y, step(a.x, b.x)));\n}\nvec2 sdf3dc_sub(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, -b.x), a.y);\n}\nvec2 sdf3dc_inter(vec2 a, vec2 b) {\n\treturn vec2(max(a.x, b.x), mix(a.y, b.y, step(a.x, b.x)));\n}\n", + "inputs": [ + { + "default": "vec2(0.0)", + "label": "", + "name": "in1", + "type": "sdf3dc" + }, + { + "default": "vec2(0.0)", + "label": "", + "name": "in2", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Boolean", + "outputs": [ + { + "sdf3dc": "$op($in1($uv), $in2($uv))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "default": 2, + "label": "", + "name": "op", + "type": "enum", + "values": [ + { + "name": "Union", + "value": "sdf3dc_union" + }, + { + "name": "Subtraction", + "value": "sdf3dc_sub" + }, + { + "name": "Intersection", + "value": "sdf3dc_inter" + } + ] + } + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_translate_3_2_2_2", + "node_position": { + "x": -278.344788, + "y": 149.892624 + }, + "parameters": { + "x": 0, + "y": 0, + "z": 0.1 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf3dc" + } + ], + "instance": "", + "name": "Translate", + "outputs": [ + { + "sdf3dc": "$in($uv-vec3($x, $y, $z))", + "type": "sdf3dc" + } + ], + "parameters": [ + { + "control": "P1.x", + "default": 0, + "label": "X", + "max": 1, + "min": -1, + "name": "x", + "step": 0.01, + "type": "float" + }, + { + "control": "P1.y", + "default": 0, + "label": "Y", + "max": 1, + "min": -1, + "name": "y", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Z", + "max": 1, + "min": -1, + "name": "z", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "color": { + "a": 1, + "b": 1, + "g": 0.0625, + "r": 0, + "type": "Color" + }, + "name": "comment", + "node_position": { + "x": -681.957275, + "y": -50.802036 + }, + "parameters": { + "size": 4 + }, + "size": { + "x": 757.167969, + "y": 382.903992 + }, + "text": "\n", + "title": "Render donuts with color indexes", + "type": "comment" + }, + { + "name": "mwf_create_map", + "node_position": { + "x": 360.571991, + "y": -128.630447 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_create_map_2", + "node_position": { + "x": 369.417175, + "y": 399.369568 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_create_map_3", + "node_position": { + "x": 378.417175, + "y": 137.369568 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_map", + "node_position": { + "x": 652.417175, + "y": -128.630447 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_map_2", + "node_position": { + "x": 647.693909, + "y": 136.369553 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_map_2_2", + "node_position": { + "x": 651.693909, + "y": 406.119568 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "uniform", + "node_position": { + "x": 415.193909, + "y": 217.119568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.165865, + "r": 0.280273, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "mwf_mix", + "node_position": { + "x": 853.900879, + "y": 164.927567 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "name": "mwf_mix_2", + "node_position": { + "x": 1083.009155, + "y": -87.618446 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "connections": [ + { + "from": "colorize_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 6 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "colorize_3", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "gaussian_blur", + "to_port": 0 + }, + { + "from": "gaussian_blur", + "from_port": 0, + "to": "gen_outputs", + "to_port": 5 + }, + { + "from": "gen_inputs", + "from_port": 2, + "to": "decompose", + "to_port": 0 + }, + { + "from": "decompose", + "from_port": 1, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "decompose", + "from_port": 2, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "blend_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 4 + }, + { + "from": "gen_inputs", + "from_port": 1, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 3, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "brightness_contrast", + "from_port": 0, + "to": "blend_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 4, + "to": "brightness_contrast", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "normal_map_2", + "to_port": 0 + }, + { + "from": "normal_map_2", + "from_port": 0, + "to": "blend_2", + "to_port": 1 + } + ], + "label": "Output", + "name": "mwf_output", + "node_position": { + "x": 1307.265137, + "y": -74.206451 + }, + "nodes": [ + { + "name": "colorize_3", + "node_position": { + "x": -939.637451, + "y": 871.842407 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "connections": [ + { + "from": "buffer", + "from_port": 0, + "to": "blurx_convolution", + "to_port": 0 + }, + { + "from": "buffer_2", + "from_port": 0, + "to": "blurx_convolution_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "blurx_convolution", + "from_port": 0, + "to": "buffer_2", + "to_port": 0 + }, + { + "from": "blurx_convolution_2", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "buffer", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Occlusion", + "name": "gaussian_blur", + "node_position": { + "x": -994.845825, + "y": 786.968262 + }, + "nodes": [ + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(x/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 50, + "y": 0 + }, + "name": "blurx_convolution", + "node_position": { + "x": -407.5, + "y": -192.5 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer_2", + "node_position": { + "x": -404.875, + "y": -116.625 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(y/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 0, + "y": 50 + }, + "name": "blurx_convolution_2", + "node_position": { + "x": -407.125, + "y": -44.375 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer", + "node_position": { + "x": -408.25, + "y": -265.75 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -447.666626, + "y": -370.666656 + }, + "parameters": { + "param0": 10, + "param1": 50, + "param2": 4.9 + }, + "type": "remote", + "widgets": [ + { + "label": "Grid size:", + "linked_widgets": [ + { + "node": "buffer", + "widget": "size" + }, + { + "node": "blurx_convolution", + "widget": "size" + }, + { + "node": "buffer_2", + "widget": "size" + }, + { + "node": "blurx_convolution_2", + "widget": "size" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Strength", + "linked_widgets": [ + { + "node": "_2", + "widget": "g" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -585.666626, + "y": -112.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 55.547607, + "y": -133.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "blend", + "node_position": { + "x": -420.79895, + "y": 27.16272 + }, + "parameters": { + "amount": 1, + "blend_type": 11 + }, + "type": "blend" + }, + { + "name": "colorize", + "node_position": { + "x": -167.79895, + "y": -178.83728 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "_2", + "node_position": { + "x": -134.403687, + "y": -110.29187 + }, + "parameters": { + "g": 4.9 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "", + "outputs": [ + { + "f": "pow($in($uv), $g)", + "type": "f" + } + ], + "parameters": [ + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "g", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" + } + ], + "parameters": { + "param0": 10, + "param1": 50, + "param2": 4.9 + }, + "type": "graph" + }, + { + "name": "decompose", + "node_position": { + "x": -924.371338, + "y": 570.25 + }, + "parameters": { + + }, + "type": "decompose" + }, + { + "name": "blend_2", + "node_position": { + "x": -931.305542, + "y": 677.328491 + }, + "parameters": { + "amount": 0, + "blend_type": 4 + }, + "type": "blend" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1336.805542, + "y": 597.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Height", + "type": "f" + }, + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -635.305542, + "y": 597.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "Metallic", + "type": "f" + }, + { + "name": "Roughness", + "type": "f" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + }, + { + "name": "Occlusion", + "type": "f" + }, + { + "name": "Depth", + "type": "f" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -1100.881836, + "y": 438.25 + }, + "parameters": { + "param0": 0, + "param1": 10, + "param2": 4.9 + }, + "type": "remote", + "widgets": [ + { + "label": "Occlusion", + "linked_widgets": [ + { + "node": "gaussian_blur", + "widget": "param2" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Mat Normal", + "linked_widgets": [ + { + "node": "blend_2", + "widget": "amount" + } + ], + "name": "param0", + "type": "linked_control" + } + ] + }, + { + "name": "brightness_contrast", + "node_position": { + "x": -1177.223877, + "y": 677.062317 + }, + "parameters": { + "brightness": 0, + "contrast": 1, + "steps": 6 + }, + "type": "brightness_contrast" + }, + { + "name": "normal_map_2", + "node_position": { + "x": -1152.5, + "y": 544.75 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 1.02, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 + }, + "type": "normal_map" + } + ], + "parameters": { + "param0": 0, + "param1": 10, + "param2": 4.9 + }, + "type": "graph" + }, + { + "name": "uniform_2", + "node_position": { + "x": 415.732727, + "y": 272.369568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.105882, + "r": 1, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_2_2", + "node_position": { + "x": 408.002197, + "y": 17.994553 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 1, + "r": 1, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_3", + "node_position": { + "x": 407.463379, + "y": -37.255447 + }, + "parameters": { + "color": { + "a": 1, + "b": 0.914063, + "g": 0, + "r": 1, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_2_3_2", + "node_position": { + "x": 413.800964, + "y": 708.119568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.886275, + "r": 1, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "mwf_mix_3", + "node_position": { + "x": 845.760559, + "y": -242.048431 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": 398.856934, + "y": -337.380432 + }, + "parameters": { + "color": 0.05 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_4", + "node_position": { + "x": 400.856934, + "y": -273.880432 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 0.415686, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_4_2", + "node_position": { + "x": 399.718628, + "y": -217.130432 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 1, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "perlin", + "node_position": { + "x": 363.92984, + "y": 499.119568 + }, + "parameters": { + "iterations": 8, + "persistence": 0.95, + "scale_x": 4, + "scale_y": 4 + }, + "type": "perlin" + }, + { + "name": "colorize", + "node_position": { + "x": 378.92981, + "y": 637.119568 + }, + "parameters": { + "gradient": { + "interpolation": 0, + "points": [ + { + "a": 1, + "b": 0.240099, + "g": 0.613979, + "pos": 0, + "r": 0.869792 + }, + { + "a": 1, + "b": 0.233941, + "g": 0.553521, + "pos": 1, + "r": 0.802083 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "color": { + "a": 1, + "b": 0, + "g": 1, + "r": 0.9375, + "type": "Color" + }, + "name": "comment_2", + "node_position": { + "x": 82.468719, + "y": -50.148132 + }, + "parameters": { + "size": 4 + }, + "size": { + "x": 255.271576, + "y": 432.232056 + }, + "text": "", + "title": "Separate colors", + "type": "comment" + }, + { + "color": { + "a": 1, + "b": 0, + "g": 1, + "r": 0.09375, + "type": "Color" + }, + "name": "comment_2_2", + "node_position": { + "x": 346.962891, + "y": -373.398132 + }, + "parameters": { + "size": 4 + }, + "size": { + "x": 464, + "y": 1149 + }, + "text": "", + "title": "Create maps and materials and combine them", + "type": "comment" + }, + { + "color": { + "a": 1, + "b": 1, + "g": 0, + "r": 0.96875, + "type": "Color" + }, + "name": "comment_2_2_2", + "node_position": { + "x": 828.579407, + "y": -289.750183 + }, + "parameters": { + "size": 4 + }, + "size": { + "x": 743.688171, + "y": 725.975952 + }, + "text": "", + "title": "Mix the result and generate output", + "type": "comment" + }, + { + "name": "mul_detect", + "node_position": { + "x": 90.234436, + "y": -13.032837 + }, + "parameters": { + "t": 0.01, + "v": 0.31 + }, + "type": "mul_detect" + }, + { + "name": "mul_detect_2", + "node_position": { + "x": 94.964081, + "y": 132.26152 + }, + "parameters": { + "t": 0.01, + "v": 0.87 + }, + "type": "mul_detect" + }, + { + "name": "mul_detect_2_2", + "node_position": { + "x": 90.964081, + "y": 288.261536 + }, + "parameters": { + "t": 0.01, + "v": 0.08 + }, + "type": "mul_detect" + } + ], + "parameters": { + + }, + "type": "graph" +} \ No newline at end of file diff --git a/material_maker/examples/mmm_donuts.ptex.import b/material_maker/examples/mmm_donuts.ptex.import new file mode 100644 index 0000000..7e340d3 --- /dev/null +++ b/material_maker/examples/mmm_donuts.ptex.import @@ -0,0 +1,15 @@ +[remap] + +importer="material_maker.import" +type="SpatialMaterial" +path="res://.import/mmm_donuts.ptex-d9714f6116f301de983c7748e4d0cb0d.tres" + +[deps] + +source_file="res://material_maker/examples/mmm_donuts.ptex" +dest_files=[ "res://.import/mmm_donuts.ptex-d9714f6116f301de983c7748e4d0cb0d.tres" ] + +[params] + +render=false +scale=1.0 diff --git a/material_maker/examples/mosaic.ptex b/material_maker/examples/mosaic.ptex index 350cde4..37f8ed9 100644 --- a/material_maker/examples/mosaic.ptex +++ b/material_maker/examples/mosaic.ptex @@ -78,7 +78,9 @@ "intensity": 1, "randomness": 1, "scale_x": 32, - "scale_y": 32 + "scale_y": 32, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -92,6 +94,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 5 }, "type": "normal_map" @@ -117,7 +122,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -129,6 +135,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -158,6 +165,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -204,6 +212,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/paper.ptex b/material_maker/examples/paper.ptex index e8dca8f..19a7e53 100644 --- a/material_maker/examples/paper.ptex +++ b/material_maker/examples/paper.ptex @@ -95,7 +95,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -137,6 +138,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -166,6 +168,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -235,6 +238,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -297,6 +301,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/pentagram.ptex b/material_maker/examples/pentagram.ptex index 6f4ace7..b6b81a8 100644 --- a/material_maker/examples/pentagram.ptex +++ b/material_maker/examples/pentagram.ptex @@ -58,7 +58,8 @@ "metallic": 1, "normal_scale": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -84,6 +85,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -132,6 +134,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -313,6 +316,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -368,6 +372,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -507,6 +512,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/planet.ptex b/material_maker/examples/planet.ptex index 635dc48..a52e9a7 100644 --- a/material_maker/examples/planet.ptex +++ b/material_maker/examples/planet.ptex @@ -94,7 +94,8 @@ "metallic": 0.05, "normal_scale": 1, "roughness": 0.75, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -120,6 +121,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -177,6 +179,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -206,6 +209,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -237,6 +241,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -264,6 +271,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -305,6 +313,13 @@ "type": "blend" }, { + "color": { + "a": 1, + "b": 0, + "g": 0.5, + "r": 1, + "type": "Color" + }, "name": "comment", "node_position": { "x": -544.5, @@ -318,6 +333,7 @@ "y": 67 }, "text": "Best viewed on Sphere mesh", + "title": "Comment", "type": "comment" } ], diff --git a/material_maker/examples/radiation.ptex b/material_maker/examples/radiation.ptex index fd00a18..c9a3768 100644 --- a/material_maker/examples/radiation.ptex +++ b/material_maker/examples/radiation.ptex @@ -151,7 +151,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -203,6 +204,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/rock.ptex b/material_maker/examples/rock.ptex index 79a3361..3c5bab2 100644 --- a/material_maker/examples/rock.ptex +++ b/material_maker/examples/rock.ptex @@ -96,6 +96,9 @@ "amount": 0.5, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 2 }, "type": "normal_map" @@ -108,6 +111,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -137,6 +141,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -180,6 +185,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -239,7 +245,9 @@ "intensity": 0.85, "randomness": 1, "scale_x": 4, - "scale_y": 4 + "scale_y": 4, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -264,7 +272,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -291,7 +300,9 @@ "intensity": 1, "randomness": 1, "scale_x": 4, - "scale_y": 4 + "scale_y": 4, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, diff --git a/material_maker/examples/rusted_metal.ptex b/material_maker/examples/rusted_metal.ptex index 38d30c6..d60c79d 100644 --- a/material_maker/examples/rusted_metal.ptex +++ b/material_maker/examples/rusted_metal.ptex @@ -148,6 +148,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -177,6 +178,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -206,6 +208,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -235,6 +238,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -264,6 +268,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -306,7 +311,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, diff --git a/material_maker/examples/skulls.ptex b/material_maker/examples/skulls.ptex index 9e92938..424f826 100644 --- a/material_maker/examples/skulls.ptex +++ b/material_maker/examples/skulls.ptex @@ -138,12 +138,6 @@ "to": "sdf3d_boolean_2_2_2", "to_port": 1 }, - { - "from": "sdf3d_boolean_2_2_2", - "from_port": 0, - "to": "_3_2", - "to_port": 0 - }, { "from": "blend_2", "from_port": 0, @@ -156,12 +150,6 @@ "to": "normal_map", "to_port": 0 }, - { - "from": "_3_2", - "from_port": 1, - "to": "blend_2", - "to_port": 0 - }, { "from": "normal_map", "from_port": 0, @@ -180,12 +168,6 @@ "to": "sdf3d_scale", "to_port": 0 }, - { - "from": "_3_2", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, { "from": "buffer", "from_port": 0, @@ -233,6 +215,24 @@ "from_port": 0, "to": "blend", "to_port": 2 + }, + { + "from": "sdf3d_boolean_2_2_2", + "from_port": 0, + "to": "raymarching", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "raymarching", + "from_port": 1, + "to": "blend_2", + "to_port": 0 } ], "label": "Graph", @@ -311,45 +311,6 @@ }, "type": "colorize" }, - { - "name": "_3_2", - "node_position": { - "x": -378.336426, - "y": 1476.947388 - }, - "parameters": { - - }, - "shader_model": { - "code": "float $(name_uv)_d = raymarch_$name($uv);\n", - "global": "", - "inputs": [ - { - "default": "0.0", - "function": true, - "label": "", - "name": "sdf", - "type": "sdf3d" - } - ], - "instance": "float input_$name(vec3 p) {\n\treturn min($sdf(p), p.z);\n}\n\nfloat raymarch_$name(vec2 uv) {\n\tvec3 ro = vec3(uv-vec2(0.5), 1.0);\n\tvec3 rd = vec3(0.0, 0.0, -1.0);\n\tfloat dO=0.;\n \n for (int i=0; i < 50; i++) {\n \tvec3 p = ro + rd*dO;\n float dS = input_$name(p);\n dO += dS;\n if (dO > 0.001 && dS < 0.0001) break;\n }\n \n return dO;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = input_$name(p);\n float e = .001;\n \n vec3 n = d - vec3(\n input_$name(p-vec3(e, 0.0, 0.0)),\n input_$name(p-vec3(0.0, e, 0.0)),\n input_$name(p-vec3(0.0, 0.0, e)));\n \n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\n", - "name": "Raymarching", - "outputs": [ - { - "f": "1.0-$(name_uv)_d", - "type": "f" - }, - { - "rgb": "vec3(0.5)+0.5*normal_$name(vec3($uv-vec2(0.5), 1.0-$(name_uv)_d))", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, { "name": "colorize_2", "node_position": { @@ -1108,6 +1069,8 @@ "param0": 11, "param1": 1.02, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -2007,6 +1970,17 @@ "blend_type": 3 }, "type": "blend" + }, + { + "name": "raymarching", + "node_position": { + "x": -371.992065, + "y": 1466.176514 + }, + "parameters": { + + }, + "type": "raymarching" } ], "parameters": { diff --git a/material_maker/examples/splatter.ptex b/material_maker/examples/splatter.ptex index ce480ad..94a52ae 100644 --- a/material_maker/examples/splatter.ptex +++ b/material_maker/examples/splatter.ptex @@ -238,9 +238,7 @@ "y": -404 }, "parameters": { - "param0": 6, - "param1": 0, - "param2": 0 + "param0": 0 }, "type": "remote", "widgets": [ @@ -328,6 +326,8 @@ "param0": 12, "param1": 1.02, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" diff --git a/material_maker/examples/stone_wall.ptex b/material_maker/examples/stone_wall.ptex index b6a9a41..315036c 100644 --- a/material_maker/examples/stone_wall.ptex +++ b/material_maker/examples/stone_wall.ptex @@ -168,7 +168,9 @@ "intensity": 1, "randomness": 1, "scale_x": 8, - "scale_y": 8 + "scale_y": 8, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -180,6 +182,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -209,6 +212,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -252,6 +256,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -335,6 +340,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -364,6 +370,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -435,7 +442,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -465,6 +473,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -494,6 +503,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -525,6 +535,9 @@ "amount": 0.5, "param0": 11, "param1": 0.79, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -563,9 +576,11 @@ "parameters": { "bevel": 0.15, "columns": 3, + "corner": 0, "mortar": 0.05, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 6 }, diff --git a/material_maker/examples/tiles.ptex b/material_maker/examples/tiles.ptex index 607d9ca..85f4084 100644 --- a/material_maker/examples/tiles.ptex +++ b/material_maker/examples/tiles.ptex @@ -130,7 +130,8 @@ "metallic": 1, "normal_scale": 2.15, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -228,9 +229,11 @@ "parameters": { "bevel": 0, "columns": 8, + "corner": 0, "mortar": 0.1, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0, "rows": 8 }, @@ -284,6 +287,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -315,6 +319,9 @@ "amount": 0.5, "param0": 11, "param1": 0.69, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -327,6 +334,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/wood.ptex b/material_maker/examples/wood.ptex index 396cb0c..988563b 100644 --- a/material_maker/examples/wood.ptex +++ b/material_maker/examples/wood.ptex @@ -167,6 +167,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -211,7 +212,9 @@ "intensity": 1, "randomness": 1, "scale_x": 5, - "scale_y": 4 + "scale_y": 4, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -266,7 +269,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -278,6 +282,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -309,6 +314,9 @@ "amount": 0.1, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 5 }, "type": "normal_map" @@ -321,6 +329,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/wood_with_blood.ptex b/material_maker/examples/wood_with_blood.ptex index 169445a..b428410 100644 --- a/material_maker/examples/wood_with_blood.ptex +++ b/material_maker/examples/wood_with_blood.ptex @@ -137,7 +137,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -149,6 +150,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -179,9 +181,11 @@ "parameters": { "bevel": 0.007813, "columns": 5, + "corner": 0, "mortar": 0.025469, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 1 }, @@ -195,6 +199,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -308,6 +313,9 @@ "amount": 0.15, "param0": 11, "param1": 0.99, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -378,6 +386,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -428,6 +437,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, diff --git a/material_maker/examples/wooden_floor.ptex b/material_maker/examples/wooden_floor.ptex index 5c0d115..059979d 100644 --- a/material_maker/examples/wooden_floor.ptex +++ b/material_maker/examples/wooden_floor.ptex @@ -100,6 +100,7 @@ }, "parameters": { "gradient": { + "interpolation": 1, "points": [ { "a": 1, @@ -131,6 +132,9 @@ "amount": 0.3, "param0": 11, "param1": 0.2, + "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "normal_map" @@ -173,7 +177,8 @@ "normal_scale": 1, "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, @@ -229,9 +234,11 @@ "parameters": { "bevel": 0, "columns": 1, + "corner": 0, "mortar": 0.02, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 10 }, diff --git a/material_maker/graph_edit.gd b/material_maker/graph_edit.gd index 7b3e954..456569a 100644 --- a/material_maker/graph_edit.gd +++ b/material_maker/graph_edit.gd @@ -25,15 +25,20 @@ signal graph_changed func _ready() -> void: OS.low_processor_usage_mode = true center_view() - for t in range(5): + for t in range(41): add_valid_connection_type(t, 42) add_valid_connection_type(42, t) func _gui_input(event) -> void: if event is InputEventKey and event.pressed: var scancode_with_modifiers = event.get_scancode_with_modifiers() - if scancode_with_modifiers == KEY_DELETE || scancode_with_modifiers == KEY_BACKSPACE: + if scancode_with_modifiers == KEY_DELETE or scancode_with_modifiers == KEY_BACKSPACE: remove_selection() + return + if event is InputEventMouseMotion and event.button_mask == 0: + for c in get_children(): + if c is GraphNode and Rect2(c.rect_global_position, c.rect_size*c.get_global_transform().get_scale()).has_point(event.global_position): + hint_tooltip = c.get_slot_tooltip(c.get_global_transform().xform_inv(event.global_position)) # Misc. useful functions func get_source(node, port) -> Dictionary: @@ -51,7 +56,9 @@ func add_node(node) -> void: node.connect("close_request", self, "remove_node", [ node ]) func connect_node(from, from_slot, to, to_slot): - if generator.connect_children(get_node(from).generator, from_slot, get_node(to).generator, to_slot): + var from_node : MMGraphNodeBase = get_node(from) + var to_node : MMGraphNodeBase = get_node(to) + if generator.connect_children(from_node.generator, from_slot, to_node.generator, to_slot): var disconnect = get_source(to, to_slot) if !disconnect.empty(): .disconnect_node(disconnect.node, disconnect.slot, to, to_slot) @@ -171,8 +178,7 @@ func update_graph(generators, connections) -> Array: func new_material() -> void: clear_material() - var loader = MMGenLoader.new() - top_generator = loader.create_gen({nodes=[{name="Material", type="material","parameters":{"size":11}}], connections=[]}) + top_generator = mm_loader.create_gen({nodes=[{name="Material", type="material","parameters":{"size":11}}], connections=[]}) if top_generator != null: add_child(top_generator) move_child(top_generator, 0) @@ -191,12 +197,12 @@ func get_free_name(type) -> String: return "" func create_nodes(data, position : Vector2 = Vector2(0, 0)) -> Array: - if data == null: + if !data is Dictionary: return [] if data.has("type"): data = { nodes=[data], connections=[] } - if typeof(data.nodes) == TYPE_ARRAY and typeof(data.connections) == TYPE_ARRAY: - var new_stuff = MMGenLoader.add_to_gen_graph(generator, data.nodes, data.connections) + if data.has("nodes") and typeof(data.nodes) == TYPE_ARRAY and data.has("connections") and typeof(data.connections) == TYPE_ARRAY: + var new_stuff = mm_loader.add_to_gen_graph(generator, data.nodes, data.connections) for g in new_stuff.generators: g.position += position return update_graph(new_stuff.generators, new_stuff.connections) @@ -207,7 +213,7 @@ func create_gen_from_type(gen_name) -> void: func load_file(filename) -> void: clear_material() - top_generator = MMGenLoader.load_gen(filename) + top_generator = mm_loader.load_gen(filename) if top_generator != null: add_child(top_generator) move_child(top_generator, 0) @@ -289,25 +295,23 @@ func cut() -> void: func copy() -> void: OS.clipboard = to_json(serialize_selection()) -func paste(pos = Vector2(0, 0)) -> void: +func do_paste(data) -> void: + var position = scroll_offset+0.5*rect_size + if Rect2(Vector2(0, 0), rect_size).has_point(get_local_mouse_position()): + position = offset_from_global_position(get_global_transform().xform(get_local_mouse_position())) for c in get_children(): if c is GraphNode: c.selected = false - var data = parse_json(OS.clipboard) - var new_nodes = create_nodes(data, scroll_offset+0.5*rect_size) + var new_nodes = create_nodes(data, position) if new_nodes != null: for c in new_nodes: c.selected = true +func paste() -> void: + do_paste(parse_json(OS.clipboard)) + func duplicate_selected() -> void: - var data = serialize_selection() - for c in get_children(): - if c is GraphNode: - c.selected = false - var new_nodes = create_nodes(data, scroll_offset+0.5*rect_size) - if new_nodes != null: - for c in new_nodes: - c.selected = true + do_paste(serialize_selection()) # Delay after graph update @@ -349,8 +353,8 @@ func create_subgraph() -> void: func _on_ButtonShowTree_pressed() -> void: var graph_tree : Popup = preload("res://material_maker/widgets/graph_tree/graph_tree.tscn").instance() - graph_tree.init("Top", top_generator) add_child(graph_tree) + graph_tree.init("Top", top_generator) graph_tree.connect("item_double_clicked", self, "edit_subgraph") graph_tree.popup_centered() diff --git a/material_maker/graph_edit.tscn b/material_maker/graph_edit.tscn index eaf6359..db7c975 100644 --- a/material_maker/graph_edit.tscn +++ b/material_maker/graph_edit.tscn @@ -80,10 +80,12 @@ hint_tooltip = "Show hierarchy" icon = SubResource( 4 ) [connection signal="connection_request" from="." to="." method="connect_node"] [connection signal="connection_to_empty" from="." to="." method="request_popup"] +[connection signal="copy_nodes_request" from="." to="." method="copy"] [connection signal="disconnection_request" from="." to="." method="disconnect_node"] [connection signal="duplicate_nodes_request" from="." to="." method="duplicate_selected"] [connection signal="gui_input" from="." to="." method="_on_GraphEdit_gui_input"] [connection signal="node_selected" from="." to="." method="_on_GraphEdit_node_selected"] +[connection signal="paste_nodes_request" from="." to="." method="paste"] [connection signal="timeout" from="Timer" to="." method="do_send_changed_signal"] [connection signal="text_changed" from="GraphUI/SubGraphUI/Label" to="." method="_on_Label_text_changed"] [connection signal="toggled" from="GraphUI/SubGraphUI/ButtonTransmitsSeed" to="." method="_on_ButtonTransmitsSeed_toggled"] diff --git a/material_maker/icons/icons.svg b/material_maker/icons/icons.svg index 49ef1a4..a43e0c6 100644 --- a/material_maker/icons/icons.svg +++ b/material_maker/icons/icons.svg @@ -15,16 +15,16 @@ viewBox="0 0 128 128" version="1.1" id="svg8" - inkscape:version="0.92.4 (5da689c313, 2019-01-14)" + inkscape:version="0.92.3 (2405546, 2018-03-11)" sodipodi:docname="icons.svg"> + d="m 97.777926,255.06351 v 18.88926 l 11.825354,-10.75878 v -13.55872 z" + points="97.777926,273.95277 109.60328,263.19399 109.60328,249.63527 97.777926,255.06351 " /> + d="m 97.777926,273.95277 21.760764,4.75713 6.41132,-13.64857 -16.34673,-1.86734 z" + points="119.53869,278.7099 125.95001,265.06133 109.60328,263.19399 97.777926,273.95277 " /> + d="m 109.60328,249.63527 16.34673,0.13365 v 15.29241 l -16.34673,-1.86734 z" + points="125.95001,249.76892 125.95001,265.06133 109.60328,263.19399 109.60328,249.63527 " /> + d="m 97.777926,255.06351 21.760764,1.21418 6.41132,-6.50877 -16.34673,-0.13365 z" + points="119.53869,256.27769 125.95001,249.76892 109.60328,249.63527 97.777926,255.06351 " /> + d="m 119.53869,256.27769 v 22.43221 l 6.41132,-13.64857 v -15.29241 z" + points="119.53869,278.7099 125.95001,265.06133 125.95001,249.76892 119.53869,256.27769 " /> + d="m 97.777926,255.06351 21.760764,1.21418 v 22.43221 l -21.760764,-4.75713 z" + points="119.53869,256.27769 119.53869,278.7099 97.777926,273.95277 97.777926,255.06351 " /> + + + + + + + + + + diff --git a/material_maker/library.gd b/material_maker/library.gd index 148f2f6..446c4fa 100644 --- a/material_maker/library.gd +++ b/material_maker/library.gd @@ -170,3 +170,34 @@ func export_libraries(path : String) -> void: if file.open(path, File.WRITE) == OK: file.store_string(JSON.print({lib=array}, "\t", true)) file.close() + + +func generate_screenshots(graph_edit, item : TreeItem = null) -> int: + var count : int = 0 + if item == null: + item = tree.get_root() + item = item.get_children() + while item != null: + if item.get_metadata(0) != null: + var timer : Timer = Timer.new() + add_child(timer) + var new_nodes = graph_edit.create_nodes(item.get_metadata(0)) + timer.wait_time = 0.05 + timer.one_shot = true + timer.start() + yield(timer, "timeout") + var image = get_viewport().get_texture().get_data() + image.flip_y() + image = image.get_rect(Rect2(new_nodes[0].rect_global_position-Vector2(1, 2), new_nodes[0].rect_size+Vector2(4, 4))) + print(get_icon_name(get_item_path(item))) + image.save_png("res://material_maker/doc/images/node_"+get_icon_name(get_item_path(item))+".png") + for n in new_nodes: + graph_edit.remove_node(n) + remove_child(timer) + count += 1 + var result = generate_screenshots(graph_edit, item) + while result is GDScriptFunctionState: + result = yield(result, "completed") + count += result + item = item.get_next() + return count diff --git a/material_maker/library/base.json b/material_maker/library/base.json index db21c49..7ccac54 100644 --- a/material_maker/library/base.json +++ b/material_maker/library/base.json @@ -962,6 +962,16 @@ "tree_item": "3D/SDF/Render", "type": "raymarching" }, + { + "collapsed": true, + "icon": "3d_sdf_color", + "name": "sdf3d_color", + "parameters": { + "c": 0.5 + }, + "tree_item": "3D/SDF/Color", + "type": "sdf3d_color" + }, { "collapsed": false, "tree_item": "3D/SDF/Shapes" @@ -1099,6 +1109,18 @@ "tree_item": "3D/SDF/Operators/Rounded", "type": "sdf3d_rounded" }, + { + "collapsed": true, + "icon": "3d_sdf_operators_elongation", + "name": "sdf3d_elongation", + "parameters": { + "x": 0.2, + "y": 0, + "z": 0 + }, + "tree_item": "3D/SDF/Operators/Elongation", + "type": "sdf3d_elongation" + }, { "collapsed": true, "icon": "3d_sdf_operators_repeat", @@ -1228,6 +1250,134 @@ "tree_item": "3D/SDF/Transforms/Rotate", "type": "sdf3d_rotate" }, + { + "collapsed": true, + "tree_item": "3D/Texture" + }, + { + "collapsed": true, + "icon": "3d_texture_apply", + "name": "tex3d_apply", + "parameters": { + + }, + "tree_item": "3D/Texture/Apply", + "type": "tex3d_apply" + }, + { + "collapsed": true, + "icon": "3d_texture_select", + "name": "tex3d_select", + "parameters": { + "t": 0.01, + "v": 1 + }, + "tree_item": "3D/Texture/Select", + "type": "tex3d_select" + }, + { + "collapsed": true, + "icon": "3d_texture_from2d", + "name": "tex3d_from2d", + "parameters": { + + }, + "tree_item": "3D/Texture/From2D", + "type": "tex3d_from2d" + }, + { + "collapsed": true, + "icon": "3d_texture_pattern", + "name": "tex3d_pattern_2", + "parameters": { + "mix": 4, + "x_scale": 2, + "x_wave": 2, + "y_scale": 2, + "y_wave": 2, + "z_scale": 2, + "z_wave": 2 + }, + "tree_item": "3D/Texture/Pattern", + "type": "tex3d_pattern" + }, + { + "collapsed": true, + "icon": "3d_texture_fbm", + "name": "tex3d_fbm_4", + "parameters": { + "iterations": 1, + "noise": 0, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8, + "scale_z": 8 + }, + "tree_item": "3D/Texture/FBM", + "type": "tex3d_fbm" + }, + { + "collapsed": true, + "icon": "3d_texture_blend", + "name": "tex3d_blend_2", + "parameters": { + "amount": 0.5, + "blend_type": 0 + }, + "tree_item": "3D/Texture/Blend", + "type": "tex3d_blend" + }, + { + "collapsed": true, + "icon": "3d_texture_colorize", + "name": "tex3d_colorize_3", + "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" + } + }, + "tree_item": "3D/Texture/Colorize", + "type": "tex3d_colorize" + }, + { + "collapsed": true, + "icon": "3d_texture_rotate", + "name": "tex3d_rotate", + "parameters": { + "ax": 0, + "ay": 0, + "az": 0 + }, + "tree_item": "3D/Texture/Rotate", + "type": "tex3d_rotate" + }, + { + "collapsed": true, + "icon": "3d_texture_distort", + "name": "tex3d_distort_2", + "parameters": { + "Distort": 0.3 + }, + "tree_item": "3D/Texture/Distort", + "type": "tex3d_distort" + }, { "collapsed": false, "tree_item": "Pattern" @@ -2089,6 +2239,20 @@ "tree_item": "Noise/Color", "type": "color_noise" }, + { + "collapsed": true, + "icon": "noise_fbm", + "name": "fbm", + "parameters": { + "iterations": 5, + "noise": 0, + "persistence": 0.5, + "scale_x": 2, + "scale_y": 2 + }, + "tree_item": "Noise/FBM", + "type": "fbm" + }, { "collapsed": false, "tree_item": "Filter" @@ -2439,6 +2603,42 @@ "tree_item": "Transform/CustomUV", "type": "custom_uv" }, + { + "collapsed": true, + "icon": "transform_tile2x2", + "name": "tile2x2", + "parameters": { + + }, + "tree_item": "Transform/Tile2x2", + "type": "tile2x2" + }, + { + "collapsed": true, + "icon": "transform_splatter", + "name": "splatter", + "parameters": { + "count": 25, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "tree_item": "Transform/Splatter", + "type": "splatter" + }, + { + "collapsed": true, + "icon": "transform_splatter_color", + "name": "splatter_color", + "parameters": { + "count": 25, + "rotate": 0, + "scale": 0, + "select_inputs": 0 + }, + "tree_item": "Transform/Splatter/Color", + "type": "splatter_color" + }, { "collapsed": false, "tree_item": "Workflow" diff --git a/material_maker/library/base/3d_sdf_color.png b/material_maker/library/base/3d_sdf_color.png new file mode 100644 index 0000000..5c39501 Binary files /dev/null and b/material_maker/library/base/3d_sdf_color.png differ diff --git a/material_maker/library/base/3d_sdf_operators_elongation.png b/material_maker/library/base/3d_sdf_operators_elongation.png new file mode 100644 index 0000000..55e45b3 Binary files /dev/null and b/material_maker/library/base/3d_sdf_operators_elongation.png differ diff --git a/material_maker/library/base/3d_texture_apply.png b/material_maker/library/base/3d_texture_apply.png new file mode 100644 index 0000000..5b29ef6 Binary files /dev/null and b/material_maker/library/base/3d_texture_apply.png differ diff --git a/material_maker/library/base/3d_texture_blend.png b/material_maker/library/base/3d_texture_blend.png new file mode 100644 index 0000000..a67168f Binary files /dev/null and b/material_maker/library/base/3d_texture_blend.png differ diff --git a/material_maker/library/base/3d_texture_colorize.png b/material_maker/library/base/3d_texture_colorize.png new file mode 100644 index 0000000..39fa360 Binary files /dev/null and b/material_maker/library/base/3d_texture_colorize.png differ diff --git a/material_maker/library/base/3d_texture_distort.png b/material_maker/library/base/3d_texture_distort.png new file mode 100644 index 0000000..8fe4e6a Binary files /dev/null and b/material_maker/library/base/3d_texture_distort.png differ diff --git a/material_maker/library/base/3d_texture_fbm.png b/material_maker/library/base/3d_texture_fbm.png new file mode 100644 index 0000000..e02ef0c Binary files /dev/null and b/material_maker/library/base/3d_texture_fbm.png differ diff --git a/material_maker/library/base/3d_texture_from2d.png b/material_maker/library/base/3d_texture_from2d.png new file mode 100644 index 0000000..b00fdcb Binary files /dev/null and b/material_maker/library/base/3d_texture_from2d.png differ diff --git a/material_maker/library/base/3d_texture_pattern.png b/material_maker/library/base/3d_texture_pattern.png new file mode 100644 index 0000000..138b086 Binary files /dev/null and b/material_maker/library/base/3d_texture_pattern.png differ diff --git a/material_maker/library/base/3d_texture_rotate.png b/material_maker/library/base/3d_texture_rotate.png new file mode 100644 index 0000000..da41ae1 Binary files /dev/null and b/material_maker/library/base/3d_texture_rotate.png differ diff --git a/material_maker/library/base/3d_texture_select.png b/material_maker/library/base/3d_texture_select.png new file mode 100644 index 0000000..58afbb1 Binary files /dev/null and b/material_maker/library/base/3d_texture_select.png differ diff --git a/material_maker/library/base/noise_fbm.png b/material_maker/library/base/noise_fbm.png new file mode 100644 index 0000000..728878d Binary files /dev/null and b/material_maker/library/base/noise_fbm.png differ diff --git a/material_maker/library/base/transform_splatter.png b/material_maker/library/base/transform_splatter.png new file mode 100644 index 0000000..dcb0be6 Binary files /dev/null and b/material_maker/library/base/transform_splatter.png differ diff --git a/material_maker/library/base/transform_splatter_color.png b/material_maker/library/base/transform_splatter_color.png new file mode 100644 index 0000000..0ce8b43 Binary files /dev/null and b/material_maker/library/base/transform_splatter_color.png differ diff --git a/material_maker/library/base/transform_tile2x2.png b/material_maker/library/base/transform_tile2x2.png new file mode 100644 index 0000000..3fe810f Binary files /dev/null and b/material_maker/library/base/transform_tile2x2.png differ diff --git a/material_maker/main_window.gd b/material_maker/main_window.gd index b946883..21f171e 100644 --- a/material_maker/main_window.gd +++ b/material_maker/main_window.gd @@ -16,6 +16,8 @@ onready var library = $VBoxContainer/HBoxContainer/VBoxContainer/Library onready var preview_2d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D onready var preview_3d = $VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D +onready var preview_2d_background = $VBoxContainer/HBoxContainer/ProjectsPane/Preview2D + const RECENT_FILES_COUNT = 15 const THEMES = [ "Dark", "Default", "Light" ] @@ -50,6 +52,10 @@ const MENU = [ { menu="Tools" }, { menu="Tools", command="add_to_user_library", description="Add selected node to user library" }, { menu="Tools", command="export_library", description="Export the nodes library" }, + + { menu="Tools", command="generate_screenshots", description="Generate screenshots for the library nodes" }, + + { menu="Help", command="show_doc", shortcut="F1", description="User manual" }, { menu="Help", command="show_library_item_doc", shortcut="Control+F1", description="Show selected library item documentation" }, @@ -216,7 +222,7 @@ func _on_SetTheme_id_pressed(id) -> void: config_cache.set_value("window", "theme", theme_name) func create_menu_create(menu) -> void: - var gens = MMGenLoader.get_generator_list() + var gens = mm_loader.get_generator_list() menu.clear() for i in gens.size(): menu.add_item(gens[i], i) @@ -226,7 +232,7 @@ func create_menu_create(menu) -> void: func _on_Create_id_pressed(id) -> void: var graph_edit : MMGraphEdit = get_current_graph_edit() if graph_edit != null: - var gens = MMGenLoader.get_generator_list() + var gens = mm_loader.get_generator_list() graph_edit.create_gen_from_type(gens[id]) func menu_about_to_show(name, menu) -> void: @@ -507,8 +513,10 @@ func update_preview_2d(node = null) -> void: result.copy_to_texture(tex) result.release() preview_2d.set_preview_texture(tex) + preview_2d_background.set_preview_texture(tex) else: preview_2d.set_preview_texture(null) + preview_2d_background.set_preview_texture(null) func update_preview_3d(previews : Array) -> void: var graph_edit : MMGraphEdit = get_current_graph_edit() @@ -520,9 +528,12 @@ func update_preview_3d(previews : Array) -> void: for p in previews: gen_material.update_materials(p.get_materials()) +var selected_node = null func on_selected_node_change(node) -> void: - preview_2d.setup_controls(node.generator if node != null else null) - update_preview_2d(node) + if node != selected_node: + selected_node = node + preview_2d.setup_controls(node.generator if node != null else null) + update_preview_2d(node) func _on_Projects_tab_changed(tab) -> void: var new_tab = projects.get_current_tab_control() @@ -554,6 +565,20 @@ func dim_window() -> void: # (it won't respond to user input in this state). modulate = Color(0.5, 0.5, 0.5) -func show_background_preview(button_pressed): +func show_background_preview_2d(button_pressed): + $VBoxContainer/HBoxContainer/ProjectsPane/Preview2D.visible = button_pressed + if button_pressed: + $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton.pressed = false + +func show_background_preview_3d(button_pressed): $VBoxContainer/HBoxContainer/ProjectsPane/Preview3D.visible = button_pressed - $VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer.visible = button_pressed + $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel.visible = button_pressed + if button_pressed: + $VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton.pressed = false + + +func generate_screenshots(): + var result = library.generate_screenshots(get_current_graph_edit()) + while result is GDScriptFunctionState: + result = yield(result, "completed") + print(result) diff --git a/material_maker/main_window.tscn b/material_maker/main_window.tscn index ddc8b6a..b9bdee7 100644 --- a/material_maker/main_window.tscn +++ b/material_maker/main_window.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=13 format=2] +[gd_scene load_steps=22 format=2] [ext_resource path="res://material_maker/main_window.gd" type="Script" id=1] [ext_resource path="res://material_maker/library.tscn" type="PackedScene" id=2] @@ -10,16 +10,60 @@ [ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=8] [ext_resource path="res://material_maker/node_factory.gd" type="Script" id=9] [ext_resource path="res://material_maker/theme/default.tres" type="Theme" id=10] +[ext_resource path="res://material_maker/preview/preview_2d.gd" type="Script" id=11] +[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=12] [sub_resource type="AtlasTexture" id=1] flags = 4 atlas = ExtResource( 8 ) -region = Rect2( 96, 32, 32, 32 ) +region = Rect2( 64, 48, 32, 32 ) [sub_resource type="AtlasTexture" id=2] flags = 4 atlas = ExtResource( 8 ) -region = Rect2( 96, 64, 32, 32 ) +region = Rect2( 16, 64, 16, 16 ) + +[sub_resource type="Shader" id=3] +code = "shader_type canvas_item; + +uniform sampler2D tex; +uniform vec2 size; + +void fragment() { + float ms = max(size.x, size.y); + vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx); + vec2 m2 = min(fract(uv), 1.0-fract(uv)); + vec4 image = texture(tex, uv); + vec3 image_with_background = mix(vec3(mod(floor(uv.x*32.0)+floor(uv.y*32.0), 2.0)), image.xyz, image.a); + float lines_color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0); + COLOR = vec4(mix(image_with_background, vec3(lines_color), step(min(m2.x*size.x, m2.y*size.y), 1.0)), 1.0); +}" + +[sub_resource type="ShaderMaterial" id=4] +shader = SubResource( 3 ) +shader_param/size = Vector2( 947, 682 ) + +[sub_resource type="ShaderMaterial" id=5] +shader = SubResource( 3 ) +shader_param/size = Vector2( 721, 546 ) + +[sub_resource type="AtlasTexture" id=6] +flags = 4 +atlas = ExtResource( 8 ) +region = Rect2( 96, 96, 32, 32 ) + +[sub_resource type="AtlasTexture" id=7] +flags = 4 +atlas = ExtResource( 8 ) +region = Rect2( 96, 32, 32, 32 ) + +[sub_resource type="StyleBoxFlat" id=8] +bg_color = Color( 0, 0, 0, 0.772549 ) + +[sub_resource type="AtlasTexture" id=9] +flags = 4 +atlas = ExtResource( 8 ) +region = Rect2( 96, 64, 32, 31 ) [node name="MainWindow" type="Panel"] anchor_right = 1.0 @@ -119,6 +163,79 @@ margin_right = -5.0 margin_bottom = -5.0 rect_min_size = Vector2( 250, 250 ) +[node name="P1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.466667, 0, 1 ) +margin_right = 32.0 +margin_bottom = 32.0 +texture = SubResource( 1 ) + +[node name="P2" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 0, 0.505882, 1, 1 ) +margin_right = 32.0 +margin_bottom = 32.0 +texture = SubResource( 1 ) + +[node name="Rect1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +texture = SubResource( 2 ) +parent_control = "P1" +control_type = 1 + +[node name="Radius1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 2 ) +parent_control = "P1" +control_type = 2 + +[node name="Radius11" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 2 ) +parent_control = "Radius1" +control_type = 2 + +[node name="Scale1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 2 ) +parent_control = "P1" +control_type = 3 + +[node name="Angle1" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 2 ) +parent_control = "P1" +control_type = 2 + +[node name="Angle2" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview2D" instance=ExtResource( 12 )] +visible = false +self_modulate = Color( 1, 0.631373, 0, 1 ) +margin_right = 16.0 +margin_bottom = 16.0 +mouse_default_cursor_shape = 10 +texture = SubResource( 2 ) +parent_control = "P1" +control_type = 2 + [node name="Preview3D" parent="VBoxContainer/HBoxContainer/VBoxContainer/Preview" instance=ExtResource( 4 )] margin_left = 5.0 margin_top = 29.0 @@ -136,12 +253,43 @@ size_flags_horizontal = 3 size_flags_vertical = 3 size_flags_stretch_ratio = 3.0 +[node name="Preview2D" type="ColorRect" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +visible = false +material = SubResource( 4 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_min_size = Vector2( 64, 64 ) +rect_clip_content = true +mouse_filter = 1 +size_flags_horizontal = 0 +size_flags_vertical = 8 +script = ExtResource( 11 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Preview2D_old" type="ColorRect" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +visible = false +material = SubResource( 5 ) +anchor_right = 1.0 +anchor_bottom = 1.0 +rect_min_size = Vector2( 64, 64 ) +rect_clip_content = true +mouse_filter = 1 +size_flags_horizontal = 0 +size_flags_vertical = 8 +script = ExtResource( 11 ) +__meta__ = { +"_edit_use_anchors_": false, +"_editor_description_": "" +} + [node name="Preview3D" parent="VBoxContainer/HBoxContainer/ProjectsPane" instance=ExtResource( 4 )] margin_left = 0.0 margin_top = 0.0 margin_right = 0.0 margin_bottom = 0.0 -ui_path = "../HBoxContainer/HBoxContainer/Preview3DUI" +ui_path = "../PreviewUI/Panel/HBoxContainer/Preview3DUI" [node name="Projects" type="Panel" parent="VBoxContainer/HBoxContainer/ProjectsPane"] self_modulate = Color( 1, 1, 1, 0 ) @@ -164,7 +312,7 @@ tab_close_display_policy = 1 [node name="AddNodePopup" parent="VBoxContainer/HBoxContainer/ProjectsPane/Projects" instance=ExtResource( 7 )] -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane"] +[node name="PreviewUI" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane"] anchor_top = 1.0 anchor_bottom = 1.0 margin_left = 1.0 @@ -172,42 +320,72 @@ margin_top = -45.0 margin_right = 331.0 margin_bottom = -13.0 custom_constants/separation = 7 +__meta__ = { +"_edit_use_anchors_": false +} -[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer"] +[node name="Preview2DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] margin_right = 44.0 margin_bottom = 40.0 +hint_tooltip = "Show 2D preview" +toggle_mode = true +icon = SubResource( 6 ) + +[node name="Preview3DButton" type="Button" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] +margin_left = 51.0 +margin_right = 95.0 +margin_bottom = 40.0 hint_tooltip = "Show 3D preview" toggle_mode = true -icon = SubResource( 1 ) +icon = SubResource( 7 ) -[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer"] +[node name="Panel" type="PanelContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI"] visible = false -margin_left = 51.0 -margin_right = 354.0 -margin_bottom = 38.0 -custom_constants/separation = 8 +self_modulate = Color( 1, 1, 1, 0.768627 ) +margin_left = 102.0 +margin_right = 399.0 +margin_bottom = 40.0 +custom_styles/panel = SubResource( 8 ) -[node name="ControlView" type="TextureRect" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer"] -margin_top = 3.0 -margin_right = 32.0 +[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel"] +margin_right = 297.0 +margin_bottom = 40.0 +custom_constants/separation = 5 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="SpaceLeft" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +margin_bottom = 40.0 + +[node name="ControlView" type="TextureRect" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +margin_left = 5.0 +margin_top = 4.0 +margin_right = 37.0 margin_bottom = 35.0 size_flags_vertical = 4 -texture = SubResource( 2 ) +texture = SubResource( 9 ) -[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer" instance=ExtResource( 5 )] +[node name="Preview3DUI" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer" instance=ExtResource( 5 )] anchor_right = 0.0 -margin_left = 40.0 +margin_left = 42.0 margin_top = 8.0 -margin_right = 303.0 -margin_bottom = 30.0 +margin_right = 292.0 +margin_bottom = 32.0 size_flags_vertical = 4 +[node name="SpaceRight" type="Control" parent="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer"] +margin_left = 297.0 +margin_right = 297.0 +margin_bottom = 40.0 + [node name="NodeFactory" type="Node" parent="."] script = ExtResource( 9 ) [connection signal="need_update" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" to="." method="update_preview_3d"] [connection signal="environment_selected" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Environment_item_selected"] [connection signal="model_selected" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Model_item_selected"] [connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D/Preview3DUI" to="VBoxContainer/HBoxContainer/VBoxContainer/Preview/Preview3D" method="_on_Rotate_toggled"] +[connection signal="resized" from="VBoxContainer/HBoxContainer/ProjectsPane/Preview2D" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview2D" method="on_resized"] [connection signal="need_update" from="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" to="." method="update_preview_3d"] [connection signal="no_more_tabs" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="." method="new_material"] [connection signal="resized" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="_on_Projects_resized"] @@ -215,8 +393,9 @@ script = ExtResource( 9 ) [connection signal="reposition_active_tab_request" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="move_active_tab_to"] [connection signal="tab_changed" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="set_current_tab"] [connection signal="tab_close" from="VBoxContainer/HBoxContainer/ProjectsPane/Projects/Tabs" to="VBoxContainer/HBoxContainer/ProjectsPane/Projects" method="close_tab"] -[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/Button" to="." method="show_background_preview"] -[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/ControlView" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="on_gui_input"] -[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Environment_item_selected"] -[connection signal="model_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Model_item_selected"] -[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/HBoxContainer/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Rotate_toggled"] +[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview2DButton" to="." method="show_background_preview_2d"] +[connection signal="toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Preview3DButton" to="." method="show_background_preview_3d"] +[connection signal="gui_input" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/ControlView" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="on_gui_input"] +[connection signal="environment_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Environment_item_selected"] +[connection signal="model_selected" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Model_item_selected"] +[connection signal="rotate_toggled" from="VBoxContainer/HBoxContainer/ProjectsPane/PreviewUI/Panel/HBoxContainer/Preview3DUI" to="VBoxContainer/HBoxContainer/ProjectsPane/Preview3D" method="_on_Rotate_toggled"] diff --git a/material_maker/nodes/base.gd b/material_maker/nodes/base.gd index ee40ec6..e1a0728 100644 --- a/material_maker/nodes/base.gd +++ b/material_maker/nodes/base.gd @@ -5,6 +5,7 @@ var generator : MMGenBase = null setget set_generator func _ready() -> void: connect("offset_changed", self, "_on_offset_changed") + connect("gui_input", self, "_on_gui_input") func _exit_tree() -> void: get_parent().call_deferred("check_last_selected") @@ -13,11 +14,6 @@ func _draw() -> void: if generator != null and generator.has_randomness(): var icon = preload("res://material_maker/icons/randomness_locked.tres") if generator.is_seed_locked() else preload("res://material_maker/icons/randomness_unlocked.tres") draw_texture_rect(icon, Rect2(rect_size.x-48, 4, 16, 16), false) - if !is_connected("gui_input", self, "_on_gui_input"): - connect("gui_input", self, "_on_gui_input") - else: - if is_connected("gui_input", self, "_on_gui_input"): - disconnect("gui_input", self, "_on_gui_input") func set_generator(g) -> void: generator = g @@ -25,8 +21,33 @@ func set_generator(g) -> void: func _on_offset_changed() -> void: generator.set_position(offset) +func _input(event) -> void: + _on_gui_input(event) + func _on_gui_input(event) -> void: if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT and Rect2(rect_size.x-48, 4, 16, 16).has_point(event.position): generator.toggle_lock_seed() update() get_parent().send_changed_signal() + elif event is InputEventMouseMotion: + var epos = event.position + if Rect2(0, 0, 16, 16).has_point(epos): + if generator.model != null: + hint_tooltip = generator.model + return + elif Rect2(rect_size.x-48, 4, 16, 16).has_point(epos) and generator.has_randomness(): + if generator.is_seed_locked(): + hint_tooltip = "Unlock the random seed, so it can be modified by moving the node" + else: + hint_tooltip = "Lock the random seed to its current value" + return + hint_tooltip = "" + +func get_slot_tooltip(pos : Vector2): + for i in range(get_connection_input_count()): + if is_slot_enabled_left(i) and (get_connection_input_position(i)-pos).length() < 5: + return "input "+str(i) + for i in range(get_connection_output_count()): + if is_slot_enabled_right(i) and (get_connection_output_position(i)-pos).length() < 5: + return "output "+str(i) + return "" diff --git a/material_maker/nodes/debug.gd b/material_maker/nodes/debug.gd index e65b54d..4e66d58 100644 --- a/material_maker/nodes/debug.gd +++ b/material_maker/nodes/debug.gd @@ -1,6 +1,6 @@ extends MMGraphNodeBase -static func generate_shader(src_code) -> String: +static func generate_debug_shader(src_code) -> String: var code code = "" var file = File.new() @@ -32,4 +32,4 @@ func _on_Button_pressed() -> void: var source = src.generator.get_shader_code("UV", src.output_index, context) var popup = preload("res://material_maker/nodes/debug/debug_popup.tscn").instance() get_parent().add_child(popup) - popup.show_code(generate_shader(source)) + popup.show_code(generate_debug_shader(source)) diff --git a/material_maker/nodes/generic.gd b/material_maker/nodes/generic.gd index 3d93986..2a2d7ae 100644 --- a/material_maker/nodes/generic.gd +++ b/material_maker/nodes/generic.gd @@ -177,8 +177,9 @@ func update_node() -> void: var type_left = 0 if typeof(input) == TYPE_DICTIONARY: enable_left = true - color_left = MMGenBase.PORT_TYPES[input.type].color - type_left = MMGenBase.PORT_TYPES[input.type].slot_type + if mm_io_types.types.has(input.type): + color_left = mm_io_types.types[input.type].color + type_left = mm_io_types.types[input.type].slot_type set_slot(i, enable_left, type_left, color_left, false, 0, Color()) var hsizer : HBoxContainer = HBoxContainer.new() hsizer.size_flags_horizontal = SIZE_EXPAND | SIZE_FILL @@ -251,8 +252,9 @@ func update_node() -> void: assert(typeof(output) == TYPE_DICTIONARY) assert(output.has("type")) enable_right = true - color_right = MMGenBase.PORT_TYPES[output.type].color - type_right = MMGenBase.PORT_TYPES[output.type].slot_type + if mm_io_types.types.has(output.type): + color_right = mm_io_types.types[output.type].color + type_right = mm_io_types.types[output.type].slot_type set_slot(i, is_slot_enabled_left(i), get_slot_type_left(i), get_slot_color_left(i), enable_right, type_right, color_right) var hsizer : HBoxContainer while i >= get_child_count(): @@ -307,7 +309,7 @@ func load_generator() -> void: dialog.rect_min_size = Vector2(500, 500) dialog.access = FileDialog.ACCESS_FILESYSTEM dialog.mode = FileDialog.MODE_OPEN_FILE - dialog.add_filter("*.mmg,*.mmn;Material Maker Generator") + dialog.add_filter("*.mmg;Material Maker Generator") dialog.connect("file_selected", self, "do_load_generator") dialog.popup_centered() @@ -320,9 +322,9 @@ func do_load_generator(file_name : String) -> void: new_generator.set_shader_model(parse_json(file.get_as_text())) file.close() else: - new_generator = MMGenLoader.load_gen(file_name) + new_generator = mm_loader.load_gen(file_name) if new_generator != null: - var gen_name = MMGenLoader.generator_name_from_path(file_name) + var gen_name = mm_loader.generator_name_from_path(file_name) if gen_name != "": new_generator.model = gen_name var parent_generator = generator.get_parent() @@ -348,6 +350,7 @@ func do_save_generator(file_name : String) -> void: data.node_position = { x=0, y=0 } file.store_string(JSON.print(data, "\t", true)) file.close() + mm_loader.update_predefined_generators() func update_preview_buttons(index : int) -> void: for i in range(output_count): diff --git a/material_maker/nodes/ios.gd b/material_maker/nodes/ios.gd index c45f0d1..1a86116 100644 --- a/material_maker/nodes/ios.gd +++ b/material_maker/nodes/ios.gd @@ -22,7 +22,7 @@ func update_node() -> void: title = generator.get_type_name() var color = Color(0.0, 0.5, 0.0, 0.5) for p in generator.get_io_defs(): - color = MMGenBase.PORT_TYPES[p.type].color + color = mm_io_types.types[p.type].color set_slot(get_child_count(), generator.name != "gen_inputs", 0, color, generator.name != "gen_outputs", 0, color) var port : Control if generator.is_editable(): diff --git a/material_maker/nodes/ios/port.gd b/material_maker/nodes/ios/port.gd index 54f8e6a..db86ad5 100644 --- a/material_maker/nodes/ios/port.gd +++ b/material_maker/nodes/ios/port.gd @@ -4,7 +4,7 @@ func set_label(l : String) -> void: $Name.set_text(l) func set_type(t : String) -> void: - $Type.selected = MMGenBase.PORT_TYPE_NAMES.find(t) + $Type.selected = mm_io_types.type_names.find(t) func update_up_down_button() -> void: var parent = get_parent() @@ -17,7 +17,7 @@ func _on_Name_label_changed(new_label) -> void: get_parent().generator.set_port_name(get_index(), new_label) func _on_Type_item_selected(ID) -> void: - get_parent().generator.set_port_type(get_index(), MMGenBase.PORT_TYPE_NAMES[ID]) + get_parent().generator.set_port_type(get_index(), mm_io_types.type_names[ID]) func _on_Delete_pressed() -> void: get_parent().generator.delete_port(get_index()) diff --git a/material_maker/preview/preview_2d.tscn b/material_maker/preview/preview_2d.tscn index 29aeff7..4092213 100644 --- a/material_maker/preview/preview_2d.tscn +++ b/material_maker/preview/preview_2d.tscn @@ -1,10 +1,6 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=4 format=2] [ext_resource path="res://material_maker/preview/preview_2d.gd" type="Script" id=1] -[ext_resource path="res://material_maker/preview/control_point.tscn" type="PackedScene" id=2] -[ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=3] - - [sub_resource type="Shader" id=1] code = "shader_type canvas_item; @@ -15,104 +11,31 @@ uniform vec2 size; void fragment() { float ms = max(size.x, size.y); vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx); + float is = min(size.x, size.y)/1.2; vec2 m2 = min(fract(uv), 1.0-fract(uv)); - float color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0); - COLOR = mix(texture(tex, uv), vec4(vec3(color), 1.0), step(min(m2.x, m2.y), 1.0/min(size.x, size.y))); + vec4 image = texture(tex, uv); + vec3 image_with_background = mix(vec3(mod(floor(uv.x*32.0)+floor(uv.y*32.0), 2.0)), image.xyz, image.a); + float lines_color = 0.5*(cos(5.0*TIME+100.0*(uv.x+uv.y))+1.0); + COLOR = vec4(mix(image_with_background, vec3(lines_color), step(is*min(m2.x, m2.y), 1.0)), 1.0); }" [sub_resource type="ShaderMaterial" id=2] shader = SubResource( 1 ) -shader_param/size = Vector2( 721, 546 ) - -[sub_resource type="AtlasTexture" id=3] -flags = 4 -atlas = ExtResource( 3 ) -region = Rect2( 64, 48, 32, 32 ) - -[sub_resource type="AtlasTexture" id=4] -flags = 4 -atlas = ExtResource( 3 ) -region = Rect2( 16, 64, 16, 16 ) +shader_param/size = Vector2( 585, 492 ) [node name="Preview2D" type="ColorRect"] material = SubResource( 2 ) anchor_right = 1.0 anchor_bottom = 1.0 -margin_right = -559.0 -margin_bottom = -174.0 +margin_right = -695.0 +margin_bottom = -228.0 rect_min_size = Vector2( 64, 64 ) rect_clip_content = true mouse_filter = 1 size_flags_horizontal = 0 size_flags_vertical = 8 script = ExtResource( 1 ) - -[node name="P1" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.466667, 0, 1 ) -texture = SubResource( 3 ) - -[node name="P2" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 0, 0.505882, 1, 1 ) -texture = SubResource( 3 ) - -[node name="Rect1" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -texture = SubResource( 4 ) -parent_control = "P1" -control_type = 1 - -[node name="Radius1" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 4 ) -parent_control = "P1" -control_type = 2 - -[node name="Radius11" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 4 ) -parent_control = "Radius1" -control_type = 2 - -[node name="Scale1" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 4 ) -parent_control = "P1" -control_type = 3 - -[node name="Angle1" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 4 ) -parent_control = "P1" -control_type = 2 - -[node name="Angle2" parent="." instance=ExtResource( 2 )] -visible = false -self_modulate = Color( 1, 0.631373, 0, 1 ) -margin_right = 16.0 -margin_bottom = 16.0 -mouse_default_cursor_shape = 10 -texture = SubResource( 4 ) -parent_control = "P1" -control_type = 2 +__meta__ = { +"_edit_use_anchors_": false +} [connection signal="resized" from="." to="." method="on_resized"] diff --git a/material_maker/widgets/graph_tree/graph_tree.gd b/material_maker/widgets/graph_tree/graph_tree.gd index 486a5d9..0b9a477 100644 --- a/material_maker/widgets/graph_tree/graph_tree.gd +++ b/material_maker/widgets/graph_tree/graph_tree.gd @@ -2,9 +2,11 @@ extends Popup signal item_double_clicked(generator) +onready var tree = $Tree + func init(graph_name : String, generator : MMGenGraph) -> void: - $Tree.clear() - var root : TreeItem = $Tree.create_item(null) + tree.clear() + var root : TreeItem = tree.create_item(null) root.set_text(0, graph_name) root.set_custom_color(0, Color(1, 1, 1)) root.set_metadata(0, generator) @@ -13,7 +15,7 @@ func init(graph_name : String, generator : MMGenGraph) -> void: func fill_item(parent : TreeItem, generator : MMGenGraph) -> void: for c in generator.get_children(): if c is MMGenGraph: - var item : TreeItem = $Tree.create_item(parent) + var item : TreeItem = tree.create_item(parent) item.set_text(0, c.get_type_name()) if c.is_editable(): item.set_custom_color(0, Color(1, 1, 1)) @@ -21,5 +23,5 @@ func fill_item(parent : TreeItem, generator : MMGenGraph) -> void: fill_item(item, c) func _on_Tree_item_double_clicked() -> void: - emit_signal("item_double_clicked", $Tree.get_selected().get_metadata(0)) + emit_signal("item_double_clicked", tree.get_selected().get_metadata(0)) queue_free() diff --git a/material_maker/widgets/linked_widgets/link.gd b/material_maker/widgets/linked_widgets/link.gd index b5510bd..420acd7 100644 --- a/material_maker/widgets/linked_widgets/link.gd +++ b/material_maker/widgets/linked_widgets/link.gd @@ -40,7 +40,7 @@ func find_control(gp) -> Dictionary: if c.get("controls") != null: for w in c.controls: var widget = c.controls[w] - if widget != null and Rect2(widget.rect_global_position, widget.rect_size*widget.get_global_transform().get_scale()).has_point(gp): + if is_instance_valid(widget) and Rect2(widget.rect_global_position, widget.rect_size*widget.get_global_transform().get_scale()).has_point(gp): return { node=c, widget=widget } return {} diff --git a/material_maker/widgets/node_editor/input.gd b/material_maker/widgets/node_editor/input.gd index aeeb02a..15157c7 100644 --- a/material_maker/widgets/node_editor/input.gd +++ b/material_maker/widgets/node_editor/input.gd @@ -1,5 +1,11 @@ extends HBoxContainer +func _ready(): + $Type.clear() + for tn in mm_io_types.type_names: + var t = mm_io_types.types[tn] + $Type.add_item(t.label) + func update_up_down_button() -> void: var parent = get_parent() if parent == null: @@ -10,31 +16,13 @@ func update_up_down_button() -> void: func set_model_data(data) -> void: $Name.text = data.name $Label.text = data.label - if data.type == "rgb": - $Type.selected = 1 - elif data.type == "rgba": - $Type.selected = 2 - elif data.type == "sdf2d": - $Type.selected = 3 - elif data.type == "sdf3d": - $Type.selected = 4 - else: - $Type.selected = 0 + $Type.selected = mm_io_types.type_names.find(data.type) $Default.text = data.default $Function.pressed = data.has("function") and data.function func get_model_data() -> Dictionary: var data = { name=$Name.text, label=$Label.text, default=$Default.text } - if $Type.selected == 1: - data.type = "rgb" - elif $Type.selected == 2: - data.type = "rgba" - elif $Type.selected == 3: - data.type = "sdf2d" - elif $Type.selected == 4: - data.type = "sdf3d" - else: - data.type = "f" + data.type = mm_io_types.type_names[$Type.selected] if $Function.pressed: data.function = true return data diff --git a/material_maker/widgets/node_editor/input.tscn b/material_maker/widgets/node_editor/input.tscn index 7f9cff7..6f287fb 100644 --- a/material_maker/widgets/node_editor/input.tscn +++ b/material_maker/widgets/node_editor/input.tscn @@ -3,8 +3,6 @@ [ext_resource path="res://material_maker/widgets/node_editor/input.gd" type="Script" id=1] [ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2] - - [sub_resource type="AtlasTexture" id=1] flags = 4 atlas = ExtResource( 2 ) @@ -63,17 +61,17 @@ text = "Label" [node name="Type" type="OptionButton" parent="."] margin_left = 236.0 -margin_right = 340.0 +margin_right = 338.0 margin_bottom = 24.0 rect_min_size = Vector2( 102, 0 ) hint_tooltip = "Input flag" -text = "GreyScale" -items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null ] +text = "Greyscale" +items = [ "Greyscale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null, "SDF3D-C", null, false, 5, null ] selected = 0 [node name="Default" type="LineEdit" parent="."] -margin_left = 344.0 -margin_right = 414.0 +margin_left = 342.0 +margin_right = 412.0 margin_bottom = 24.0 rect_min_size = Vector2( 70, 0 ) hint_tooltip = "Default value" @@ -81,8 +79,8 @@ size_flags_horizontal = 3 text = "0.0" [node name="Function" type="CheckBox" parent="."] -margin_left = 418.0 -margin_right = 501.0 +margin_left = 416.0 +margin_right = 499.0 margin_bottom = 24.0 text = "Function" [connection signal="pressed" from="Delete" to="." method="_on_Delete_pressed"] diff --git a/material_maker/widgets/node_editor/output.gd b/material_maker/widgets/node_editor/output.gd index 53b521a..e74a65a 100644 --- a/material_maker/widgets/node_editor/output.gd +++ b/material_maker/widgets/node_editor/output.gd @@ -1,5 +1,11 @@ extends HBoxContainer +func _ready(): + $Type.clear() + for tn in mm_io_types.type_names: + var t = mm_io_types.types[tn] + $Type.add_item(t.label) + func update_up_down_button() -> void: var parent = get_parent() if parent == null: @@ -8,33 +14,13 @@ func update_up_down_button() -> void: $Down.disabled = (get_index() == get_parent().get_child_count()-2) func set_model_data(data) -> void: - if data.has("rgb"): - $Type.selected = 1 - $Value.text = data.rgb - elif data.has("rgba"): - $Type.selected = 2 - $Value.text = data.rgba - elif data.has("sdf2d"): - $Type.selected = 3 - $Value.text = data.sdf2d - elif data.has("sdf3d"): - $Type.selected = 4 - $Value.text = data.sdf3d - elif data.has("f"): - $Type.selected = 0 - $Value.text = data.f + for i in range(mm_io_types.type_names.size()): + if data.has(mm_io_types.type_names[i]): + $Type.selected = i + $Value.text = data[mm_io_types.type_names[i]] func get_model_data() -> Dictionary: - if $Type.selected == 1: - return { rgb=$Value.text } - elif $Type.selected == 2: - return { rgba=$Value.text } - elif $Type.selected == 3: - return { sdf2d=$Value.text } - elif $Type.selected == 4: - return { sdf3d=$Value.text } - else: - return { f=$Value.text } + return { mm_io_types.type_names[$Type.selected]:$Value.text } func _on_Delete_pressed() -> void: var p = get_parent() diff --git a/material_maker/widgets/node_editor/output.tscn b/material_maker/widgets/node_editor/output.tscn index bd67275..f36c1dd 100644 --- a/material_maker/widgets/node_editor/output.tscn +++ b/material_maker/widgets/node_editor/output.tscn @@ -3,8 +3,6 @@ [ext_resource path="res://material_maker/widgets/node_editor/output.gd" type="Script" id=1] [ext_resource path="res://material_maker/icons/icons.svg" type="Texture" id=2] - - [sub_resource type="AtlasTexture" id=1] flags = 4 atlas = ExtResource( 2 ) @@ -55,17 +53,17 @@ flat = true [node name="Type" type="OptionButton" parent="."] margin_left = 88.0 -margin_right = 192.0 +margin_right = 190.0 margin_bottom = 25.0 rect_min_size = Vector2( 102, 0 ) hint_tooltip = "Input flag" -text = "GreyScale" -items = [ "GreyScale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null ] +text = "Greyscale" +items = [ "Greyscale", null, false, 0, null, "Color", null, false, 1, null, "RGBA", null, false, 2, null, "SDF2D", null, false, 3, null, "SDF3D", null, false, 4, null, "SDF3D-C", null, false, 5, null ] selected = 0 [node name="Value" type="LineEdit" parent="."] -margin_left = 196.0 -margin_right = 290.0 +margin_left = 194.0 +margin_right = 288.0 margin_bottom = 25.0 hint_tooltip = "Default value" size_flags_horizontal = 3 diff --git a/material_maker/window_dialog.tscn b/material_maker/window_dialog.tscn deleted file mode 100644 index 2fb6d72..0000000 --- a/material_maker/window_dialog.tscn +++ /dev/null @@ -1,13 +0,0 @@ -[gd_scene load_steps=2 format=2] - -[ext_resource path="res://material_maker/main_window.tscn" type="PackedScene" id=1] - - -[node name="WindowDialog" type="WindowDialog"] -margin_right = 1124.0 -margin_bottom = 619.0 -popup_exclusive = true -window_title = "Material Maker" -resizable = true - -[node name="MainWindow" parent="." instance=ExtResource( 1 )] diff --git a/project.godot b/project.godot index 2e5b6e5..2bd16b2 100644 --- a/project.godot +++ b/project.godot @@ -64,11 +64,6 @@ _global_script_classes=[ { "language": "GDScript", "path": "res://addons/material_maker/engine/gen_image.gd" }, { -"base": "Object", -"class": "MMGenLoader", -"language": "GDScript", -"path": "res://addons/material_maker/engine/loader.gd" -}, { "base": "MMGenBase", "class": "MMGenMaterial", "language": "GDScript", @@ -156,7 +151,6 @@ _global_script_class_icons={ "MMGenGraph": "", "MMGenIOs": "", "MMGenImage": "", -"MMGenLoader": "", "MMGenMaterial": "", "MMGenRemote": "", "MMGenRenderer": "", @@ -178,7 +172,7 @@ _global_script_class_icons={ config/name="Material Maker" config/description="An open source, extensible procedural material generation tool" -run/main_scene="res://material_maker/main_window.tscn" +run/main_scene="res://start.tscn" config/use_custom_user_dir=true config/custom_user_dir_name="material_maker" boot_splash/image="res://rodz_labs_logo.png" @@ -189,12 +183,13 @@ config/release="0.8" [autoload] +mm_io_types="*res://addons/material_maker/engine/io_types.gd" +mm_loader="*res://addons/material_maker/engine/loader.gd" mm_renderer="*res://addons/material_maker/engine/renderer.tscn" [debug] -gdscript/warnings/unsafe_property_access=true -gdscript/warnings/unsafe_method_access=true +gdscript/warnings/exclude_addons=false gdscript/warnings/unsafe_cast=true gdscript/warnings/unsafe_call_argument=true @@ -228,7 +223,11 @@ ui_library_popup={ [logging] -file_logging/enable_file_logging=true +file_logging/log_path="" + +[memory] + +limits/message_queue/max_size_kb=16384 [rendering] diff --git a/start.gd b/start.gd new file mode 100644 index 0000000..94e3f05 --- /dev/null +++ b/start.gd @@ -0,0 +1,29 @@ +extends Control + +var loader + +onready var progress_bar = $VBoxContainer/ProgressBar + +func _ready(): + var path : String + if Directory.new().file_exists("res://material_maker/main_window.tscn"): + path = "res://material_maker/main_window.tscn" + else: + path = "res://demo/demo.tscn" + loader = ResourceLoader.load_interactive(path) + if loader == null: # check for errors + print("error") + queue_free() + +func _process(_delta): + var err = loader.poll() + if err == ERR_FILE_EOF: + var resource = loader.get_resource() + get_node("/root").add_child(resource.instance()) + queue_free() + elif err == OK: + var progress = float(loader.get_stage()) / loader.get_stage_count() + progress_bar.value = 100.0*progress + else: # error during loading + print("error") + queue_free() diff --git a/start.tscn b/start.tscn new file mode 100644 index 0000000..d3f15a3 --- /dev/null +++ b/start.tscn @@ -0,0 +1,42 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://start.gd" type="Script" id=1] +[ext_resource path="res://rodz_labs_logo.png" type="Texture" id=2] + +[node name="Start" type="Panel"] +anchor_right = 1.0 +anchor_bottom = 1.0 +script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="VBoxContainer" type="VBoxContainer" parent="."] +anchor_left = 0.5 +anchor_right = 0.5 +anchor_bottom = 1.0 +margin_left = -128.0 +margin_right = 128.0 +alignment = 1 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="TextureRect" type="TextureRect" parent="VBoxContainer"] +margin_top = 214.0 +margin_right = 256.0 +margin_bottom = 470.0 +texture = ExtResource( 2 ) +stretch_mode = 4 + +[node name="Label" type="Label" parent="VBoxContainer"] +margin_top = 474.0 +margin_right = 256.0 +margin_bottom = 488.0 +text = "Loading..." +align = 1 + +[node name="ProgressBar" type="ProgressBar" parent="VBoxContainer"] +margin_top = 492.0 +margin_right = 256.0 +margin_bottom = 506.0