From f91f85d00591a81f4319d5413fc1e8c5434d797a Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 19 Oct 2019 22:40:28 +0200 Subject: [PATCH] =?UTF-8?q?Enable=2016=C3=97=20anisotropic=20filtering=20i?= =?UTF-8?q?n=20the=203D=20preview?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This improves rendering quality, especially when viewing the texture at an oblique angle. --- addons/material_maker/engine/gen_material.gd | 5 +++++ project.godot | 1 + 2 files changed, 6 insertions(+) diff --git a/addons/material_maker/engine/gen_material.gd b/addons/material_maker/engine/gen_material.gd index 8d22aa0..49f1bfe 100644 --- a/addons/material_maker/engine/gen_material.gd +++ b/addons/material_maker/engine/gen_material.gd @@ -87,6 +87,8 @@ func render_textures(renderer : MMGenRenderer): texture = ImageTexture.new() result.copy_to_texture(texture) result.release() + # To work, this must be set after calling `copy_to_texture()` + texture.flags |= ImageTexture.FLAG_ANISOTROPIC_FILTER elif t.has("ports"): var context : MMGenContext = MMGenContext.new(renderer) var code = [] @@ -109,6 +111,9 @@ func render_textures(renderer : MMGenRenderer): texture = ImageTexture.new() result.copy_to_texture(texture) result.release() + # To work, this must be set after calling `copy_to_texture()` + texture.flags |= ImageTexture.FLAG_ANISOTROPIC_FILTER + generated_textures[t.texture] = texture func update_materials(material_list): diff --git a/project.godot b/project.godot index b328d67..01c3f93 100644 --- a/project.godot +++ b/project.godot @@ -179,4 +179,5 @@ file_logging/enable_file_logging=true [rendering] +quality/filters/anisotropic_filter_level=16 environment/default_environment="res://default_env.tres"