Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor is scaled with visible pixelation on macOS when using multiple monitors with different scaling factors #89019

Closed
KevBruner opened this issue Feb 29, 2024 · 24 comments · Fixed by #93950

Comments

@KevBruner
Copy link

KevBruner commented Feb 29, 2024

Tested versions

Reproducible in 4.2 and 4.3, MacOS 14.1.2 (23B2091), Apple M3 Max, external 3840x1600 display. Godot default settings.

System information

MacOS 14.1.2 (23B2091), Apple M3 Max, external 3840x1600 display.

Issue description

Screenshot 2024-02-29 at 12 08 00 PM
The editor will "flicker" (every second or two, not at a very high rate), between what is shown in the screen shot (poorly antialiased fonts) and properly rendered fonts. The "flickering" is not a constant rate, and seems to be impacted by moving windows, resizing, open/closing windows, etc. Generally changing the work Godot is doing in some way.

Steps to reproduce

This is happening continuously from opening the editor for me.

Minimal reproduction project (MRP)

no required.

  • Production edit (keywords for easier searching): pixelated
@Calinou
Copy link
Member

Calinou commented Feb 29, 2024

If you set the Font Antialiasing editor setting to None as shown in the screenshot, it's expected that fonts will generally look bad. It only really looks good for very specific fonts designed for a specific size.

@KevBruner
Copy link
Author

KevBruner commented Feb 29, 2024 via email

@KevBruner
Copy link
Author

KevBruner commented Feb 29, 2024 via email

@Calinou
Copy link
Member

Calinou commented Feb 29, 2024

Can you reproduce this issue without an external display connected?

@KevBruner
Copy link
Author

KevBruner commented Feb 29, 2024 via email

@Calinou
Copy link
Member

Calinou commented Feb 29, 2024

This is likely due to the same cause as #61357.

@KevBruner
Copy link
Author

KevBruner commented Feb 29, 2024 via email

@adamscott
Copy link
Member

Reproduced by the user paul on the developer's chat.

Maybe it could help? cc. @bruvzg

@noeldodd
Copy link

noeldodd commented May 3, 2024

I came here looking for a fix for this; M2 Air + Samsung 30" external monitor.

I noticed that clicking between the text editor area and the output/debugger below it would flip the fonts from proper aliasing to bad aliasing. I thought I could screen record > gif this, but if you try and capture it, it doesn't flip back to normal.

I tried Quicktime, no dice it just looks bad all the time, and if OBS is running it won't flip back and forth at all (recording or not).

So whatever is hooking into the screen to capture frames prevents it from going back to normal.

edit: setting Editor Settings > Interface / Editor / Update Continuously = True seems to quash the bad aliasing.

@KevBruner
Copy link
Author

KevBruner commented May 3, 2024 via email

@Calinou Calinou changed the title Editor font aliasing "sparkles" on Mac Editor is scaled with nearest-neighbor filtering on macOS when using multiple monitors with different scaling factors May 21, 2024
@Calinou Calinou changed the title Editor is scaled with nearest-neighbor filtering on macOS when using multiple monitors with different scaling factors Editor is scaled with visible pixelation on macOS when using multiple monitors with different scaling factors May 21, 2024
@Calinou Calinou added this to the 4.3 milestone May 24, 2024
@akx
Copy link
Contributor

akx commented Jun 8, 2024

+1 (v4.3.beta.custom_build [705b7a0]) on macOS Sonoma 14.2.1.

When the main UI window is interacted with, the pixelation goes away for a moment, but when it's idle, it returns to shoddy. As luck would not have it, this doesn't occur when recording the screen with QT (it remains terrible all the time), so please enjoy a phone video of a screen (possibly the only time in history doing that is a good idea for a bug report...).

a.mp4
  • Enabling "Update Continuously" mitigates the problem.
  • With some editor windows (shader/script) on the Retina screen and the main UI on a non-Retina external display, the windows on the retina screen work fine all the time. When those editor windows are moved to the external screen, they occasionally "heal" when interacted with... but not always.

@MrZak-dev
Copy link

MrZak-dev commented Jun 14, 2024

image

Experiencing the same issue when using Forward+ OR Mobile renderers but not in Compatibility renderer .
This is only happening in my external display, when i move the godot editor window to the mac's original display, it works fine .

