milkytracker / MilkyTracker

An FT2 compatible music tracker
http://milkytracker.github.io/
Other
1.67k stars 160 forks source link

Better UI scaling #305

Open ghost opened 1 year ago

ghost commented 1 year ago

Currently when resizing the window, MilkyTracker seems to be using a linear scaling algorithm which causes text & the UI to be very blurry. Instead of linear, nearest neighbor could be used instead. Alternative options could be Lanczos, Bicubic or a pixel art upscaling algorithm which would work well with MilkyTracker's UI.

bratpeki commented 1 year ago

Agreed, I've always thought that this was odd. This might be the chosen style because the devs are porting to a lot of devices, some of which are very limited in resources, so this could be the best performance-wise.

ghost commented 1 year ago

Which platform are we talking about? The window scaling is IMO not in the platform independent MilkyTracker codebase, probably system functionality is used for that, so it's different for all platforms.

bratpeki commented 1 year ago

Best to presume it's on PC. In my case it's PC, Linux.

The up-scaled window is "mushy" (with pixels being blurred when their position is approximated on a display larger than the base one) instead of having a "crisp" display, like SchismTracker, for example, which does nearest-neighbor scaling.

This is (and again, I'm guessing, since I didn't find time to look at the codebase) most likely due to the fact MT runs on many different pieces of hardware, so it's the best choice to have the UI be functional (for example, some pixels could be lost if you're up-scaling the display, which doesn't happen with those "mushy" up-scaling techniques).

Deltafire commented 1 year ago

This is the OpenGL renderer. If you want the pixels to remain sharp, don't resize the window but instead change the display resolution in Config/Layout. Also try the x2, x4 multipliers.

bratpeki commented 1 year ago

Oh, so it's OpenGL code being written over SDL, I'm presuming? I know pailes' original PPUI was written in SDL, IIRC seeing that in some ModArchive forum a while back.

As good as that sounds, the main reason people up-scale the whole display is because MT has really tiny lettering on x1 scale, and they can't get their desired display properly on x2.

In my case, I have a laptop with a display res of 1600x900, and they smallest y-value for the resolution of MT is 480, meaning that I can't fit MT on my screen with a scale value of x2.

I believe I got around this by hex-editing the config file, but it gets tedious to edit it every time I change some setting.

urbanracer34 commented 1 year ago

I'm not sure if this is the same or not...

2019 Intel MacBook Pro running Ventura and I can't see the interface at all when I open up a file. Attached ScreenshotScreenshot 2023-05-30 at 8 25 58 PM

ghost commented 1 year ago

I'm not sure if this is the same or not...

2019 Intel MacBook Pro running Ventura and I can't see the interface at all when I open up a file. Attached ScreenshotScreenshot 2023-05-30 at 8 25 58 PM

Was it working before you updated to Ventura? You could can maybe solve that by reverting the local settings file.

bratpeki commented 1 year ago

I'm not sure if this is the same or not...

It isn't. We were discussing the scaling algorithm used by the software.

You might have found a glitch. Try hitting Ctrl+X when you open MT. This loads the main window section. Try other combinations as well, like Ctrl+S for the sample window, or Ctrl+D for the disk browser.

Let us know how it goes!

urbanracer34 commented 1 year ago

Hello,

It was working before I upgraded to Ventura.

Ctrl+X, S and D give a tone. Nothing happens. No change to the UI.

If you want to split this off into a separate issue, go ahead.

bratpeki commented 1 year ago

Sure, I suggest we open a new issue.

I'd ask you to open it and give an elaboration in detail, and some debug info if possible. @Deltafire or @coderofsalvation might give us more insight into that, though.

coderofsalvation commented 1 year ago

Thanks for the feedback @ghost (you seem to be deleted btw). TBH this is also part of the reasons why I started the MilkyTrackerX builds (with defaults for bigger screens). I sortof stayed away from modifying the scaling-code, as I don't have experience with this (and don't want to upset certain folks). My 'workaround' is also: never resize the window using the mouse/windowmanager (that's when things get blurry). So one might argue that a quick 'fix' is to disable window-resize (to force users to use the config windowsettings). Unfortunately I don't have a mac (it's still on my list to compile a MilkyTrackerX build on recent mac)