diff --git a/.gitignore b/.gitignore index fa242d7..3fe36e8 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,5 @@ addons/procedural_material/models/Material.material addons/procedural_material/models/models.blend1 addons/procedural_material/models/models.dae addons/procedural_material/models/models.dae.import +/examples/*.png +/examples/*.import diff --git a/addons/procedural_material/shader_header.txt b/addons/procedural_material/common.shader similarity index 100% rename from addons/procedural_material/shader_header.txt rename to addons/procedural_material/common.shader diff --git a/addons/procedural_material/graph_edit.gd b/addons/procedural_material/graph_edit.gd index 6d89dfa..548a8ed 100644 --- a/addons/procedural_material/graph_edit.gd +++ b/addons/procedural_material/graph_edit.gd @@ -28,17 +28,39 @@ func remove_node(node): node.queue_free() send_changed_signal() +func _on_GraphEdit_connection_request(from, from_slot, to, to_slot): + var disconnect = get_source(to, to_slot) + if disconnect != null: + disconnect_node(disconnect.node, disconnect.slot, to, to_slot) + connect_node(from, from_slot, to, to_slot) + send_changed_signal(); + +func _on_GraphEdit_disconnection_request(from, from_slot, to, to_slot): + disconnect_node(from, from_slot, to, to_slot) + send_changed_signal(); + +func clear_material(): + clear_connections() + for c in get_children(): + if c is GraphNode: + remove_child(c) + c.free() + +func new_material(): + clear_material() + var node_type = load("res://addons/procedural_material/nodes/material.tscn") + if node_type != null: + var node = node_type.instance() + add_node(node) + do_send_changed_signal() + func load_file(filename): var file = File.new() if file.open(filename, File.READ) != OK: return var data = parse_json(file.get_as_text()) file.close() - clear_connections() - for c in get_children(): - if c is GraphNode: - remove_child(c) - c.free() + clear_material() for n in data.nodes: if !n.has("type"): continue @@ -70,14 +92,10 @@ func do_send_changed_signal(): emit_signal("graph_changed") func generate_shader(node): - var shader_type = 0 var code - if shader_type == 1: - code = "shader_type spatial;\n\n" - else: - code = "shader_type canvas_item;\n\n" + code = "shader_type canvas_item;\n\n" var file = File.new() - file.open("res://addons/procedural_material/shader_header.txt", File.READ) + file.open("res://addons/procedural_material/common.shader", File.READ) code += file.get_as_text() code += "\n" for c in get_children(): @@ -88,18 +106,12 @@ func generate_shader(node): var shader_code = src_code.defs shader_code += "void fragment() {\n" shader_code += src_code.code - if shader_type == 1: - if src_code.has("albedo"): - shader_code += "ALBEDO = "+src_code.albedo+";\n" - if src_code.has("normal_map"): - shader_code += "NORMALMAP = "+src_code.normal_map+";\n" + if src_code.has("rgb"): + shader_code += "COLOR = vec4("+src_code.rgb+", 1.0);\n" + elif src_code.has("f"): + shader_code += "COLOR = vec4(vec3("+src_code.f+"), 1.0);\n" else: - if src_code.has("rgb"): - shader_code += "COLOR = vec4("+src_code.rgb+", 1.0);\n" - elif src_code.has("f"): - shader_code += "COLOR = vec4(vec3("+src_code.f+"), 1.0);\n" - else: - shader_code += "COLOR = vec4(1.0);\n" + shader_code += "COLOR = vec4(1.0);\n" shader_code += "}\n" #print("GENERATED SHADER:\n"+shader_code) code += shader_code @@ -110,39 +122,49 @@ func setup_material(shader_material, textures, shader_code): shader_material.set_shader_param(k+"_tex", textures[k]) shader_material.shader.code = shader_code +# Save shader to image + +var render_queue = [] + +func render_to_viewport(node, size, method, args): + render_queue.append( { shader=generate_shader(node), textures=node.get_textures(), size=size, method=method, args=args } ) + if render_queue.size() == 1: + while !render_queue.empty(): + var job = render_queue.front() + $SaveViewport.size = Vector2(job.size, job.size) + $SaveViewport/ColorRect.rect_position = Vector2(0, 0) + $SaveViewport/ColorRect.rect_size = Vector2(job.size, job.size) + var shader_material = $SaveViewport/ColorRect.material + shader_material.shader.code = job.shader + for k in job.textures.keys(): + shader_material.set_shader_param(k+"_tex", job.textures[k]) + $SaveViewport.render_target_update_mode = Viewport.UPDATE_ONCE + $SaveViewport.update_worlds() + yield(get_tree(), "idle_frame") + yield(get_tree(), "idle_frame") + yield(get_tree(), "idle_frame") + callv(job.method, job.args) + render_queue.pop_front() + func export_texture(node, filename, size = 256): - if node != null: - $SaveViewport.size = Vector2(size, size) - $SaveViewport/ColorRect.rect_position = Vector2(0, 0) - $SaveViewport/ColorRect.rect_size = Vector2(size, size) - setup_material($SaveViewport/ColorRect.material, node.get_textures(), generate_shader(node)) - $SaveViewport.render_target_update_mode = Viewport.UPDATE_ONCE - $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") + if node == null: + return null + render_to_viewport(node, size, "do_export_texture", [ filename ]) + +func do_export_texture(filename): + var viewport_texture = $SaveViewport.get_texture() + var viewport_image = viewport_texture.get_data() + viewport_image.save_png(filename) func precalculate_texture(node, size, object, method, args): if node == null: return null - $SaveViewport.size = Vector2(size, size) - $SaveViewport/ColorRect.rect_position = Vector2(0, 0) - $SaveViewport/ColorRect.rect_size = Vector2(size, size) - setup_material($SaveViewport/ColorRect.material, node.get_textures(), generate_shader(node)) - $SaveViewport.render_target_update_mode = Viewport.UPDATE_ONCE - $SaveViewport.update_worlds() - $SaveViewport/Timer.start() - yield($SaveViewport/Timer, "timeout") - yield(get_tree(), "idle_frame") + render_to_viewport(node, size, "do_precalculate_texture", [ object, method, args ]) + +func do_precalculate_texture(object, method, args): 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/node_base.gd b/addons/procedural_material/node_base.gd index 32b504d..8f53771 100644 --- a/addons/procedural_material/node_base.gd +++ b/addons/procedural_material/node_base.gd @@ -130,6 +130,7 @@ func deserialize(data): offset = Vector2(data.node_position.x, data.node_position.y) for w in property_widgets: var variable = w.name - var value = deserialize_element(data[variable]) - set(variable, value) + if data.has(variable): + var value = deserialize_element(data[variable]) + set(variable, value) update_property_widgets() diff --git a/addons/procedural_material/nodes/material.gd b/addons/procedural_material/nodes/material.gd index 5c5488a..2608c0b 100644 --- a/addons/procedural_material/nodes/material.gd +++ b/addons/procedural_material/nodes/material.gd @@ -8,8 +8,14 @@ var texture_emission = null var texture_normal_map = null var texture_depth_map = null -var render_queue = [] # render queue for generated textures -var material_list = [] # materials to be updatedwith generated textures +const TEXTURE_LIST = [ + { port= 0, texture= "albedo" }, + { port= 1, texture= "metallic" }, + { port= 2, texture= "roughness" }, + { port= 3, texture= "emission" }, + { port= 4, texture= "normal_map" }, + { port= 5, texture= "depth_map" } +] func _ready(): pass @@ -31,34 +37,16 @@ func _get_shader_code(uv): func _get_state_variables(): return [ ] -func update_materials(ml): - material_list = ml - render_queue = [ - { port= 0, texture= "albedo" }, - { port= 1, texture= "metallic" }, - { port= 2, texture= "roughness" }, - { port= 3, texture= "emission" }, - { port= 4, texture= "normal_map" }, - { port= 5, texture= "depth_map" } - ] - process_render_queue() - -func process_render_queue(): - while !render_queue.empty(): - var job = render_queue.pop_front() - var source = get_source(job.port) - if source != null: - get_parent().precalculate_texture(source, 1024, self, "store_texture", [ job.texture ]) - return +func update_materials(material_list): + for t in TEXTURE_LIST: + var source = get_source(t.port) + if source == null: + set("texture_"+t.texture, null) else: - set("texture_"+job.texture, null) - do_update_materials() + get_parent().precalculate_texture(source, 1024, self, "store_texture", [ t.texture, material_list ]) -func store_texture(texture_name, texture): +func store_texture(texture_name, material_list, texture): set("texture_"+texture_name, texture) - process_render_queue() - -func do_update_materials(): for m in material_list: if m is SpatialMaterial: m.albedo_texture = texture_albedo @@ -80,3 +68,6 @@ func do_update_materials(): else: m.depth_enabled = false +func export_textures(prefix): + for t in TEXTURE_LIST: + get_parent().export_texture(get_source(t.port), prefix+"_"+t.texture+".png", 1024) diff --git a/addons/procedural_material/nodes/normal_map.gd b/addons/procedural_material/nodes/normal_map.gd index 798c07b..ec84237 100644 --- a/addons/procedural_material/nodes/normal_map.gd +++ b/addons/procedural_material/nodes/normal_map.gd @@ -29,6 +29,6 @@ func _get_shader_code(uv): rv.defs = src_code_tl.defs rv.code = src_code_tl.code+src_code_l.code+src_code_bl.code+src_code_tr.code rv.code += src_code_r.code+src_code_br.code+src_code_t.code+src_code_b.code - rv.code += "vec3 %s_%d_rgb = vec3(0.5, 0.5, 0.5) + 0.5*normalize(%.9f*vec3(%s+2.0*%s+%s-%s-2.0*%s-%s, %s+2.0*%s+%s-%s-2.0*%s-%s, 0.0) + vec3(0.0, 0.0, 1.0));\n" % [ name, variant_index, amount, src_code_tr.f, src_code_r.f, src_code_br.f, src_code_tl.f, src_code_l.f, src_code_bl.f, src_code_bl.f, src_code_b.f, src_code_br.f, src_code_tl.f, src_code_t.f, src_code_tr.f ] + rv.code += "vec3 %s_%d_rgb = vec3(0.5, 0.5, 0.5) + 0.5*normalize(%.9f*vec3(%s+2.0*%s+%s-%s-2.0*%s-%s, %s+2.0*%s+%s-%s-2.0*%s-%s, 0.0) + vec3(0.0, 0.0, -1.0));\n" % [ name, variant_index, amount, src_code_tr.f, src_code_r.f, src_code_br.f, src_code_tl.f, src_code_l.f, src_code_bl.f, src_code_bl.f, src_code_b.f, src_code_br.f, src_code_tl.f, src_code_t.f, src_code_tr.f ] rv.rgb = name+"_"+str(variant_index)+"_rgb" return rv diff --git a/addons/procedural_material/nodes/normal_map.tscn b/addons/procedural_material/nodes/normal_map.tscn index 3610135..68fd50d 100644 --- a/addons/procedural_material/nodes/normal_map.tscn +++ b/addons/procedural_material/nodes/normal_map.tscn @@ -5,7 +5,7 @@ [sub_resource type="Theme" id=1] -[node name="NormalMap" type="GraphNode" index="0"] +[node name="NormalMap" type="GraphNode"] anchor_left = 0.0 anchor_top = 0.0 diff --git a/addons/procedural_material/pm_editor.gd b/addons/procedural_material/pm_editor.gd index 9eea767..8caa06c 100644 --- a/addons/procedural_material/pm_editor.gd +++ b/addons/procedural_material/pm_editor.gd @@ -1,6 +1,8 @@ tool extends Container +var save_path = null + var popup_menu = null var popup_position = Vector2(0, 0) var selected_node = null @@ -8,9 +10,11 @@ var selected_node = null var texture_preview_material = null const MENU = [ - { command="load_texture", description="Load texture" }, - { command="save_texture", description="Save texture" }, - { command="export_texture", description="Export texture" }, + { command="new_texture", description="New material" }, + { command="load_texture", description="Load material" }, + { command="save_texture", description="Save material" }, + { command="save_texture_as", description="Save material as..." }, + { command="export_texture", description="Export material" }, { }, { submenu="generator", description="Generator" }, { name="image", description="Image", in_submenu="generator" }, @@ -78,35 +82,57 @@ func _on_PopupMenu_id_pressed(id): $GraphEdit.add_node(node, popup_position) node.offset = ($GraphEdit.scroll_offset + popup_position - $GraphEdit.rect_global_position) / $GraphEdit.zoom -func _on_GraphEdit_connection_request(from, from_slot, to, to_slot): - var disconnect = $GraphEdit.get_source(to, to_slot) - if disconnect != null: - $GraphEdit.disconnect_node(disconnect.node, disconnect.slot, to, to_slot) - $GraphEdit.connect_node(from, from_slot, to, to_slot) - generate_shader(); +func set_save_path(path): + save_path = path + if !Engine.editor_hint: + if save_path != null: + OS.set_window_title("Procedural textures (%s)" % save_path) + else: + OS.set_window_title("Procedural textures") + +func new_texture(): + $GraphEdit.new_material() + set_save_path(null) func load_texture(): + selected_node = null var dialog = FileDialog.new() add_child(dialog) dialog.rect_min_size = Vector2(500, 500) dialog.access = FileDialog.ACCESS_FILESYSTEM dialog.mode = FileDialog.MODE_OPEN_FILE dialog.add_filter("*.ptex;Procedural textures file") - dialog.connect("file_selected", $GraphEdit, "load_file") + dialog.connect("file_selected", self, "do_load_texture") dialog.popup_centered() +func do_load_texture(path): + set_save_path(path) + $GraphEdit.load_file(save_path) + func save_texture(): + if save_path != null: + $GraphEdit.save_file(save_path) + else: + save_texture_as() + +func save_texture_as(): var dialog = FileDialog.new() add_child(dialog) dialog.rect_min_size = Vector2(500, 500) dialog.access = FileDialog.ACCESS_FILESYSTEM dialog.mode = FileDialog.MODE_SAVE_FILE dialog.add_filter("*.ptex;Procedural textures file") - dialog.connect("file_selected", $GraphEdit, "save_file") + dialog.connect("file_selected", self, "do_save_texture") dialog.popup_centered() -func export_texture(size = 256): - $GraphEdit.export_texture(selected_node, "res://generated_image.png", size) +func do_save_texture(path): + set_save_path(path) + $GraphEdit.save_file(save_path) + +func export_texture(size = 512): + #$GraphEdit.export_texture(selected_node, "res://generated_image.png", size) + var prefix = save_path.left(save_path.rfind(".")) + $GraphEdit/Material.export_textures(prefix) func generate_shader(): if $GraphEdit/Material != null: diff --git a/addons/procedural_material/pm_editor.tscn b/addons/procedural_material/pm_editor.tscn index eb7fcf4..f4c29bf 100644 --- a/addons/procedural_material/pm_editor.tscn +++ b/addons/procedural_material/pm_editor.tscn @@ -25,6 +25,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; } @@ -89,17 +130,14 @@ 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 transform(vec2 uv, vec2 translate, float rotate, float scale) { vec2 rv; uv -= vec2(0.5); rv.x = cos(rotate)*uv.x + sin(rotate)*uv.y; rv.y = -sin(rotate)*uv.x + cos(rotate)*uv.y; rv /= scale; rv += vec2(0.5); + rv -= translate; return rv; } @@ -176,23 +214,27 @@ vec4 voronoi(vec2 uv, vec2 size, float intensity, int seed) { return vec4(point0, best_distance0*length(size)*intensity, edge_distance); } -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); } +float Perlin_f(vec2 uv) { return perlin(uv, vec2(4.000000, 4.000000), 6, 0.500000000, 2375); } +float Bricks_f(vec2 uv) { return bricks(uv, vec2(3, 6), 0.5, 0.05, 0.2); } +vec3 colorize_3_gradient(float x) { + if (x < 0.000000000) { + return vec3(0.273438007,0.273438007,0.273438007); + } else if (x < 1.000000000) { + return vec3(0.273438007,0.273438007,0.273438007)+x*vec3(-0.273438007,-0.273438007,-0.273438007); + } + return vec3(0.000000000,0.000000000,0.000000000); +} void fragment() { -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); +float Perlin_0_f = Perlin_f(UV+vec2(0.01, 0.0)); +float Perlin_1_f = Perlin_f(UV-vec2(0.01, 0.0)); +float Perlin_2_f = Perlin_f(UV+vec2(0.0, 0.01)); +float Perlin_3_f = Perlin_f(UV-vec2(0.0, 0.01)); +vec2 Warp_0_uv = UV+0.100000001*vec2((Perlin_0_f)-(Perlin_1_f), (Perlin_2_f)-(Perlin_3_f)); +float Bricks_0_f = Bricks_f(Warp_0_uv); +vec3 Warp_0_rgb = vec3(Bricks_0_f); +float Warp_0_f = dot(vec3(Bricks_0_f), vec3(1.0))/3.0; +vec3 colorize_3_0_rgb = colorize_3_gradient(Warp_0_f); +COLOR = vec4(colorize_3_0_rgb, 1.0); } " @@ -423,7 +465,7 @@ tracks/0/keys = { "times": PoolRealArray( 0, 0.2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 2, 194 ), Vector2( 2, 2 ) ] +"values": [ Vector2( 3, 251 ), Vector2( 2, 2 ) ] } tracks/1/type = "value" tracks/1/path = NodePath("SelectedPreview:rect_size") @@ -435,7 +477,7 @@ tracks/1/keys = { "times": PoolRealArray( 0, 0.2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 64, 64 ), Vector2( 256, 256 ) ] +"values": [ Vector2( 96, 96 ), Vector2( 346, 346 ) ] } tracks/2/type = "value" tracks/2/path = NodePath("MaterialPreview:render_target_update_mode") @@ -465,7 +507,7 @@ tracks/0/keys = { "times": PoolRealArray( 0, 0.2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 2, 2 ), Vector2( 2, 194 ) ] +"values": [ Vector2( 2, 2 ), Vector2( 2, 252 ) ] } tracks/1/type = "value" tracks/1/path = NodePath("SelectedPreview:rect_size") @@ -477,7 +519,7 @@ tracks/1/keys = { "times": PoolRealArray( 0, 0.2 ), "transitions": PoolRealArray( 1, 1 ), "update": 0, -"values": [ Vector2( 256, 256 ), Vector2( 64, 64 ) ] +"values": [ Vector2( 346, 346 ), Vector2( 96, 96 ) ] } tracks/2/type = "value" tracks/2/path = NodePath("MaterialPreview:render_target_update_mode") @@ -517,8 +559,8 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_right = 1024.0 -margin_bottom = 598.0 +margin_right = 1280.0 +margin_bottom = 718.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = true focus_mode = 2 @@ -549,13 +591,14 @@ autostart = false [node name="SaveViewport" type="Viewport" parent="GraphEdit" index="2"] +editor/display_folded = true arvr = false size = Vector2( 0, 0 ) own_world = true world = null transparent_bg = false -msaa = 0 -hdr = true +msaa = 2 +hdr = false disable_3d = false usage = 2 debug_draw = 0 @@ -605,8 +648,8 @@ anchor_left = 0.0 anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 -margin_right = 1024.0 -margin_bottom = 598.0 +margin_right = 1280.0 +margin_bottom = 718.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 2 @@ -621,11 +664,11 @@ anchor_left = 1.0 anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 0.0 -margin_left = -274.0 +margin_left = -364.0 margin_top = 3.0 margin_right = -14.0 -margin_bottom = 263.0 -rect_min_size = Vector2( 260, 260 ) +margin_bottom = 353.0 +rect_min_size = Vector2( 350, 350 ) rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 2 @@ -651,7 +694,7 @@ _sections_unfolded = [ "Playback Options" ] [node name="MaterialPreview" type="Viewport" parent="Preview/Preview" index="1"] arvr = false -size = Vector2( 260, 260 ) +size = Vector2( 350, 350 ) own_world = true world = null transparent_bg = false @@ -677,7 +720,7 @@ _sections_unfolded = [ "GUI", "Render Target" ] [node name="Objects" type="Spatial" parent="Preview/Preview/MaterialPreview" index="0"] -transform = Transform( -0.822992, 0, -0.568049, 0, 1, 0, 0.568049, 0, -0.822992, 0, 0, 0 ) +transform = Transform( -0.730986, 0, -0.682388, 0, 1, 0, 0.682388, 0, -0.730986, 0, 0, 0 ) _sections_unfolded = [ "Transform" ] [node name="Cube" type="MeshInstance" parent="Preview/Preview/MaterialPreview/Objects" index="0"] @@ -763,9 +806,9 @@ anchor_left = 1.0 anchor_top = 0.0 anchor_right = 1.0 anchor_bottom = 0.0 -margin_left = -258.0 +margin_left = -348.0 margin_top = 2.0 -margin_right = -148.0 +margin_right = -238.0 margin_bottom = 22.0 rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false @@ -821,10 +864,10 @@ anchor_top = 0.0 anchor_right = 0.0 anchor_bottom = 0.0 margin_left = 2.0 -margin_top = 194.0 -margin_right = 66.0 -margin_bottom = 258.0 -rect_min_size = Vector2( 64, 64 ) +margin_top = 252.0 +margin_right = 98.0 +margin_bottom = 348.0 +rect_min_size = Vector2( 96, 96 ) rect_pivot_offset = Vector2( 0, 0 ) rect_clip_content = false mouse_filter = 0 @@ -832,7 +875,7 @@ mouse_default_cursor_shape = 0 size_flags_horizontal = 8 size_flags_vertical = 0 color = Color( 1, 1, 1, 1 ) -_sections_unfolded = [ "Material", "Mouse" ] +_sections_unfolded = [ "Material", "Mouse", "Rect" ] [node name="SelectedPreviewAnimation" type="AnimationPlayer" parent="Preview/Preview" index="5"] @@ -845,7 +888,9 @@ anims/maximize = SubResource( 11 ) anims/minimize = SubResource( 12 ) blend_times = [ ] -[connection signal="connection_request" from="GraphEdit" to="." method="_on_GraphEdit_connection_request"] +[connection signal="connection_request" from="GraphEdit" to="GraphEdit" method="_on_GraphEdit_connection_request"] + +[connection signal="disconnection_request" from="GraphEdit" to="GraphEdit" method="_on_GraphEdit_disconnection_request"] [connection signal="graph_changed" from="GraphEdit" to="." method="generate_shader"] diff --git a/doc/screenshot.png b/doc/screenshot.png index 48d8c18..1b0d348 100644 Binary files a/doc/screenshot.png and b/doc/screenshot.png differ diff --git a/examples/bricks.ptex b/examples/bricks.ptex index ee8ab58..53226e7 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":"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 +{"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"},{"name":"Material","node_position":{"x":1024,"y":204},"type":"material"},{"iterations":7,"name":"Perlin2","node_position":{"x":253,"y":-28},"persistence":0.75,"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.054545,"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"},{"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.645455,"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"}]} \ No newline at end of file diff --git a/examples/lava.ptex b/examples/lava.ptex index e662906..21c050b 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":"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 +{"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"},{"gradient":[{"b":0.032597,"g":0.032597,"pos":0.054545,"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.272727,"r":1},{"b":0,"g":0,"pos":0.8,"r":0}],"name":"colorize_2","node_position":{"x":653,"y":140.5},"type":"colorize"},{"gradient":[{"b":0,"g":0.765625,"pos":0,"r":1},{"b":0,"g":0,"pos":0.163636,"r":1},{"b":0,"g":0,"pos":0.245455,"r":0}],"name":"colorize_1","node_position":{"x":646,"y":223},"type":"colorize"},{"amount":0.9,"name":"normal_map_0","node_position":{"x":658,"y":309.5},"type":"normal_map"},{"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":658,"y":404.25},"type":"colorize"},{"amount":0.45,"blend_type":1,"name":"blend_0","node_position":{"x":475,"y":-30},"type":"blend"},{"amount":0.3,"name":"warp_0","node_position":{"x":338,"y":196},"type":"warp"},{"intensity":0.55,"name":"voronoi_0","node_position":{"x":130,"y":299},"scale_x":6,"scale_y":6,"type":"voronoi"},{"iterations":8,"name":"perlin_0","node_position":{"x":190,"y":-14},"persistence":0.75,"scale_x":4,"scale_y":4,"type":"perlin"}]} \ No newline at end of file diff --git a/examples/wood_with_blood.ptex b/examples/wood_with_blood.ptex index 2da1840..19ad47d 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},{"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 +{"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"},{"name":"Material","node_position":{"x":938,"y":96},"type":"material"},{"gradient":[{"b":0,"g":0,"pos":0.490909,"r":0},{"b":1,"g":1,"pos":0.618182,"r":1}],"name":"colorize_3","node_position":{"x":487.633789,"y":65},"type":"colorize"},{"iterations":6,"name":"perlin_0","node_position":{"x":12,"y":225.5},"persistence":0.7,"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,"g":0.336914,"pos":0,"r":0.598958},{"b":0,"g":0.454102,"pos":0.118182,"r":0.807292},{"b":0,"g":0.37793,"pos":0.245455,"r":0.671875},{"b":0,"g":0.427734,"pos":0.354545,"r":0.760417},{"b":0.017795,"g":0.488254,"pos":0.527273,"r":0.854167},{"b":0,"g":0.37793,"pos":0.645455,"r":0.671875},{"b":0,"g":0.439453,"pos":0.845455,"r":0.78125},{"b":0,"g":0.357422,"pos":1,"r":0.635417}],"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.55,"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"},{"gradient":[{"b":0,"g":0,"pos":0,"r":0.515625},{"b":0,"g":0,"pos":0.145455,"r":0.25},{"b":0,"g":0,"pos":0.445455,"r":0.515625},{"b":0.007871,"g":0.007871,"pos":0.745455,"r":0.144176},{"b":0,"g":0,"pos":1,"r":0.322917}],"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"},{"amount":0.4,"name":"normal_map_0","node_position":{"x":724.633789,"y":345.5},"type":"normal_map"},{"amount":0.5,"blend_type":0,"name":"blend_1","node_position":{"x":707.633789,"y":-68},"type":"blend"}]} \ No newline at end of file diff --git a/generated_image.png.import b/generated_image.png.import new file mode 100644 index 0000000..3a9b4f1 --- /dev/null +++ b/generated_image.png.import @@ -0,0 +1,30 @@ +[remap] + +importer="texture" +type="StreamTexture" +path.s3tc="res://.import/generated_image.png-791fdae0ab5829f929b4d82eecbe4bc3.s3tc.stex" +path.etc2="res://.import/generated_image.png-791fdae0ab5829f929b4d82eecbe4bc3.etc2.stex" + +[deps] + +source_file="res://generated_image.png" +dest_files=[ "res://.import/generated_image.png-791fdae0ab5829f929b4d82eecbe4bc3.s3tc.stex", "res://.import/generated_image.png-791fdae0ab5829f929b4d82eecbe4bc3.etc2.stex" ] + +[params] + +compress/mode=2 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/normal_map=0 +flags/repeat=true +flags/filter=true +flags/mipmaps=true +flags/anisotropic=false +flags/srgb=1 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/project.godot b/project.godot index cf597f6..0f45716 100644 --- a/project.godot +++ b/project.godot @@ -10,10 +10,15 @@ config_version=3 [application] -config/name="Procedural textures addon" +config/name="Procedural textures" run/main_scene="res://addons/procedural_material/pm_editor.tscn" config/icon="res://icon.png" +[display] + +window/size/width=1280 +window/size/height=720 + [editor_plugins] enabled=PoolStringArray( "procedural_material" )