Godot 4.3 Beta 1 
Mac M2 Pro.

@clayjohn clayjohn modified the milestones: 4.3, 4.4 Jun 27, 2024
@sinecure-dev
Copy link

Screenshot 2024-06-27 at 3 18 38 PM

I'm experiencing the same issue since moving from Godot 4.2 to 4.3 beta 2. It might seem like a small issue, but the crunchiness flickers between levels of distortion and certain symbols become difficult to read. A few hours of coding like this gets very frustrating. This issue is not present in 4.2. I use an M2 MacBook Pro. The only way to use multiple monitors with the MacBook pro is to use DisplayLink and a hub to extend the displays. So I have my high DPI MacBook Pro screen and then two 1080p Dell monitors. The crunchy text issues occur only on the extended Dell monitors. Setting the editor to update continuously does not resolve the problem. I hope someone can figure out what broke the text rendering on Macs.

@Calinou
Copy link
Member

Calinou commented Jun 28, 2024

I hope someone can figure out what broke the text rendering on Macs.

You could look into bisecting the regression to precisely determine which commit caused the issue. I can't reproduce this on my end and it seems other users can reproduce the issue on both 4.2 and 4.3, so you would need to be the one bisecting the regression.

@Alex2782
Copy link
Contributor

I'll try bisecting the regression in the next few days as soon as I find the time.

In version 4.3-dev3 the font still looks ok, from version 4.3-dev4 it no longer does.

image

Bildschirmfoto 2024-06-29 um 02 39 09

@poga
Copy link
Contributor

poga commented Jun 29, 2024

FYI. The 4.3-dev3 universal build for macos I grab from here (v4.3.dev3.official [36e943b6b]) does not have the issue. However, when building from source using the same commit, the problem occurs.

Also there's some warning and error when running the local build (from source) in CLI:

Godot Engine v4.3.dev.custom_build.36e943b6b - https://godotengine.org
Vulkan API 1.2.283 - Forward Mobile - Using Vulkan Device #0: Apple - Apple M1
WARNING: Invalid pipelines cache header.
     at: pipeline_cache_create (drivers/vulkan/rendering_device_driver_vulkan.cpp:2264)
 
ERROR: Condition "p_idx >= item_start + item_count" is true.
   at: global_menu_remove_item (platform/macos/display_server_macos.mm:1909)
ERROR: Condition "p_idx >= item_start + item_count" is true.
   at: global_menu_remove_item (platform/macos/display_server_macos.mm:1909)
WARNING: 1 RID of type "StorageBuffer" was leaked.
     at: _free_rids (servers/rendering/rendering_device.cpp:5002)
WARNING: 1 RID of type "Framebuffer" was leaked.
     at: _free_rids (servers/rendering/rendering_device.cpp:5002)
WARNING: 4 RIDs of type "Texture" were leaked.
     at: finalize (servers/rendering/rendering_device.cpp:5150)

Running the official build from CLI does not show the above error:

Godot Engine v4.3.dev3.official.36e943b6b - https://godotengine.org
OpenGL API 4.1 Metal - 88.1 - Compatibility - Using Device: Apple - Apple M1
 
Editing project: /Users/poga/new-game-project

For dev4 official build, It seems that it also use OpenGL 4.1 Metal but the problem occurred.

Godot Engine v4.3.dev4.official.df78c0636 - https://godotengine.org
OpenGL API 4.1 Metal - 88.1 - Compatibility - Using Device: Apple - Apple M1

For VulkanSDK, I tried both 1.3.283.0 and 1.3.268.1. They all have the same problem when compiling from source.

MacOS: Sonoma 14.5
CPU: Apple M1

@akien-mga akien-mga modified the milestones: 4.4, 4.3 Jun 29, 2024
@akien-mga akien-mga moved this from Unassessed to Release Blocker in 4.x Release Blockers Jun 29, 2024
@poga
Copy link
Contributor

poga commented Jun 29, 2024

Did some more test using 4.3-beta2. I'm using an external monitor (4K) connected to a M1 macbook pro.

Under MacOS Preference -> Display, There's a scaling option:
Screenshot 2024-06-29 at 20 00 58

