Nearest neighbor resolution upscaling

Here you can discuss ReactOS related topics.

Moderator: Moderator Team

Post Reply
Nintendo Maniac 64
Posts: 234
Joined: Sun Sep 17, 2006 3:08 am
Location: Northeast Ohio, USA

Nearest neighbor resolution upscaling

Post by Nintendo Maniac 64 »

Another thing that really annoys me is upscaling filters that are on all the time. 640x480 should look great on 1280x1024 due to 4:1 exact pixel mapping, but unfortunately this isn't the case usually.

Similar to the cleartype issue, the simplest way to know when to do this would be to just calculate when the resolution you're trying to display is an exact multiple of your native horizontal or vertical resolution.


In a perfect world, for non-multiple resolutions, nearest neighbor scaling would still be done for a portion of the scaling before kicking in the final bilinear upscale (example: 640x480 -> 1920x1440 -> 2560x1600) - this is a much clearer picture than bilinear scaling the whole way, but is also more pixelated. On the same note, fitting 800x600 onto something like 1280x1024 looks sharper by doing nearest neighbor to 1600x1200 and then bilinear downscaling to 1280x960, but again is also more pixelated. I guess these would depend on the user's needs and programs used. (spite-based games would look better, but visual novels would look worse).

Optionally there could be an option to just add borders instead of doing the final-stage bilinear scaling (640x480 -> 1280x960 would have 60 pixel-bars on top & bottom on a 1080p screen). There could even be another option for nearest neighbor scaling the whole way whether or not it's an exact multiple (the non-even pixels are hardly noticeable when mapping very low-res to very high-res, such as 320x240 on 1920x1080).


All these should be optional of course, and heck should probably be turned off by default even. This way monitor and/or GPU makers can't get away with just using uber-crappy scalers (though I don't think this has stopped Intel, but hey ALL their GPUs suck).
User avatar
Black_Fox
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

Re: Nearest neighbor resolution upscaling

Post by Black_Fox »

Nintendo Maniac 64 wrote:640x480 should look great on 1280x1024 due to 4:1 exact pixel mapping
640x480 is 4:3 and 1280x1024 is 5:4, how could that be exact pixel mapping?
Nintendo Maniac 64
Posts: 234
Joined: Sun Sep 17, 2006 3:08 am
Location: Northeast Ohio, USA

Re: Nearest neighbor resolution upscaling

Post by Nintendo Maniac 64 »

But 1280x960 should map perfectly to 1280x1024...
User avatar
Black_Fox
Posts: 1584
Joined: Fri Feb 15, 2008 9:44 pm
Location: Czechia

Re: Nearest neighbor resolution upscaling

Post by Black_Fox »

You're right in the thought that there would be just some unused pixels on the top and bottom sides, but that's not how the displays work nowadays :)
Nintendo Maniac 64
Posts: 234
Joined: Sun Sep 17, 2006 3:08 am
Location: Northeast Ohio, USA

Re: Nearest neighbor resolution upscaling

Post by Nintendo Maniac 64 »

I don't know about you, but normally the aspect ratio IS preserved when displaying a non-native resolution.

Heck just today I was at Walmart trying a laptop with Windows 7 and a 1600x900 display, and setting it to 800x600 put black bars on the sides... and this was crappy INTEL integrated graphics.
Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: Nearest neighbor resolution upscaling

Post by Z98 »

Why in the world would a decent graphics card/monitor combo even let you set resolutions that don't make sense?
Nintendo Maniac 64
Posts: 234
Joined: Sun Sep 17, 2006 3:08 am
Location: Northeast Ohio, USA

Re: Nearest neighbor resolution upscaling

Post by Nintendo Maniac 64 »

Why WOULDN'T it?

A good example are visual novels - most of them use the 640x480 or 800x600 resolutions. On most modern higher-DPI LCD screens, a windowed 640x480 program window (especially for heavy reading), is SMALL. So in many cases, you have no choice but to run fullscreen if you want to actually be able to read a visual novel for longer than 5 minutes without your eyes bleeding.
Z98
Release Engineer
Posts: 3379
Joined: Tue May 02, 2006 8:16 pm
Contact:

Re: Nearest neighbor resolution upscaling

Post by Z98 »

That last one about readability is subjective. I've personally never understood what people keep complaining about. And as for the whole "upscale even if there are black areas" desire, I'm almost certain that's a driver/hardware issue. Not sure what an OS is capable of doing to try to achieve that. And trying to override the resolution as set by an application is not easy. It's effectively guesswork, and the OS is almost certain to guess wrong. I don't mean wrong in the sense that it picks a bad resolution, I mean wrong in the sense that sometimes the resolution should not have been overridden and now suddenly you have weird display skews. There is almost no way to know whether this would happen, meaning this entire process would have to be manual to avoid screwups. And I believe Raymond Chen had an interesting post about why Windows doesn't support resolution independence. Whether ROS would be capable of overcoming that without breaking god knows what, I don't know. This would not be an easy thing to attempt.
Nintendo Maniac 64
Posts: 234
Joined: Sun Sep 17, 2006 3:08 am
Location: Northeast Ohio, USA

Re: Nearest neighbor resolution upscaling

Post by Nintendo Maniac 64 »

Wait wait wait...

I never was talking about overriding the resolution of an individual window or programs. I'm talking about the main resolution setting that you set in the Windows control panel under "Display" and/or the Desktop properties and stuff - which is commonly changed on the fly temporarily if a lower-res program is set to fullscreen (such as older games like DOOM or darned-near every single visual novel made in existence)


However, it would be pretty freakin awesome if you could 2x (or more) zoom JUST an individual program window, and then optionally apply various filters, ya know similar to DosBox.
Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests