Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Sharp bilinear interpolation #7183

Closed
Jakey757 opened this issue Oct 13, 2022 · 2 comments · Fixed by #7444
Closed

[Feature Request]: Sharp bilinear interpolation #7183

Jakey757 opened this issue Oct 13, 2022 · 2 comments · Fixed by #7444

Comments

@Jakey757
Copy link
Contributor

Jakey757 commented Oct 13, 2022

Description

Described and shown in detail here, along with some code dolphin-emu/dolphin#9860

Output native resolution > integer scale each axis nearest to (but not smaller than) target resolution (this includes accounting for AR changes) > finally scale down to exact resolution and interpolate image with filtering

Reason

Results in a lot less blur than immediately filtering the image but also corrects pixel positions/sizes at any resolution or AR.

Essentially this is an alternative for people who like a sharp native res image without artifacts from nearest with uneven scaling, but might not like integer scaling or weird aspect ratios.

"Why not just use nearest and integer scaling?"
Nearest neighbor can cause squished or stretched pixels across the image when not scaled evenly and is very noticeable in motion. Integer scaling often doesn't fit an image to the display height and requires square pixels to achieve correct scaling, which means non standard AR's for games that use very odd resolutions or multiple resolutions.

Nearest can sorta be "brute forced" by using a high output resolution to have more pixels to sample from (4k displays) but most people are still on 1080p or 1440p displays.

"Why not use bilinear filtering?"
Causes excessive blurring that only gets worse the lower resolution the source image is.

Examples

Shown in the linked Dolphin PR and below.

@Jakey757
Copy link
Contributor Author

Jakey757 commented Oct 13, 2022

Mockup for more context in relation to PCSX2 using Xenosaga as an example and targeting 1080p in 4:3 (compare images maximized, not from the embeds)

3x native with no filtering (8:7 AR/1:1 PAR). Perfectly square pixels and no interpolation needed.
Xenosaga native x3

1440x1080 with bilinear applied from the start of scaling (4:3). Considerable blurring on UI and text elements.
Xenosaga bilinear only

3x prescale then scaled down to 1440x1080 with bilinear. Not quite as sharp as 1:1 but much less blurry than standard bilinear.
Xenosaga prescale

And to better show nearest's artifacts when not using 1:1 scaling, one of the logos that show before the main menu since it has a lot of contrast.

Nearest to 1440x1080. Fringing and distortion on the thin "combs" of the logo.
Xenosaga logo nearest to target

3x prescale then scaled to 1440x1080. Very smooth but not excessively blurred.
Xenosaga logo prescale

@Jakey757
Copy link
Contributor Author

fulfilled by #7444 :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant