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

Implement pixel aspect ratio #151

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

parasyte
Copy link
Owner

@parasyte parasyte commented Mar 10, 2021

This is still missing linear texture filtering to smooth out the stretching artifacts that it introduces. The images shown in the example README show the artifacts that I'm talking about. The pixels are chunkier than they should be. For additional info on how it's supposed to look, this blog post goes into plenty of detail. Another resource is https://tanalin.com/en/articles/integer-scaling/

  • Fix "shimmer" aka "wave" effect with moving images when PAR != 1.0.
  • Add API to change PAR at runtime.

@parasyte
Copy link
Owner Author

After bouncing some ideas off the wgpu chat, the conclusion is to rewrite the shader to use multiple samplers and do the individual scaling steps. I don't want to prematurely optimize, so it's going to do both samplers scaling steps regardless of the PAR value.

The next checklist item would be an API to allow changing the PAR at runtime. I don't know if this will be useful, but it's always possible that someone comes along with a use case for it. It would also be an improvement for the PAR example; a key to toggle PAR correction on/off will be more illustrative than just some static screenshots in the README.

@parasyte parasyte changed the base branch from master to main November 19, 2021 00:53
@dbalsom
Copy link

dbalsom commented Jun 1, 2023

Sorry to be a nag but what is the state of this PR? Anything we can do to help?

@parasyte
Copy link
Owner Author

parasyte commented Jun 2, 2023

There aren't any updates for this PR other than what is already here. Specifically, the extra context provided in #262 kind of obsoletes the implementation in this PR. In short, this does allow for non-square pixel aspect ratios, but it comes at the cost of "pixel shimmering" in animations, especially when things move horizontally. Texture filtering like the two-pass implementation in #262 can address that problem.

There is still an unresolved issue there; how to integrate the second pass into the library as a first-class feature (that PR currently requires it to be added to a project as a custom renderer). If you are interested in helping drive the effort, that would be the place to start.

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

Successfully merging this pull request may close these issues.

2 participants