godot icon indicating copy to clipboard operation
godot copied to clipboard

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

Open KevBruner opened this issue 1 year ago • 15 comments

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

KevBruner avatar Feb 29 '24 20:02 KevBruner

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.

Calinou avatar Feb 29 '24 22:02 Calinou

I see the same results using any of the Font Aliasing settings. The screen shot just happened to have that option selected, but that setting has no discernable effect for me.

On Thu, Feb 29, 2024 at 2:38 PM Hugo Locurcio @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/89019#issuecomment-1972090997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3PK6OJ6SVCM33GM42ZNELYV6WVTAVCNFSM6AAAAABEATFDSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGA4TAOJZG4 . You are receiving this because you authored the thread.Message ID: @.***>

-- Kevin Bruner / President & CEO / Bruner House, LLC e-mail: @.*** phone: 415-419-6620 / [image: Twitter] https://twitter.com/kevbru// [image: LinkedIn] https://www.linkedin.com/in/kevin-bruner-59a329/ web: www.brunerhouse.com

KevBruner avatar Feb 29 '24 22:02 KevBruner

And the fonts DO render correctly much of the time. I am generally seeing 10-40 seconds of "good fonts" followed by 10-40 seconds of "bad fonts" regardless of various settings. Seems like perhaps an order of operations or stale state problem.

On Thu, Feb 29, 2024 at 2:49 PM Kevin Bruner @.***> wrote:

I see the same results using any of the Font Aliasing settings. The screen shot just happened to have that option selected, but that setting has no discernable effect for me.

On Thu, Feb 29, 2024 at 2:38 PM Hugo Locurcio @.***> wrote:

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.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/89019#issuecomment-1972090997, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3PK6OJ6SVCM33GM42ZNELYV6WVTAVCNFSM6AAAAABEATFDSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGA4TAOJZG4 . You are receiving this because you authored the thread.Message ID: @.***>

-- Kevin Bruner / President & CEO / Bruner House, LLC e-mail: @.*** phone: 415-419-6620 / [image: Twitter] https://twitter.com/kevbru// [image: LinkedIn] https://www.linkedin.com/in/kevin-bruner-59a329/ web: www.brunerhouse.com

-- Kevin Bruner / President & CEO / Bruner House, LLC e-mail: @.*** phone: 415-419-6620 / [image: Twitter] https://twitter.com/kevbru// [image: LinkedIn] https://www.linkedin.com/in/kevin-bruner-59a329/ web: www.brunerhouse.com

KevBruner avatar Feb 29 '24 22:02 KevBruner

Can you reproduce this issue without an external display connected?

Calinou avatar Feb 29 '24 22:02 Calinou

No. On my laptop's built-in monitor everything seems to render properly.

The external display is a Dell UltraSharp 38 @ 3840 x 1600

The built in display is:

Apple M3 Max:

Chipset Model: Apple M3 Max

Type: GPU

Bus: Built-In

Total Number of Cores: 30

Vendor: Apple (0x106b)

Metal Support: Metal 3

Displays:

Color LCD:

Display Type: Built-in Liquid Retina XDR Display

Resolution: 3024 x 1964 Retina

Main Display: Yes

Mirror: Off

Online: Yes

Automatically Adjust Brightness: Yes

Connection Type: Internal

On Thu, Feb 29, 2024 at 2:58 PM Hugo Locurcio @.***> wrote:

Can you reproduce this issue without an external display connected?

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/89019#issuecomment-1972115001, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3PK6IAACBA6DDXADUXGE3YV6ZC3AVCNFSM6AAAAABEATFDSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGEYTKMBQGE . You are receiving this because you authored the thread.Message ID: @.***>

-- Kevin Bruner / President & CEO / Bruner House, LLC e-mail: @.*** phone: 415-419-6620 / [image: Twitter] https://twitter.com/kevbru// [image: LinkedIn] https://www.linkedin.com/in/kevin-bruner-59a329/ web: www.brunerhouse.com

KevBruner avatar Feb 29 '24 23:02 KevBruner

This is likely due to the same cause as https://github.com/godotengine/godot/issues/61357.

Calinou avatar Feb 29 '24 23:02 Calinou

Does sound like it might be the same. I'll see if I can help out on the issue. Thanks!

On Thu, Feb 29, 2024 at 3:12 PM Hugo Locurcio @.***> wrote:

This is likely due to the same cause as #61357 https://github.com/godotengine/godot/issues/61357.

— Reply to this email directly, view it on GitHub https://github.com/godotengine/godot/issues/89019#issuecomment-1972129108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG3PK6KD2GLYGUMDZQIRMTLYV62VHAVCNFSM6AAAAABEATFDSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGEZDSMJQHA . You are receiving this because you authored the thread.Message ID: @.***>

-- Kevin Bruner / President & CEO / Bruner House, LLC e-mail: @.*** phone: 415-419-6620 / [image: Twitter] https://twitter.com/kevbru// [image: LinkedIn] https://www.linkedin.com/in/kevin-bruner-59a329/ web: www.brunerhouse.com

KevBruner avatar Feb 29 '24 23:02 KevBruner

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

Maybe it could help? cc. @bruvzg

adamscott avatar Mar 15 '24 19:03 adamscott

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.

noeldodd avatar May 03 '24 03:05 noeldodd

Am the quickest fix for this is to close the lid on the Mac which eliminates the “two monitors at different resolutions” situation, which appears to be the root of the problem. Sent from my iPhoneOn May 2, 2024, at 8:02 PM, noeldodd @.***> wrote: 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.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

KevBruner avatar May 03 '24 03:05 KevBruner

+1 (v4.3.beta.custom_build [705b7a0b0]) 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...).

https://github.com/godotengine/godot/assets/58669/0f26c47d-2680-4450-877b-2b7ef9c557c3

  • 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.

akx avatar Jun 08 '24 14:06 akx

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.

MrZak-dev avatar Jun 14 '24 12:06 MrZak-dev

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.

sinecure-dev avatar Jun 27 '24 20:06 sinecure-dev

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.

Calinou avatar Jun 28 '24 00:06 Calinou

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

Alex2782 avatar Jun 29 '24 00:06 Alex2782

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

poga avatar Jun 29 '24 11:06 poga

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.

poga avatar Jun 29 '24 12:06 poga

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

Alex2782 avatar Jun 29 '24 16:06 Alex2782

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 https://github.com/godotengine/build-containers/pull/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 avatar Jun 29 '24 17:06 akien-mga

Could you test this build which is the current master branch (25de53e147a04ba15afc461b3ad4aa1884ff927d) 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

akien-mga avatar Jun 29 '24 17:06 akien-mga

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

poga avatar Jun 29 '24 17:06 poga

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 avatar Jun 30 '24 02:06 Alex2782

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


https://github.com/godotengine/godot/blob/4ab8fb809396fa38ba929fec97cfcb7193f1c44d/platform/macos/display_server_macos.mm#L3487-L3490

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: https://github.com/godotengine/godot/pull/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

Alex2782 avatar Jul 01 '24 00:07 Alex2782

can confirm that It worked 👍 Thanks!

poga avatar Jul 05 '24 01:07 poga