diff --git a/addons/material_maker/engine/dependencies.gd b/addons/material_maker/engine/dependencies.gd index aed4e28a0..2fe9961c2 100644 --- a/addons/material_maker/engine/dependencies.gd +++ b/addons/material_maker/engine/dependencies.gd @@ -129,8 +129,10 @@ func dependency_update(dependency_name : String, value = null, internal : bool = var b : Buffer = buffers[dependency_name] match b.status: Buffer.Invalidated: - print_debug("Buffer %s (updating) should not be invalidated status" % dependency_name) - is_buffer_just_updated = true + #print_debug("Buffer %s (updating) should not be invalidated" % dependency_name) + #is_buffer_just_updated = true + update() + return Buffer.UpdatingInvalidated: #print_debug("Buffer %s (updating) reset to invalidated status" % dependency_name) b.status = Buffer.Invalidated diff --git a/addons/material_maker/engine/nodes/gen_iterate_buffer.gd b/addons/material_maker/engine/nodes/gen_iterate_buffer.gd index 82dde0195..fd4d57673 100644 --- a/addons/material_maker/engine/nodes/gen_iterate_buffer.gd +++ b/addons/material_maker/engine/nodes/gen_iterate_buffer.gd @@ -20,7 +20,7 @@ var iteration_param_name : String var used_named_parameters : Array = [] -func _ready(): +func _init(): #texture.flags = Texture2D.FLAG_REPEAT shader_computes.append(MMShaderCompute.new()) shader_computes.append(MMShaderCompute.new()) diff --git a/addons/material_maker/map_generator/map_generator.gd b/addons/material_maker/map_generator/map_generator.gd index 5fe63e08f..69993c798 100644 --- a/addons/material_maker/map_generator/map_generator.gd +++ b/addons/material_maker/map_generator/map_generator.gd @@ -149,7 +149,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture) mesh_pipeline.add_parameter_or_texture("iteration", "int", 1) mesh_pipeline.add_parameter_or_texture("mode", "int", map_definition.mode) await mesh_pipeline.set_shader(vertex_shader, fragment_shader) - print("Casting %d rays..." % ray_count) + print.call_deferred("Casting %d rays..." % ray_count) for i in range(ray_count): progress.set_progress.call_deferred(float(i)/ray_count) mesh_pipeline.set_parameter("iteration", i+1) @@ -157,7 +157,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture) mesh_pipeline.in_thread_render(Vector2i(size, size), 3, texture) if map == "bent_normals": - print("Normalizing...") + print.call_deferred("Normalizing...") var normalize_pipeline : MMComputeShader = MMComputeShader.new() normalize_pipeline.clear() normalize_pipeline.add_parameter_or_texture("tex", "sampler2D", texture) @@ -166,7 +166,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture) # Denoise if true: - print("Denoising...") + print.call_deferred("Denoising...") var denoise_pipeline : MMComputeShader = MMComputeShader.new() denoise_pipeline.clear() denoise_pipeline.add_parameter_or_texture("tex", "sampler2D", texture) @@ -176,7 +176,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture) # Extend the map past seams if pixels > 0 and map_definition.has("postprocess"): - print("Postprocessing...") + print.call_deferred("Postprocessing...") #texture.save_to_file("d:/debug_x_%d.png" % debug_index) debug_index += 1 for p in map_definition.postprocess: @@ -214,7 +214,7 @@ static func get_map(mesh : Mesh, map : String, size : int = 2048, force_generate if MAP_DEFINITIONS[map].has("dependencies"): for d in MAP_DEFINITIONS[map].dependencies: await get_map(mesh, d, size) - print("Creating map ", field_name, " for mesh ", mesh) + #print("Creating map ", field_name, " for mesh ", mesh) while not mesh_maps[mesh].has(field_name): if busy: await mm_globals.get_tree().process_frame @@ -222,7 +222,6 @@ static func get_map(mesh : Mesh, map : String, size : int = 2048, force_generate busy = true var texture : MMTexture = MMTexture.new() await mm_renderer.thread_run(generate, [mesh, map, size, texture]) - print("generated texture ", texture) mesh_maps[mesh][field_name] = texture busy = false return mesh_maps[mesh][field_name] as MMTexture