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

Auto-nearest-filter for 2D graphics with pixel mapping detection, in some games? #18460

Open
hrydgard opened this issue Dec 1, 2023 · 0 comments
Labels
Feature Request GE emulation Backend-independent GPU issues
Milestone

Comments

@hrydgard
Copy link
Owner

hrydgard commented Dec 1, 2023

A lot of 2D UI in games, though certainly not all, is drawn like this:

  • through mode (untransformed) RECT primitives
  • 1:1 pixel mapping
  • linear filter

1:1 pixel mapping can, in theory, often be detected during rectangle-to-triangles expansion, for example if the data looks as simple as this we can just compare the UV and XY deltas and check if they match:

image

And we could just automatically turn on nearest filter for these draws. In many games, without texture replacement or upscaling enabled, this would look better. On the real PSP, the games often leave linear filtering on for no reason, because it doesn't make a difference when you map texels to pixels 1:1. But when we want to render 3D graphics at high resolution in PPSSPP, we end up with muddy UIs.

For example, this UI in Everybody's Golf:

image

Would look like this:

image

While the interior looks alright filtered, the borders are really destroyed by the undesired filtering.

Unfortunately we scale UVs a bit too early in the software transform pipeline that we use for RECT parameters to detect it trivially right now, but by moving the UV scaling in this case to the rectangle expansion part, we can still do cheap checks.

Anyway, just documenting an idea for some future hacking session :) It won't work with all games anyway.

@hrydgard hrydgard added Feature Request GE emulation Backend-independent GPU issues labels Dec 1, 2023
@hrydgard hrydgard added this to the Future-Prio milestone Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request GE emulation Backend-independent GPU issues
Projects
None yet
Development

No branches or pull requests

1 participant