Skip to content

Commit

Permalink
Tiny fix in map generator
Browse files Browse the repository at this point in the history
  • Loading branch information
RodZill4 committed Aug 5, 2023
1 parent bad9560 commit 2a9ea84
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions addons/material_maker/map_renderer/map_generator.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture)
normalize_pipeline.clear()
normalize_pipeline.add_parameter_or_texture("tex", "sampler2D", texture)
await normalize_pipeline.set_shader(load("res://addons/material_maker/map_renderer/normalize_compute.tres").text, 3)
await normalize_pipeline.render(texture, size)
await normalize_pipeline.render(texture, Vector2i(size, size))

# Denoise
print("Denoising...")
Expand All @@ -63,7 +63,7 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture)
denoise_pipeline.add_parameter_or_texture("tex", "sampler2D", texture)
denoise_pipeline.add_parameter_or_texture("radius", "int", 3)
await denoise_pipeline.set_shader(load("res://addons/material_maker/map_renderer/denoise_compute.tres").text, 3)
await denoise_pipeline.render(texture, size)
await denoise_pipeline.render(texture, Vector2i(size, size))

# Extend the map past seams
if pixels > 0:
Expand All @@ -72,11 +72,11 @@ static func generate(mesh : Mesh, map : String, size : int, texture : MMTexture)
compute_pipeline.add_parameter_or_texture("tex", "sampler2D", texture)
compute_pipeline.add_parameter_or_texture("pixels", "int", pixels)
await compute_pipeline.set_shader(load("res://addons/material_maker/map_renderer/dilate_1_compute.tres").text, 3)
await compute_pipeline.render(texture, size)
await compute_pipeline.render(texture, Vector2i(size, size))

compute_pipeline.clear()
compute_pipeline.add_parameter_or_texture("tex", "sampler2D", texture)
compute_pipeline.add_parameter_or_texture("pixels", "int", pixels)
await compute_pipeline.set_shader(load("res://addons/material_maker/map_renderer/dilate_2_compute.tres").text, 3)
await compute_pipeline.render(texture, size)
await compute_pipeline.render(texture, Vector2i(size, size))

0 comments on commit 2a9ea84

Please sign in to comment.