k4zmu2a / SpaceCadetPinball

Decompilation of 3D Pinball for Windows – Space Cadet
MIT License
3.23k stars 203 forks source link

Game scales improperly with fractional scaling enabled in Wayland #203

Open klazoklazo opened 3 months ago

klazoklazo commented 3 months ago

When enabling fractional scaling (I currently have it enabled in KDE through Wayland), the program will similarly follow the scaling options. This should not be the desired outcome since it leads to improper integer scaling ratcheting, and additional filtering. Both seemingly cannot be removed without disabling fractional scaling.

Full screenshot

image (Game is too zoomed out for 4k, even with integer scaling)

Blown up screenshot to show undesired filtering

image (Note the blurry text with 1x UI scale and blurry graphics with linear filtering already disabled)

k4zmu2a commented 3 months ago

This is probably a bug, or a lack of feature. Currently there is no special code for various DPI scenarios. I never dealt with fractional scaling before; I will look into how it works with SDL. At this point, I can’t guaranty that I will be able to fix this issue.

klazoklazo commented 3 months ago

That's perfectly fine! I'm glad I could at least bring this to your attention.

Tynach commented 2 weeks ago

This is probably just how the Dear Imgui widget toolkit works.. Even without setting any system-wide fractional scaling value (using X11 and having a DPI of 96 set globally), the text is crisp at when the 'UI Scale' option in the menus is set to 1.00, but gets blurry just like your screenshot when you set that to literally any other value.

Doesn't matter what font is set, the font is rendered at one specific size, converted to bitmap images, and then those bitmap images are what's scaled up.

Honestly, I really REALLY don't like Dear Imgui as a result of this. Sure, it's nice and easy to embed into SDL applications, and gets the job done with a low footprint, but it really doesn't work when it comes to the needs of modern font rendering.

It also doesn't support font kerning, let alone some of the advanced OpenType features required by some languages (such as conjunct forms for Indic, and required ligatures for Arabic).