瀏覽代碼

Make texture preview and picker use mipmap filter

MrBlockers 2 年之前
父節點
當前提交
4bddec7003
共有 2 個文件被更改,包括 2 次插入1 次删除
  1. 1 0
      editor/editor_resource_picker.cpp
  2. 1 1
      editor/plugins/texture_editor_plugin.cpp

+ 1 - 0
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);
 	}
 

+ 1 - 1
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);