flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.51k stars 176 forks source link

Nearest Neighbor/Integer screen scaling #1759

Open EpicGamerNaeNae opened 4 days ago

EpicGamerNaeNae commented 4 days ago

Is your feature request related to a problem? Please describe. By default, when playing at internal resolutions smaller than the window/screen, Flycast uses linear filtering to scale the image up, which results in a blurry image.

This behavior can be changed, by changing the texture filtering option from default or linear to nearest-neighbor, but displays the textures differently than was intended.

Describe the solution you'd like There should be an option for screen scaling, separate from the texture scaling option, to allow to choose between bilinear filtering, nearest neighbor, or integer scaling (displaying the game only at exact multiples of the original resolution). The sharper output would also help when using external filtering methods.

Describe alternatives you've considered External software like lossless scaling can be used to achieve nearest neighbor/integer scaling, but it is a bit finicky (at 1440p you need to set it to 2.999x scaling (854x480) to look as acceptable (because of that it stretches one pixel column slightly), since 3x (853x480) is one pixel off and makes the image look terrible), and isn't accessible to all users.

Additional context Screenshots at 1440p, with internal resolution at 1x:

Default texture filtering, textures look the way they're supposed to, but the image is blurry: image

Nearest Neighbor texture filtering, textures look worse, but the image is sharper: image

Default texture filtering, with lossless scaling resizing the window to 854x480 (scale factor 2.999 on a 1440p display, scaled up to 1440 using nearest neighbor on paint.net). Intended look for the textures, with a sharp image: image

flyinghead commented 2 days ago

Duplicate of #1415