supertux icon indicating copy to clipboard operation
supertux copied to clipboard

Add an option for crisp graphics

Open weluvgoatz opened this issue 2 years ago • 4 comments

Fixes #1112 by including the GL_NEAREST parameter for rendering, however this can appear poor on different magnifications because it renders to the nearest pixel, so I included the option to render either more "crisp" or with the more blurry (current) look. Like other graphical options, it requires a restart to take effect.

I have not tested this against the entire game so it is possible something breaks... Let me know if that is the case.

weluvgoatz avatar Dec 12 '22 00:12 weluvgoatz

The proper term for "crisp graphic" is Nearest-pixel interpolation. The "blurry" graphics is linear interpolation.

The difference is best shown by this image from this website under "Texture filtering": image

The former ("nearest") gives a pixelized effect, whereas the latter ("linear") tries to smooth those edges out, making it less pixelized but blurry.

Note that the effect will be larger than this reference image in practice: slower movements will feel significantly more "blocky" with nearest interpolation, and certain scales close to 1 will duplicate certain rows of pixels, which stand out a lot.

If the end goal is to have a better image quality, instead of using nearest sampling, the solution would be to make source images at higher resolution (2-4x larger), so that OpenGL has more room to pick a precise color.

Semphriss avatar Dec 12 '22 01:12 Semphriss

Thank you for the additional information, "crisp" is just a general term to refer to the GL_NEAREST since a lot of users might not know what that means.

weluvgoatz avatar Dec 12 '22 15:12 weluvgoatz

Since this option only takes effect when OpenGL renderer is used I think that it should be only available when that renderer is selected.

mrkubax10 avatar Dec 14 '22 16:12 mrkubax10

@weluvgoatz Not sure if you will continue working on this PR.

mrkubax10 avatar Oct 20 '23 19:10 mrkubax10

I will work on this at a later time.

weluvgoatz avatar Mar 16 '24 02:03 weluvgoatz