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

🔍 Alternative Pixel Filtering Modes #51

Open
zicklag opened this issue Jul 12, 2021 · 0 comments
Open

🔍 Alternative Pixel Filtering Modes #51

zicklag opened this issue Jul 12, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@zicklag
Copy link
Member

zicklag commented Jul 12, 2021

Related to the text rendering comment in #50.

There are three different strategies that we know of that Bevy Retrograde could use for pixel rendering. We currently use what we dub here the "Crips Scalable" version, but there are also a couple other versions that we should implement as configurable modes.

Summary

Mode Implemented Crisp Edges Perfect Squares Any Zoom Level Doesn't Require Camera Borders
Crisp Scalable ✔️ ✔️ ✔️ ✔️
Smooth Scalable ✔️ ✔️ ✔️
Crisp Fixed Scale ✔️ ✔️

Crisp Scalable ( Current )

The crisp scalable model uses simple "nearest" mode filtering for the pixels, which retains the pixels' sharp edges, and we allow scaling the screen to match the camera size to the window size, allowing the game to be played at any zoom.

The disadvantage of this technique is that at non-integer scales, the in-game pixels will not line up perfectly with the physical pixels of the users screen and the result will be that some rows and columns of pixels may be taller or wider than the others.

Smooth Scalable

The smooth scalable model uses an anti-aliased filtering technique that preserves the squareness of pixels at any scale, but results in a blurrier appearance and can lose the crisp edges.

Crisp Fixed Scale

The crisp fixed scale model will preserve the sharp edges of the pixels, and make sure that they remain perfect squares, but will restrict the scaling level to integer values such as 1x, 2x, 3x, 4x, etc. This means that when the window size is, for instance, 1.5x the game will render at 1x scale with a border around it.

@zicklag zicklag changed the title Alternative Pixel Filtering Modes 🔍 Alternative Pixel Filtering Modes Jul 12, 2021
@zicklag zicklag added the enhancement New feature or request label Jul 12, 2021
@zicklag zicklag pinned this issue Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant