diff options
author | Clay John <claynjohn@gmail.com> | 2022-10-21 17:25:38 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-21 17:25:38 -0700 |
commit | dd8702f13d1c10e1164e5fe25356546dc026fbb2 (patch) | |
tree | 90ecdccc310dcaac246b69873902ddc91d8a5342 | |
parent | 021f524dfddc39c866a4937e77dff55b8ee026f5 (diff) | |
parent | 4bddec700358e2a019c49b61ea8ab02a064f171f (diff) |
Merge pull request #67426 from MrBlockers/blurry-texture-preview
Make texture preview filter setting content aware
-rw-r--r-- | editor/editor_resource_picker.cpp | 1 | ||||
-rw-r--r-- | editor/plugins/texture_editor_plugin.cpp | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/editor/editor_resource_picker.cpp b/editor/editor_resource_picker.cpp index 01816b7205..5545dc4ee2 100644 --- a/editor/editor_resource_picker.cpp +++ b/editor/editor_resource_picker.cpp @@ -958,6 +958,7 @@ EditorResourcePicker::EditorResourcePicker(bool p_hide_assign_button_controls) { preview_rect->set_offset(SIDE_TOP, 1); preview_rect->set_offset(SIDE_BOTTOM, -1); preview_rect->set_offset(SIDE_RIGHT, -1); + preview_rect->set_texture_filter(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); assign_button->add_child(preview_rect); } diff --git a/editor/plugins/texture_editor_plugin.cpp b/editor/plugins/texture_editor_plugin.cpp index be382759f5..4aed7a92a2 100644 --- a/editor/plugins/texture_editor_plugin.cpp +++ b/editor/plugins/texture_editor_plugin.cpp @@ -29,7 +29,6 @@ /*************************************************************************/ #include "texture_editor_plugin.h" - #include "editor/editor_scale.h" TextureRect *TexturePreview::get_texture_display() { @@ -123,6 +122,7 @@ TexturePreview::TexturePreview(Ref<Texture2D> p_texture, bool p_show_metadata) { add_child(checkerboard); texture_display = memnew(TextureRect); + texture_display->set_texture_filter(TEXTURE_FILTER_NEAREST_WITH_MIPMAPS); texture_display->set_texture(p_texture); texture_display->set_anchors_preset(TextureRect::PRESET_FULL_RECT); texture_display->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED); |