Closed akemn closed 3 years ago
Curiouser and curiouser... when I start Brogue with the largest font size on my normal-DPI screen, it doesn't look nearly as bad as the attached image. I think SDL is doing something weird here.
Could you help me by answering these questions? (Any reader with the same issue can do the same)
- What resolution is your display?
2560x1600 and 227ppi, but scaled to "look like" 1440x900. This is the default macbook air "retina" display config.
- Do you have a display scale/zoom set in your system preferences? If so, what level is it?
Yes, it is set to default: "looks like 1440x900"
- Does the pixellation persist at smaller font sizes (press '-')?
Interesting! Yes it does...until the text changes to a different font for the three smallest sizes. Those three use a different font that looks blocky but crisp, except for the "musical note" glyph. Screenshots: Notice the "musical note" symbol in the first screenshot -- still having the same problem as in larger font sizes.
- Press '+' until you reach the largest font size - roughly how big is the game window compared to your display?
I cannot seem to reach the maximum font size? The window continues getting larger until it fills the screen. Actually it goes slightly wider than the screen width. If I then continue pressing '+', it loops between three views where the left padding (space from window edge to where your '@' is shown) is -- guesstimating here -- [10, 5, 0] char widths.
Please let me know if I can help provide any other info or clarification.
Ah ok!! That screenshot of the lower font size has explained what's going on, thank you!
It appears SDL window surface "pixels" are actually 2x2 blocks of physical pixels on macOS. Apple seems to call these blocks "points" in their documentation:
When you run a high-resolution-savvy app on a high-resolution device, the text, vector drawing, and UI controls are sharp. This is due to the increased pixel density—pixels are smaller and there are more of them per unit area. Each point in user space is backed by four pixels.
The behaviour of Surfaces on DPI-aware windows is completely undocumented in SDL. Based on what we've worked out here, it seems like it's not actually possible to draw to the physical pixels.
How bad/noticeable is this pixelation is on a high-DPI display? Fixing it is possible but would complicate the current renderer.
Well, imho it looks bad. I'm sure part of it is being used to the normal-looking text in the 1.7.5 version. And of course all other text rendered on screen is not looking this way. I suppose this means the renderer has changed from vanilla?
I suppose this means the renderer has changed from vanilla?
Yes, vanilla had a Mac-specific renderer that we've replaced with a more portable one.
Linux is affected by the same problem on wayland/hidpi displays.
Windows 10 is also affected. When the "Make everything bigger" setting is set above 100%, Windows upscales the window using bilinear interpolation, making Brogue CE 1.9.2 terribly blurry.
Fortunately there is a simple workaround: right-click on Brogue.exe, open the Properties > Compatibility > "Change high DPI settings", and tick the "High DPI scaling override":
Then Brogue is beautiful again.
Edit: I submitted PR #205 for Windows builds, so that the workaround is not necessary.
Fixed by the linked PR
The linked PR only seems to fix it for Windows, not macOS?
@jamesgecko It fixes it on macOS too. If you are building it yourself, just make sure you run the Brogue.app
bundle, not the bin/brogue
binary. The bundle contains a setting (NSHighResolutionCapable
in Info.plist
) to inform macOS that the app is hidpi-aware. Which it is, thanks to SDL's hardware-accelerated renderers.
make clean
make MAC_APP=YES
make Brogue.app
You may also need to ensure that you have a recent version of SDL2. I'm not sure older versions fully support Catalina and Big Sur. Try with 2.0.12 at the least.
Wow, great work Antony et al. Very exciting.
Confirming this fix is not currently represented in any pre-built Release binaries?
Correct - it will appear in 1.9.3
On macOS 10.15.4, rendering is quite pixelated and low-resolution, compared with original Brogue. See screenshots below.
LEFT: Brogue 1.7.5 =====> RIGHT: BrogueCE 1.8.3
Edit: Note that if not on a high-DPI display, you may need to zoom in on this page (cmd+ or ctrl+) to make the difference obvious.