diff --git a/addons/procedural_material/graph_edit.gd b/addons/procedural_material/graph_edit.gd index edfc70b..6d89dfa 100644 --- a/addons/procedural_material/graph_edit.gd +++ b/addons/procedural_material/graph_edit.gd @@ -69,7 +69,8 @@ func send_changed_signal(): func do_send_changed_signal(): emit_signal("graph_changed") -func generate_shader(node, shader_type = 0): +func generate_shader(node): + var shader_type = 0 var code if shader_type == 1: code = "shader_type spatial;\n\n" @@ -119,6 +120,7 @@ func export_texture(node, filename, size = 256): $SaveViewport.update_worlds() $SaveViewport/Timer.start() yield($SaveViewport/Timer, "timeout") + yield(get_tree(), "idle_frame") var viewport_texture = $SaveViewport.get_texture() var viewport_image = viewport_texture.get_data() viewport_image.save_png("res://generated_image.png") @@ -134,9 +136,13 @@ func precalculate_texture(node, size, object, method, args): $SaveViewport.update_worlds() $SaveViewport/Timer.start() yield($SaveViewport/Timer, "timeout") + yield(get_tree(), "idle_frame") var viewport_texture = $SaveViewport.get_texture() var texture = ImageTexture.new() texture.create_from_image(viewport_texture.get_data()) args.append(texture) object.callv(method, args) +func _on_ColorRect_draw(): + print("drawn") + diff --git a/addons/procedural_material/nodes/blend.tscn b/addons/procedural_material/nodes/blend.tscn index f5b4001..cea6d36 100644 --- a/addons/procedural_material/nodes/blend.tscn +++ b/addons/procedural_material/nodes/blend.tscn @@ -53,7 +53,7 @@ slot/3/right_enabled = false slot/3/right_type = 0 slot/3/right_color = Color( 0.5, 0.5, 1, 1 ) script = ExtResource( 1 ) -_sections_unfolded = [ "Theme", "slot", "slot/1" ] +_sections_unfolded = [ "Mouse", "Theme", "slot", "slot/1" ] [node name="blend_type" type="OptionButton" parent="." index="0"] diff --git a/addons/procedural_material/nodes/bricks.tscn b/addons/procedural_material/nodes/bricks.tscn index 06b9087..dbb194b 100644 --- a/addons/procedural_material/nodes/bricks.tscn +++ b/addons/procedural_material/nodes/bricks.tscn @@ -35,7 +35,7 @@ slot/0/right_enabled = true slot/0/right_type = 0 slot/0/right_color = Color( 0.5, 0.5, 1, 1 ) script = ExtResource( 1 ) -_sections_unfolded = [ "Theme" ] +_sections_unfolded = [ "Mouse", "Theme" ] [node name="GridContainer" type="GridContainer" parent="." index="0"] diff --git a/addons/procedural_material/nodes/normal_map.tscn b/addons/procedural_material/nodes/normal_map.tscn index 5fe27bd..68fd50d 100644 --- a/addons/procedural_material/nodes/normal_map.tscn +++ b/addons/procedural_material/nodes/normal_map.tscn @@ -38,7 +38,7 @@ slot/0/right_color = Color( 0.5, 0.5, 1, 1 ) script = ExtResource( 1 ) _sections_unfolded = [ "Theme" ] -[node name="amount" type="LineEdit" parent="." index="0"] +[node name="amount" type="SpinBox" parent="." index="0"] anchor_left = 0.0 anchor_top = 0.0 @@ -50,18 +50,20 @@ margin_right = 107.0 margin_bottom = 48.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false -focus_mode = 2 mouse_filter = 0 -mouse_default_cursor_shape = 1 +mouse_default_cursor_shape = 0 size_flags_horizontal = 1 size_flags_vertical = 1 -text = "0.5" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 +min_value = 0.0 +max_value = 1.0 +step = 0.05 +page = 0.0 +value = 0.5 +exp_edit = false +rounded = false +editable = true +prefix = "" +suffix = "" _sections_unfolded = [ "Caret", "Placeholder" ] diff --git a/addons/procedural_material/nodes/pattern.gd b/addons/procedural_material/nodes/pattern.gd new file mode 100644 index 0000000..7a7ec12 --- /dev/null +++ b/addons/procedural_material/nodes/pattern.gd @@ -0,0 +1,27 @@ +tool +extends "res://addons/procedural_material/node_base.gd" + +var mix = 0; +var x_wave = 0 +var x_scale = 4.0 +var y_wave = 0 +var y_scale = 4.0 + +const WAVE_FCT = [ "wave_sin", "wave_saw", "wave_square" ] +const MIX_FCT = [ "mix_multiply", "mix_add", "mix_max", "mix_min", "mix_xor", "mix_pow" ] + +func _ready(): + set_slot(0, false, 0, Color(0.5, 0.5, 1), true, 0, Color(0.5, 0.5, 1)) + initialize_properties([ $HBoxContainer0/mix, $HBoxContainer1/x_wave, $HBoxContainer1/x_scale, $HBoxContainer2/y_wave, $HBoxContainer2/y_scale ]) + +func _get_shader_code(uv): + var rv = { defs="", code="" } + if generated_variants.empty(): + rv.defs = "float %s_f(vec2 uv) { uv *= vec2(%.9f, %.9f); return %s(%s(uv.x), %s(uv.y)); }\n" % [ name, x_scale, y_scale, MIX_FCT[mix], WAVE_FCT[x_wave], WAVE_FCT[y_wave] ] + var variant_index = generated_variants.find(uv) + if variant_index == -1: + variant_index = generated_variants.size() + generated_variants.append(uv) + rv.code = "float %s_%d_f = %s_f(%s);\n" % [ name, variant_index, name, uv ] + rv.f = name+"_"+str(variant_index)+"_f" + return rv diff --git a/addons/procedural_material/nodes/pattern.tscn b/addons/procedural_material/nodes/pattern.tscn new file mode 100644 index 0000000..07075ad --- /dev/null +++ b/addons/procedural_material/nodes/pattern.tscn @@ -0,0 +1,309 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://addons/procedural_material/nodes/pattern.gd" type="Script" id=1] + +[sub_resource type="Theme" id=1] + + +[node name="Pattern" type="GraphNode" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 1.0 +margin_right = 192.0 +margin_bottom = 79.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +theme = SubResource( 1 ) +title = "Sine" +offset = Vector2( 0, 0 ) +show_close = true +resizable = false +selected = false +comment = false +overlay = 0 +slot/0/left_enabled = false +slot/0/left_type = 0 +slot/0/left_color = Color( 0.5, 0.5, 1, 1 ) +slot/0/right_enabled = true +slot/0/right_type = 0 +slot/0/right_color = Color( 0.5, 0.5, 1, 1 ) +slot/1/left_enabled = false +slot/1/left_type = 0 +slot/1/left_color = Color( 1, 1, 1, 1 ) +slot/1/right_enabled = false +slot/1/right_type = 0 +slot/1/right_color = Color( 1, 1, 1, 1 ) +slot/2/left_enabled = false +slot/2/left_type = 0 +slot/2/left_color = Color( 1, 1, 1, 1 ) +slot/2/right_enabled = false +slot/2/right_type = 0 +slot/2/right_color = Color( 1, 1, 1, 1 ) +script = ExtResource( 1 ) +_sections_unfolded = [ "Theme" ] + +[node name="HBoxContainer0" type="HBoxContainer" parent="." index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 16.0 +margin_top = 24.0 +margin_right = 177.0 +margin_bottom = 44.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 0 +size_flags_vertical = 1 +alignment = 0 +_sections_unfolded = [ "Size Flags" ] + +[node name="Label" type="Label" parent="HBoxContainer0" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 3.0 +margin_right = 66.0 +margin_bottom = 17.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 4 +text = "Combiner:" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="mix" type="OptionButton" parent="HBoxContainer0" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 70.0 +margin_right = 161.0 +margin_bottom = 20.0 +rect_min_size = Vector2( 82, 0 ) +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 1 +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 2 +shortcut = null +group = null +text = "Multiply" +flat = false +align = 0 +items = [ "Multiply", null, false, 0, null, "Add", null, false, 1, null, "Max", null, false, 2, null, "Min", null, false, -1, null, "Xor", null, false, -1, null, "Pow", null, false, -1, null ] +selected = 0 +_sections_unfolded = [ "Rect", "Size Flags" ] + +[node name="HBoxContainer1" type="HBoxContainer" parent="." index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 16.0 +margin_top = 44.0 +margin_right = 192.0 +margin_bottom = 68.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 + +[node name="Label" type="Label" parent="HBoxContainer1" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 5.0 +margin_right = 12.0 +margin_bottom = 19.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 4 +text = "X:" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="x_wave" type="OptionButton" parent="HBoxContainer1" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 16.0 +margin_right = 98.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 82, 0 ) +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 1 +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 2 +shortcut = null +group = null +text = "Sine" +flat = false +align = 0 +items = [ "Sine", null, false, 0, null, "Saw", null, false, 1, null, "Square", null, false, 2, null ] +selected = 0 +_sections_unfolded = [ "Rect" ] + +[node name="x_scale" type="SpinBox" parent="HBoxContainer1" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 102.0 +margin_right = 176.0 +margin_bottom = 24.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 8 +size_flags_vertical = 1 +min_value = 0.0 +max_value = 32.0 +step = 1.0 +page = 0.0 +value = 4.0 +exp_edit = false +rounded = false +editable = true +prefix = "" +suffix = "" +_sections_unfolded = [ "Caret", "Placeholder", "Size Flags" ] + +[node name="HBoxContainer2" type="HBoxContainer" parent="." index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 16.0 +margin_top = 69.0 +margin_right = 192.0 +margin_bottom = 93.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 1 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 1 +size_flags_vertical = 1 +alignment = 0 +_sections_unfolded = [ "Rect", "Size Flags" ] + +[node name="Label" type="Label" parent="HBoxContainer2" index="0"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_top = 5.0 +margin_right = 12.0 +margin_bottom = 19.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 2 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 4 +text = "Y:" +percent_visible = 1.0 +lines_skipped = 0 +max_lines_visible = -1 + +[node name="y_wave" type="OptionButton" parent="HBoxContainer2" index="1"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 16.0 +margin_right = 98.0 +margin_bottom = 24.0 +rect_min_size = Vector2( 82, 0 ) +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +focus_mode = 2 +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 3 +size_flags_vertical = 1 +toggle_mode = false +action_mode = 0 +enabled_focus_mode = 2 +shortcut = null +group = null +text = "Sine" +flat = false +align = 0 +items = [ "Sine", null, false, 0, null, "Saw", null, false, 1, null, "Square", null, false, 2, null ] +selected = 0 +_sections_unfolded = [ "Rect" ] + +[node name="y_scale" type="SpinBox" parent="HBoxContainer2" index="2"] + +anchor_left = 0.0 +anchor_top = 0.0 +anchor_right = 0.0 +anchor_bottom = 0.0 +margin_left = 102.0 +margin_right = 176.0 +margin_bottom = 24.0 +rect_pivot_offset = Vector2( 0, 0 ) +rect_clip_content = false +mouse_filter = 0 +mouse_default_cursor_shape = 0 +size_flags_horizontal = 8 +size_flags_vertical = 1 +min_value = 0.0 +max_value = 32.0 +step = 1.0 +page = 0.0 +value = 4.0 +exp_edit = false +rounded = false +editable = true +prefix = "" +suffix = "" +_sections_unfolded = [ "Caret", "Placeholder", "Size Flags" ] + + diff --git a/addons/procedural_material/nodes/sine.gd b/addons/procedural_material/nodes/sine.gd deleted file mode 100644 index 57e08b2..0000000 --- a/addons/procedural_material/nodes/sine.gd +++ /dev/null @@ -1,21 +0,0 @@ -tool -extends "res://addons/procedural_material/node_base.gd" - -var waves = 1.0 -var sharpness = 1.0 - -func _ready(): - set_slot(0, false, 0, Color(0.5, 0.5, 1), true, 0, Color(0.5, 0.5, 1)) - initialize_properties([ $waves, $sharpness ]) - -func _get_shader_code(uv): - var rv = { defs="", code="" } - if generated_variants.empty(): - rv.defs = "float "+name+"_f(vec2 uv) { return sine(uv, "+str(waves)+", "+str(sharpness)+"); }\n" - var variant_index = generated_variants.find(uv) - if variant_index == -1: - variant_index = generated_variants.size() - generated_variants.append(uv) - rv.code = "float "+name+"_"+str(variant_index)+"_f = "+name+"_f("+uv+");\n" - rv.f = name+"_"+str(variant_index)+"_f" - return rv diff --git a/addons/procedural_material/nodes/sine.tscn b/addons/procedural_material/nodes/sine.tscn deleted file mode 100644 index 2a8cfae..0000000 --- a/addons/procedural_material/nodes/sine.tscn +++ /dev/null @@ -1,98 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://addons/procedural_material/nodes/sine.gd" type="Script" id=1] - -[sub_resource type="Theme" id=1] - - -[node name="Sine" type="GraphNode"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_top = 1.0 -margin_right = 90.0 -margin_bottom = 79.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 1 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -theme = SubResource( 1 ) -title = "Sine" -offset = Vector2( 0, 0 ) -show_close = true -resizable = false -selected = false -comment = false -overlay = 0 -slot/0/left_enabled = false -slot/0/left_type = 0 -slot/0/left_color = Color( 0.5, 0.5, 1, 1 ) -slot/0/right_enabled = true -slot/0/right_type = 0 -slot/0/right_color = Color( 0.5, 0.5, 1, 1 ) -slot/1/left_enabled = false -slot/1/left_type = 0 -slot/1/left_color = Color( 1, 1, 1, 1 ) -slot/1/right_enabled = false -slot/1/right_type = 0 -slot/1/right_color = Color( 1, 1, 1, 1 ) -script = ExtResource( 1 ) -_sections_unfolded = [ "Theme" ] - -[node name="waves" type="LineEdit" parent="." index="0"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 16.0 -margin_top = 24.0 -margin_right = 74.0 -margin_bottom = 48.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 -text = "1" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Caret", "Placeholder" ] - -[node name="sharpness" type="LineEdit" parent="." index="1"] - -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_left = 16.0 -margin_top = 48.0 -margin_right = 74.0 -margin_bottom = 72.0 -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -focus_mode = 2 -mouse_filter = 0 -mouse_default_cursor_shape = 1 -size_flags_horizontal = 1 -size_flags_vertical = 1 -text = "1" -focus_mode = 2 -context_menu_enabled = true -placeholder_alpha = 0.6 -caret_blink = false -caret_blink_speed = 0.65 -caret_position = 0 -_sections_unfolded = [ "Caret", "Placeholder" ] - - diff --git a/addons/procedural_material/pm_editor.gd b/addons/procedural_material/pm_editor.gd index 2a1fa42..9eea767 100644 --- a/addons/procedural_material/pm_editor.gd +++ b/addons/procedural_material/pm_editor.gd @@ -11,9 +11,10 @@ const MENU = [ { command="load_texture", description="Load texture" }, { command="save_texture", description="Save texture" }, { command="export_texture", description="Export texture" }, + { }, { submenu="generator", description="Generator" }, { name="image", description="Image", in_submenu="generator" }, - { name="sine", description="Sine", in_submenu="generator" }, + { name="pattern", description="Pattern", in_submenu="generator" }, { name="bricks", description="Bricks", in_submenu="generator" }, { name="perlin", description="Perlin noise", in_submenu="generator" }, { name="voronoi", description="Voronoi Noise", in_submenu="generator" }, @@ -49,8 +50,10 @@ func create_menu(in_submenu = null): var submenu = create_menu(MENU[i].submenu) menu.add_child(submenu) menu.add_submenu_item(MENU[i].description, submenu.get_name()) - else: + elif MENU[i].has("description"): menu.add_item(MENU[i].description, i) + else: + menu.add_separator() return menu func _on_GraphEdit_popup_request(position): diff --git a/addons/procedural_material/pm_editor.tscn b/addons/procedural_material/pm_editor.tscn index 71cc11d..c033cb3 100644 --- a/addons/procedural_material/pm_editor.tscn +++ b/addons/procedural_material/pm_editor.tscn @@ -176,19 +176,23 @@ vec4 voronoi(vec2 uv, vec2 size, float intensity, int seed) { return vec4(point0, best_distance0*length(size)*intensity, edge_distance); } -vec4 voronoi_0_xyzw(vec2 uv) { return voronoi(uv, vec2(6.000000, 6.000000), 0.550000000, 1014); } -vec3 colorize_2_gradient(float x) { - if (x < 0.000000000) { - return vec3(0.195312500,0.195312500,0.195312500); - } else if (x < 1.000000000) { - return vec3(0.195312500,0.195312500,0.195312500)+x*vec3(-0.195312500,-0.195312500,-0.195312500); - } - return vec3(0.000000000,0.000000000,0.000000000); -} +float bricks_0_f(vec2 uv) { return bricks(uv, vec2(5, 1), 0.5, 0.05, 0.001); } +float perlin_0_f(vec2 uv) { return perlin(uv, vec2(20.000000, 3.000000), 3, 0.500000000, 1161); } void fragment() { -vec4 voronoi_0_0_xyzw = voronoi_0_xyzw(UV); -vec3 colorize_2_0_rgb = colorize_2_gradient(voronoi_0_0_xyzw.z); -COLOR = vec4(colorize_2_0_rgb, 1.0); +float bricks_0_0_f = bricks_0_f(UV+vec2(0.01, 0.0)); +float perlin_0_0_f = perlin_0_f(UV+vec2(0.01, 0.0)); +vec3 blend_0_0_rgb = blend_multiply(UV+vec2(0.01, 0.0), vec3(bricks_0_0_f), vec3(perlin_0_0_f), 1.000000000); +float bricks_0_1_f = bricks_0_f(UV+vec2(-0.01, 0.0)); +float perlin_0_1_f = perlin_0_f(UV+vec2(-0.01, 0.0)); +vec3 blend_0_1_rgb = blend_multiply(UV+vec2(-0.01, 0.0), vec3(bricks_0_1_f), vec3(perlin_0_1_f), 1.000000000); +float bricks_0_2_f = bricks_0_f(UV+vec2(0.0, 0.01)); +float perlin_0_2_f = perlin_0_f(UV+vec2(0.0, 0.01)); +vec3 blend_0_2_rgb = blend_multiply(UV+vec2(0.0, 0.01), vec3(bricks_0_2_f), vec3(perlin_0_2_f), 1.000000000); +float bricks_0_3_f = bricks_0_f(UV+vec2(0.0, -0.01)); +float perlin_0_3_f = perlin_0_f(UV+vec2(0.0, -0.01)); +vec3 blend_0_3_rgb = blend_multiply(UV+vec2(0.0, -0.01), vec3(bricks_0_3_f), vec3(perlin_0_3_f), 1.000000000); +vec3 normal_map_0_0_rgb = vec3(0.5, 0.5, 0.5) + 0.5*normalize(0.5*vec3(dot(blend_0_0_rgb, vec3(1.0))/3.0-dot(blend_0_1_rgb, vec3(1.0))/3.0, dot(blend_0_2_rgb, vec3(1.0))/3.0-dot(blend_0_3_rgb, vec3(1.0))/3.0, 0.0) + vec3(0.0, 0.0, 1.0)); +COLOR = vec4(normal_map_0_0_rgb, 1.0); } " @@ -233,7 +237,7 @@ surfaces/0 = { } _sections_unfolded = [ "surface_1" ] -[sub_resource type="SpatialMaterial" id=13] +[sub_resource type="SpatialMaterial" id=5] render_priority = 0 flags_transparent = false @@ -257,8 +261,8 @@ params_billboard_mode = 0 params_grow = false params_use_alpha_scissor = false albedo_color = Color( 1, 1, 1, 1 ) -metallic = 0.0 -metallic_specular = 0.0 +metallic = 1.0 +metallic_specular = 1.0 metallic_texture_channel = 0 roughness = 1.0 roughness_texture_channel = 0 @@ -285,7 +289,7 @@ uv2_triplanar = false uv2_triplanar_sharpness = 1.0 proximity_fade_enable = false distance_fade_enable = false -_sections_unfolded = [ "Depth" ] +_sections_unfolded = [ "Depth", "Metallic" ] [sub_resource type="ArrayMesh" id=6] @@ -389,7 +393,7 @@ adjustment_contrast = 1.0 adjustment_saturation = 1.0 _sections_unfolded = [ "Background" ] -[sub_resource type="Shader" id=14] +[sub_resource type="Shader" id=9] code = "shader_type canvas_item; @@ -399,10 +403,10 @@ void fragment() { " _sections_unfolded = [ "Resource" ] -[sub_resource type="ShaderMaterial" id=15] +[sub_resource type="ShaderMaterial" id=10] render_priority = 0 -shader = SubResource( 14 ) +shader = SubResource( 9 ) [sub_resource type="Animation" id=11] @@ -488,12 +492,14 @@ tracks/2/keys = { "values": [ 3 ] } -[node name="ProceduralMaterialEditor" type="MarginContainer" index="0"] +[node name="ProceduralMaterialEditor" type="MarginContainer"] anchor_left = 0.0 anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 1.0 +margin_bottom = -2.0 +rect_min_size = Vector2( 500, 300 ) rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0 @@ -502,15 +508,17 @@ size_flags_horizontal = 1 size_flags_vertical = 1 custom_constants/margin_left = 0 script = ExtResource( 1 ) +_sections_unfolded = [ "Rect" ] [node name="GraphEdit" type="GraphEdit" parent="." index="0"] +self_modulate = Color( 1, 1, 1, 0 ) anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_right = 1024.0 -margin_bottom = 600.0 +margin_bottom = 598.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 @@ -524,7 +532,7 @@ snap_distance = 20 use_snap = false zoom = 1.0 script = ExtResource( 2 ) -_sections_unfolded = [ "Mouse" ] +_sections_unfolded = [ "Material", "Mouse", "Visibility" ] [node name="Material" parent="GraphEdit" index="0" instance=ExtResource( 3 )] @@ -535,7 +543,7 @@ _sections_unfolded = [ "Anchor", "Margin", "Mouse", "Theme", "slot", "slot/2", " [node name="Timer" type="Timer" parent="GraphEdit" index="1"] process_mode = 1 -wait_time = 0.25 +wait_time = 0.1 one_shot = true autostart = false @@ -587,37 +595,18 @@ _sections_unfolded = [ "Material", "Rect" ] [node name="Timer" type="Timer" parent="GraphEdit/SaveViewport" index="1"] process_mode = 1 -wait_time = 0.5 +wait_time = 0.1 one_shot = true autostart = false -[node name="TexturePreview" type="ColorRect" parent="." index="1"] - -visible = false -anchor_left = 0.0 -anchor_top = 0.0 -anchor_right = 0.0 -anchor_bottom = 0.0 -margin_right = 1024.0 -margin_bottom = 600.0 -rect_min_size = Vector2( 256, 256 ) -rect_pivot_offset = Vector2( 0, 0 ) -rect_clip_content = false -mouse_filter = 0 -mouse_default_cursor_shape = 0 -size_flags_horizontal = 1 -size_flags_vertical = 1 -color = Color( 1, 1, 1, 1 ) -_sections_unfolded = [ "Material", "Mouse", "Rect" ] - -[node name="Preview" type="Container" parent="." index="2"] +[node name="Preview" type="Container" parent="." index="1"] anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_right = 1024.0 -margin_bottom = 600.0 +margin_bottom = 598.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 2 @@ -688,7 +677,7 @@ _sections_unfolded = [ "GUI", "Render Target" ] [node name="Objects" type="Spatial" parent="Preview/Preview/MaterialPreview" index="0"] -transform = Transform( -0.978985, 0, -0.20392, 0, 1, 0, 0.20392, 0, -0.978985, 0, 0, 0 ) +transform = Transform( -0.139228, 0, 0.990259, 0, 1, 0, -0.990259, 0, -0.139228, 0, 0, 0 ) _sections_unfolded = [ "Transform" ] [node name="Cube" type="MeshInstance" parent="Preview/Preview/MaterialPreview/Objects" index="0"] @@ -704,7 +693,7 @@ lod_max_distance = 0.0 lod_max_hysteresis = 0.0 mesh = SubResource( 4 ) skeleton = NodePath("..") -material/0 = SubResource( 13 ) +material/0 = SubResource( 5 ) _sections_unfolded = [ "Geometry", "Transform", "material" ] [node name="Cylinder" type="MeshInstance" parent="Preview/Preview/MaterialPreview/Objects" index="1"] @@ -721,7 +710,7 @@ lod_max_distance = 0.0 lod_max_hysteresis = 0.0 mesh = SubResource( 6 ) skeleton = NodePath("..") -material/0 = SubResource( 13 ) +material/0 = SubResource( 5 ) _sections_unfolded = [ "Geometry", "Transform", "material" ] [node name="OmniLight" type="OmniLight" parent="Preview/Preview/MaterialPreview" index="1"] @@ -826,7 +815,7 @@ selected = 3 [node name="SelectedPreview" type="ColorRect" parent="Preview/Preview" index="4"] -material = SubResource( 15 ) +material = SubResource( 10 ) anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 diff --git a/addons/procedural_material/shader_header.txt b/addons/procedural_material/shader_header.txt index de1601d..e28fbc5 100644 --- a/addons/procedural_material/shader_header.txt +++ b/addons/procedural_material/shader_header.txt @@ -13,6 +13,47 @@ vec3 rand3(vec2 x) { dot(x, vec2(13.254, 5.867)))) * 43758.5453); } +float wave_sin(float x) { + return 0.5-0.5*cos(3.1415928*2.0*x); +} + +float wave_saw(float x) { + x = fract(x); + return min(2.0*x, 2.0-2.0*x); +} + +float wave_square(float x) { + return (fract(x) < 0.5) ? 0.0 : 1.0; +} + +float mix_multiply(float x, float y) { + return x*y; +} + +float mix_add(float x, float y) { + return min(x+y, 1.0); +} + +float mix_max(float x, float y) { + return max(x, y); +} + +float mix_min(float x, float y) { + return min(x, y); +} + +float mix_min(float x, float y) { + return min(x, y); +} + +float mix_xor(float x, float y) { + return min(x+y, 2.0-x-y); +} + +float mix_pow(float x, float y) { + return pow(x, y); +} + vec3 blend_normal(vec2 uv, vec3 c1, vec3 c2, float opacity) { return opacity*c1 + (1.0-opacity)*c2; } @@ -77,10 +118,6 @@ vec3 blend_darken(vec2 uv, vec3 c1, vec3 c2, float opacity) { return opacity*min(c1, c2) + (1.0-opacity)*c2; } -float sine(vec2 uv, float count, float sharpness) { - return clamp(0.5+sharpness*0.5*sin(count*3.1415928*2.0*uv.x), 0.0, 1.0); -} - vec2 transform(vec2 uv, float rotate, float scale) { vec2 rv; uv -= vec2(0.5); diff --git a/examples/bricks.ptex b/examples/bricks.ptex index ef4ab5f..ee8ab58 100644 --- a/examples/bricks.ptex +++ b/examples/bricks.ptex @@ -1 +1 @@ -{"connections":[{"from":"Bricks","from_port":0,"to":"Warp","to_port":0},{"from":"Perlin","from_port":0,"to":"Warp","to_port":1},{"from":"Perlin2","from_port":0,"to":"colorize_0","to_port":0},{"from":"Perlin2","from_port":0,"to":"colorize_1","to_port":0},{"from":"Warp","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"Warp","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":1},{"from":"Warp","from_port":0,"to":"colorize_3","to_port":0},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"colorize_3","from_port":0,"to":"Material","to_port":2}],"nodes":[{"iterations":7,"name":"Perlin2","node_position":{"x":258,"y":-32},"persistence":0.5,"scale_x":8,"scale_y":8,"type":"perlin"},{"bevel":0.2,"columns":3,"mortar":0.05,"name":"Bricks","node_position":{"x":260,"y":132},"row_offset":0.5,"rows":6,"type":"bricks"},{"iterations":6,"name":"Perlin","node_position":{"x":255,"y":322},"persistence":0.5,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.1,"name":"Warp","node_position":{"x":504,"y":199.75},"type":"warp"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.072727,"r":1}],"name":"colorize_2","node_position":{"x":639.943665,"y":152},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_0","node_position":{"x":560.943665,"y":50},"type":"colorize"},{"gradient":[{"b":0.002889,"g":0.102424,"pos":0,"r":0.184896},{"b":0,"g":0.19869,"pos":0.327273,"r":0.669271},{"b":0.019368,"g":0.060224,"pos":0.663636,"r":0.309896},{"b":0,"g":0.180135,"pos":1,"r":0.606771}],"name":"colorize_1","node_position":{"x":562.943665,"y":-65},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":820.943726,"y":-33},"type":"blend"},{"name":"Material","node_position":{"x":1024,"y":204},"type":"material"},{"gradient":[{"b":0.273438,"g":0.273438,"pos":0,"r":0.273438},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":688,"y":355},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":721,"y":244},"type":"normal_map"}]} \ No newline at end of file +{"connections":[{"from":"Bricks","from_port":0,"to":"Warp","to_port":0},{"from":"Perlin","from_port":0,"to":"Warp","to_port":1},{"from":"Perlin2","from_port":0,"to":"colorize_0","to_port":0},{"from":"Perlin2","from_port":0,"to":"colorize_1","to_port":0},{"from":"Warp","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_0","to_port":1},{"from":"Warp","from_port":0,"to":"colorize_3","to_port":0},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"Warp","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_3","from_port":0,"to":"Material","to_port":5},{"from":"colorize_2","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":2},{"from":"colorize_2","from_port":0,"to":"colorize_5","to_port":0},{"from":"colorize_5","from_port":0,"to":"Material","to_port":1}],"nodes":[{"bevel":0.2,"columns":3,"mortar":0.05,"name":"Bricks","node_position":{"x":260,"y":132},"row_offset":0.5,"rows":6,"type":"bricks"},{"iterations":6,"name":"Perlin","node_position":{"x":255,"y":322},"persistence":0.5,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.1,"name":"Warp","node_position":{"x":504,"y":199.75},"type":"warp"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":1,"r":1}],"name":"colorize_0","node_position":{"x":560.943665,"y":50},"type":"colorize"},{"gradient":[{"b":0.002889,"g":0.102424,"pos":0,"r":0.184896},{"b":0,"g":0.19869,"pos":0.327273,"r":0.669271},{"b":0.019368,"g":0.060224,"pos":0.654545,"r":0.309896},{"b":0,"g":0.180135,"pos":1,"r":0.606771}],"name":"colorize_1","node_position":{"x":562.943665,"y":-65},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":820.943726,"y":-33},"type":"blend"},{"name":"Material","node_position":{"x":1024,"y":204},"type":"material"},{"iterations":7,"name":"Perlin2","node_position":{"x":253,"y":-28},"persistence":0.5,"scale_x":8,"scale_y":8,"type":"perlin"},{"gradient":[{"b":0.273438,"g":0.273438,"pos":0,"r":0.273438},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":631,"y":363},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":691,"y":295},"type":"normal_map"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":1,"g":1,"pos":0.063636,"r":1}],"name":"colorize_2","node_position":{"x":633.943665,"y":146},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_5","node_position":{"x":837,"y":157},"type":"colorize"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0.672727,"g":0.672727,"pos":1,"r":0.672727}],"name":"colorize_4","node_position":{"x":719,"y":224},"type":"colorize"}]} \ No newline at end of file diff --git a/examples/lava.ptex b/examples/lava.ptex index 3902720..e662906 100644 --- a/examples/lava.ptex +++ b/examples/lava.ptex @@ -1 +1 @@ -{"connections":[{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"Material","to_port":0},{"from":"perlin_0","from_port":0,"to":"warp_0","to_port":1},{"from":"voronoi_0","from_port":0,"to":"warp_0","to_port":0},{"from":"warp_0","from_port":0,"to":"blend_0","to_port":1},{"from":"warp_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"warp_0","from_port":0,"to":"Material","to_port":1},{"from":"warp_0","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"Material","to_port":2},{"from":"warp_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_1","from_port":0,"to":"Material","to_port":3}],"nodes":[{"name":"Material","node_position":{"x":956,"y":271},"type":"material"},{"iterations":8,"name":"perlin_0","node_position":{"x":-63,"y":-34},"persistence":0.75,"scale_x":4,"scale_y":4,"type":"perlin"},{"intensity":0.55,"name":"voronoi_0","node_position":{"x":-2,"y":204},"scale_x":6,"scale_y":6,"type":"voronoi"},{"amount":0.3,"name":"warp_0","node_position":{"x":242,"y":23},"type":"warp"},{"gradient":[{"b":0.032597,"g":0.032597,"pos":0.072727,"r":0.032597},{"b":0.111979,"g":0.111979,"pos":0.3,"r":0.111979},{"b":0.029781,"g":0.029781,"pos":0.518182,"r":0.029781},{"b":0.069093,"g":0.069093,"pos":0.818182,"r":0.069093},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_0","node_position":{"x":666,"y":27},"type":"colorize"},{"gradient":[{"b":1,"g":1,"pos":0.290909,"r":1},{"b":0,"g":0,"pos":0.8,"r":0}],"name":"colorize_2","node_position":{"x":535,"y":123.5},"type":"colorize"},{"gradient":[{"b":0,"g":0.765625,"pos":0,"r":1},{"b":0,"g":0,"pos":0.181818,"r":1},{"b":0,"g":0,"pos":0.245455,"r":0}],"name":"colorize_1","node_position":{"x":479,"y":215},"type":"colorize"},{"amount":0.9,"name":"normal_map_0","node_position":{"x":501,"y":314.5},"type":"normal_map"},{"amount":0.45,"blend_type":1,"name":"blend_0","node_position":{"x":433,"y":-87},"type":"blend"}]} \ No newline at end of file +{"connections":[{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_0","from_port":0,"to":"Material","to_port":0},{"from":"perlin_0","from_port":0,"to":"warp_0","to_port":1},{"from":"voronoi_0","from_port":0,"to":"warp_0","to_port":0},{"from":"warp_0","from_port":0,"to":"blend_0","to_port":1},{"from":"warp_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"warp_0","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"Material","to_port":2},{"from":"warp_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"colorize_1","from_port":0,"to":"Material","to_port":3},{"from":"colorize_2","from_port":0,"to":"Material","to_port":1},{"from":"colorize_3","from_port":0,"to":"Material","to_port":5},{"from":"warp_0","from_port":0,"to":"colorize_3","to_port":0}],"nodes":[{"name":"Material","node_position":{"x":956,"y":271},"type":"material"},{"iterations":8,"name":"perlin_0","node_position":{"x":-63,"y":-34},"persistence":0.75,"scale_x":4,"scale_y":4,"type":"perlin"},{"intensity":0.55,"name":"voronoi_0","node_position":{"x":-2,"y":204},"scale_x":6,"scale_y":6,"type":"voronoi"},{"gradient":[{"b":0.032597,"g":0.032597,"pos":0.063636,"r":0.032597},{"b":0.111979,"g":0.111979,"pos":0.3,"r":0.111979},{"b":0.029781,"g":0.029781,"pos":0.518182,"r":0.029781},{"b":0.069093,"g":0.069093,"pos":0.818182,"r":0.069093},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_0","node_position":{"x":666,"y":27},"type":"colorize"},{"gradient":[{"b":0,"g":0.765625,"pos":0,"r":1},{"b":0,"g":0,"pos":0.172727,"r":1},{"b":0,"g":0,"pos":0.245455,"r":0}],"name":"colorize_1","node_position":{"x":479,"y":215},"type":"colorize"},{"amount":0.9,"name":"normal_map_0","node_position":{"x":501,"y":314.5},"type":"normal_map"},{"amount":0.45,"blend_type":1,"name":"blend_0","node_position":{"x":433,"y":-87},"type":"blend"},{"gradient":[{"b":1,"g":1,"pos":0.281818,"r":1},{"b":0,"g":0,"pos":0.8,"r":0}],"name":"colorize_2","node_position":{"x":498,"y":130.5},"type":"colorize"},{"amount":0.3,"name":"warp_0","node_position":{"x":242,"y":23},"type":"warp"},{"gradient":[{"b":0.345455,"g":0.345455,"pos":0,"r":0.345455},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_3","node_position":{"x":419,"y":415.25},"type":"colorize"}]} \ No newline at end of file diff --git a/examples/rusted_metal.ptex b/examples/rusted_metal.ptex new file mode 100644 index 0000000..b56c471 --- /dev/null +++ b/examples/rusted_metal.ptex @@ -0,0 +1 @@ +{"connections":[{"from":"perlin_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_1","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_0","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_0","to_port":1},{"from":"perlin_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"blend_0","to_port":2},{"from":"colorize_0","from_port":0,"to":"blend_1","to_port":1},{"from":"blend_0","from_port":0,"to":"Material","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_3","from_port":0,"to":"Material","to_port":1},{"from":"blend_1","from_port":0,"to":"Material","to_port":2},{"from":"colorize_4","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_3","from_port":0,"to":"colorize_4","to_port":0}],"nodes":[{"iterations":8,"name":"perlin_0","node_position":{"x":86,"y":301},"persistence":0.7,"scale_x":4,"scale_y":4,"type":"perlin"},{"iterations":8,"name":"perlin_1","node_position":{"x":86,"y":147},"persistence":0.8,"scale_x":4,"scale_y":4,"type":"perlin"},{"iterations":8,"name":"perlin_2","node_position":{"x":89,"y":-6},"persistence":0.9,"scale_x":4,"scale_y":4,"type":"perlin"},{"name":"Material","node_position":{"x":947,"y":183},"type":"material"},{"gradient":[{"b":0.335938,"g":0.335938,"pos":0,"r":0.335938},{"b":0.695313,"g":0.695313,"pos":1,"r":0.695313}],"name":"colorize_2","node_position":{"x":365,"y":-41},"type":"colorize"},{"gradient":[{"b":0.354545,"g":0.354545,"pos":0,"r":0.354545},{"b":0.745455,"g":0.745455,"pos":1,"r":0.745455}],"name":"colorize_0","node_position":{"x":363,"y":337},"type":"colorize"},{"amount":0.5,"blend_type":4,"name":"blend_1","node_position":{"x":660,"y":290},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0.445455,"r":0},{"b":1,"g":1,"pos":0.463636,"r":1}],"name":"colorize_3","node_position":{"x":371,"y":47},"type":"colorize"},{"gradient":[{"b":0,"g":0.091146,"pos":0,"r":0.208333},{"b":0,"g":0.1875,"pos":1,"r":1}],"name":"colorize_1","node_position":{"x":371,"y":214},"type":"colorize"},{"gradient":[{"b":1,"g":1,"pos":0,"r":1},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_4","node_position":{"x":480,"y":141},"type":"colorize"},{"amount":0.5,"blend_type":0,"name":"blend_0","node_position":{"x":669,"y":-19},"type":"blend"}]} \ No newline at end of file diff --git a/examples/wood_with_blood.ptex b/examples/wood_with_blood.ptex index 361bfe2..2da1840 100644 --- a/examples/wood_with_blood.ptex +++ b/examples/wood_with_blood.ptex @@ -1 +1 @@ -{"connections":[{"from":"bricks_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":1},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"blend_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_1","to_port":1},{"from":"perlin_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"blend_1","to_port":2},{"from":"blend_1","from_port":0,"to":"Material","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_2","to_port":1},{"from":"colorize_3","from_port":0,"to":"blend_2","to_port":0},{"from":"blend_2","from_port":0,"to":"Material","to_port":2},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0}],"nodes":[{"gradient":[{"b":0.004367,"g":0.004367,"pos":0,"r":0.059896},{"b":0.012831,"g":0.012831,"pos":0.163636,"r":0.111979},{"b":0.006687,"g":0.006687,"pos":0.454545,"r":0.075521},{"b":0.007871,"g":0.007871,"pos":0.745455,"r":0.144176},{"b":0.002062,"g":0.002062,"pos":1,"r":0.049479}],"name":"colorize_2","node_position":{"x":487.633789,"y":-144.5},"type":"colorize"},{"gradient":[{"b":0.690104,"g":0.690104,"pos":0,"r":0.690104},{"b":0.492188,"g":0.492188,"pos":1,"r":0.492188}],"name":"colorize_1","node_position":{"x":495.633789,"y":220.5},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":724.633789,"y":345.5},"type":"normal_map"},{"name":"Material","node_position":{"x":938,"y":96},"type":"material"},{"iterations":6,"name":"perlin_2","node_position":{"x":222.633789,"y":19},"persistence":0.65,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":707.633789,"y":-68},"type":"blend"},{"gradient":[{"b":0,"g":0,"pos":0.445455,"r":0},{"b":1,"g":1,"pos":0.554545,"r":1}],"name":"colorize_3","node_position":{"x":487.633789,"y":65},"type":"colorize"},{"iterations":3,"name":"perlin_0","node_position":{"x":12,"y":225.5},"persistence":0.5,"scale_x":20,"scale_y":3,"type":"perlin"},{"bevel":0,"columns":5,"mortar":0.05,"name":"bricks_0","node_position":{"x":-1,"y":30.5},"row_offset":0.5,"rows":1,"type":"bricks"},{"gradient":[{"b":0.00826,"g":0.042941,"pos":0,"r":0.075521},{"b":0.025567,"g":0.207086,"pos":0.118182,"r":0.377604},{"b":0.015259,"g":0.067816,"pos":0.263636,"r":0.117188},{"b":0.017965,"g":0.174595,"pos":0.381818,"r":0.321733},{"b":0.015933,"g":0.124841,"pos":0.527273,"r":0.22715},{"b":0.017148,"g":0.148096,"pos":0.672727,"r":0.271107},{"b":0.015842,"g":0.105696,"pos":0.845455,"r":0.190104},{"b":0.011393,"g":0.14651,"pos":1,"r":0.273438}],"name":"colorize_0","node_position":{"x":472,"y":-41.5},"type":"colorize"},{"amount":1,"blend_type":2,"name":"blend_0","node_position":{"x":271,"y":306.5},"type":"blend"},{"iterations":7,"name":"perlin_1","node_position":{"x":110.633789,"y":-143.5},"persistence":0.55,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.35,"blend_type":0,"name":"blend_2","node_position":{"x":690.633789,"y":201.5},"type":"blend"}]} \ No newline at end of file +{"connections":[{"from":"bricks_0","from_port":0,"to":"blend_0","to_port":0},{"from":"perlin_0","from_port":0,"to":"blend_0","to_port":1},{"from":"normal_map_0","from_port":0,"to":"Material","to_port":4},{"from":"blend_0","from_port":0,"to":"normal_map_0","to_port":0},{"from":"blend_0","from_port":0,"to":"colorize_1","to_port":0},{"from":"perlin_1","from_port":0,"to":"colorize_2","to_port":0},{"from":"colorize_2","from_port":0,"to":"blend_1","to_port":0},{"from":"colorize_0","from_port":0,"to":"blend_1","to_port":1},{"from":"perlin_2","from_port":0,"to":"colorize_3","to_port":0},{"from":"colorize_3","from_port":0,"to":"blend_1","to_port":2},{"from":"blend_1","from_port":0,"to":"Material","to_port":0},{"from":"colorize_1","from_port":0,"to":"blend_2","to_port":1},{"from":"colorize_3","from_port":0,"to":"blend_2","to_port":0},{"from":"blend_2","from_port":0,"to":"Material","to_port":2},{"from":"blend_0","from_port":0,"to":"colorize_0","to_port":0},{"from":"colorize_3","from_port":0,"to":"colorize_4","to_port":0},{"from":"colorize_4","from_port":0,"to":"Material","to_port":1}],"nodes":[{"gradient":[{"b":0.690104,"g":0.690104,"pos":0,"r":0.690104},{"b":0.492188,"g":0.492188,"pos":1,"r":0.492188}],"name":"colorize_1","node_position":{"x":495.633789,"y":220.5},"type":"colorize"},{"amount":0.5,"name":"normal_map_0","node_position":{"x":724.633789,"y":345.5},"type":"normal_map"},{"name":"Material","node_position":{"x":938,"y":96},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0.445455,"r":0},{"b":1,"g":1,"pos":0.563636,"r":1}],"name":"colorize_3","node_position":{"x":487.633789,"y":65},"type":"colorize"},{"iterations":3,"name":"perlin_0","node_position":{"x":12,"y":225.5},"persistence":0.5,"scale_x":20,"scale_y":3,"type":"perlin"},{"bevel":0,"columns":5,"mortar":0.05,"name":"bricks_0","node_position":{"x":-1,"y":30.5},"row_offset":0.5,"rows":1,"type":"bricks"},{"gradient":[{"b":0.00826,"g":0.042941,"pos":0,"r":0.075521},{"b":0.025567,"g":0.207086,"pos":0.118182,"r":0.377604},{"b":0.015259,"g":0.067816,"pos":0.245455,"r":0.117188},{"b":0.017965,"g":0.174595,"pos":0.363636,"r":0.321733},{"b":0.015933,"g":0.124841,"pos":0.527273,"r":0.22715},{"b":0.017148,"g":0.148096,"pos":0.654545,"r":0.271107},{"b":0.015842,"g":0.105696,"pos":0.845455,"r":0.190104},{"b":0.011393,"g":0.14651,"pos":1,"r":0.273438}],"name":"colorize_0","node_position":{"x":472,"y":-41.5},"type":"colorize"},{"amount":1,"blend_type":2,"name":"blend_0","node_position":{"x":271,"y":306.5},"type":"blend"},{"iterations":7,"name":"perlin_1","node_position":{"x":110.633789,"y":-143.5},"persistence":0.55,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.35,"blend_type":0,"name":"blend_2","node_position":{"x":690.633789,"y":201.5},"type":"blend"},{"iterations":6,"name":"perlin_2","node_position":{"x":232.633789,"y":40},"persistence":0.65,"scale_x":4,"scale_y":4,"type":"perlin"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":707.633789,"y":-68},"type":"blend"},{"gradient":[{"b":0.004367,"g":0.004367,"pos":0,"r":0.059896},{"b":0.012831,"g":0.012831,"pos":0.145455,"r":0.111979},{"b":0.006687,"g":0.006687,"pos":0.445455,"r":0.075521},{"b":0.007871,"g":0.007871,"pos":0.745455,"r":0.144176},{"b":0.002062,"g":0.002062,"pos":1,"r":0.049479}],"name":"colorize_2","node_position":{"x":487.633789,"y":-144.5},"type":"colorize"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0},{"b":0,"g":0,"pos":1,"r":0}],"name":"colorize_4","node_position":{"x":732,"y":116},"type":"colorize"}]} \ No newline at end of file diff --git a/export_presets.cfg b/export_presets.cfg new file mode 100644 index 0000000..e963a2e --- /dev/null +++ b/export_presets.cfg @@ -0,0 +1,27 @@ +[preset.0] + +name="Windows Desktop" +platform="Windows Desktop" +runnable=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +patch_list=PoolStringArray( ) + +[preset.0.options] + +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/64_bits=true +custom_template/release="" +custom_template/debug="" +application/icon="" +application/file_version="" +application/product_version="" +application/company_name="" +application/product_name="" +application/file_description="" +application/copyright="" +application/trademarks=""