If I set it to default (1920x1080) for the external display. The problem instantly disappear for the currently running editor.
If I switch it back to "More space" (3840x2160) The problem instantly comes back for the running editor.

Hope this helps.

@Alex2782
Copy link
Contributor

Alex2782 commented Jun 29, 2024

I also couldn't compile a good version without issues.

  • 4.2/dev3 <--> 4.2/dev4 (all git bisect bad)
  • VulkanSDK/1.3.250.1

https://docs.godotengine.org/en/latest/contributing/workflow/bisecting_regressions.html

go to the folder that contains the pre-release you downloaded and look for the README.txt

V4.2

https://downloads.tuxfamily.org/godotengine/4.2/dev3/README.txt
Built from commit 013e8e3afb982d4b230f0039b6dc248b48794ab9

https://downloads.tuxfamily.org/godotengine/4.2/dev4/README.txt
Built from commit 549fcce5f8f7beace3e5c90e9bbe4335d4fd1476


V4.3
https://downloads.tuxfamily.org/godotengine/4.3/
no README.txt

@akien-mga
Copy link
Member

Since this doesn't seem reproducible in custom builds, it's likely related to the toolchains we used for the official builds of 4.3.dev3 and 4.3.dev4.

I updated all toolchains around that time, and based on what I wrote in godotengine/build-containers#138 (merged the day of the dev4 release, so I guess I used that version for it), the dev3 release still used the previous versions of the Xcode SDKs.

Version Xcode MacOSX SDK
4.2.x.stable, 4.3.dev3 and earlier 15 14.0
4.3.dev4 to 4.3.beta1 15.2 14.2
4.3.beta2 15.5 14.5

So this might be a change in behavior in the MacOSX SDK between 14.0 and 14.2.

I'll try to make a build of the current master branch with MacOSX SDK 14.0 to confirm this hypothesis.

@akien-mga
Copy link
Member

Could you test this build which is the current master branch (25de53e) but built against MacOSX SDK 14.0?

https://downloads.tuxfamily.org/godotengine/testing/4.3-beta-macosx-sdk-14.0/Godot_v4.3-beta-macosx-sdk-14.0_macos.universal.zip

@poga
Copy link
Contributor

poga commented Jun 29, 2024

Tested. Pixelation still happens
Screenshot 2024-06-30 at 01 36 52

@Alex2782
Copy link
Contributor

Alex2782 commented Jun 30, 2024

I also have issues with the master (14.0) version, the Metal and other graphics libs are identical to the dev3 version.

otool check
otool -l ~/Develop/Godot/Godot.4.3-dev3.app/Contents/MacOS/Godot > /tmp/Godot.4.3-dev3.log
otool -l ~/Develop/Godot/Godot.4.3-dev4.app/Contents/MacOS/Godot > /tmp/Godot.4.3-dev4.log
otool -l ~/Downloads/Godot.app/Contents/MacOS/Godot  > /tmp/Godot.4.3.master.log

current version
/System/Library/Frameworks/Metal.framework/Versions/A/Metal
4.3-dev3 = 341.16.0
4.3-dev4 = 341.35.0
4.3.master = 341.16.0

@Alex2782
Copy link
Contributor

Alex2782 commented Jul 1, 2024

The Window Size (Project Settings) is also calculated incorrectly, only half the size.

Screenshots

Bildschirmfoto 2024-07-01 um 01 40 34

(Screenshot size: 264 × 440, Test with Godot 4.2.1)
Bildschirmfoto 2024-07-01 um 02 00 47


int screen_count = get_screen_count();
for (int i = 0; i < screen_count; i++) {
display_max_scale = fmax(display_max_scale, screen_get_scale(i));
}

If I deactivate this calculation, then everything seems to be ok (on 4k and Full HD Display, Editor and Project)
But on the 4 k display, the font is slightly zoomed / enlarged. I think Godot would have to monitor more closely which display the window is currently on and calculate the scaling and window size dynamically.

from PR: #56825. (not yet checked why exactly this change was necessary)

Full HD and 4k Display

screen_count: 2
display_max_scale: 2.000000

Only Full HD Display

screen_count: 1
display_max_scale: 1.000000

@poga
Copy link
Contributor

poga commented Jul 5, 2024

can confirm that It worked 👍 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Release Blocker
Development

Successfully merging a pull request may close this issue.