0

how to enable "nearest neighbour" scaling algorithm for non-native resolutions in linux?

also known as "pixel doubling" for (for example) when 4K screen is set to use 1920x1080 resolution.

see here for more detailed description (as well as a link to xrandr patch that was supposed to make it easy but seems to be rejected for unclear reasons):

https://www.reddit.com/r/linux_gaming/comments/5o1obf/is_there_a_way_to_force_nearest_neighbor_scaling/

the goal is to get rid of blur that occurs whenever desktop resolution is smaller than monitor's "native" resolution

4
  • Nearest neighbour scaling (at least how I know it) and pixel doubling are very different. If you want to implement nearest neighbour scaling, I'd go and write a custom shader; that should work on most modern graphics cards without any patches. – dirkt Feb 8 '20 at 20:58
  • dirkt: my question is not about game development or graphics programming, I want to "simulate" low-resolution screen (without blurring) for third-party games which I cannot rebuild from source. for example simulate 1920x1080 resolution on 3840x2160 screen, or 640x480 resolution on 1920x1080 screen, with black borders in latter example. using nearest neighbour in former example would effectively result in pixel doubling – Mikhail Feb 9 '20 at 10:30
  • Why don't you just change the screen resolution? 1920x1080 should work well on modern hardware. 640x480 should still be possible. Als wrt. to "I want it to look sharp": with pixel doubling it won't look sharp. Trust me, I've tried many algorithms playing retro games in emulators... – dirkt Feb 9 '20 at 10:52
  • for me it does look sharp, tested on NEC 2190UXp external monitor which can do it with its built-in settings (only for itself of course). I bet you tried either with screens which are not exactly 2x or 3x etc of chosen resolution or without borders ("stretch image" mode) or with algorithms which actually create blur even when it is not necessary – Mikhail Feb 9 '20 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.