+2 votes

Any tips on what to do if pixel perfect scaling adds/removes pixels from sprites on higher resolutions?
Pixel Snap is On
Base resolution 1280x720
Stretch Mode 2d, Aspect Keep
Filter is disabled in Import settings
16x16 default image size, sprites are rendered using NinePatch
Game is running in 1920x1080 resolution

2000% zoom non-scaled (original, from editor)
enter image description here

2000% zoom scaled (from game)
enter image description here

in Engine by (378 points)

if youre scaling pixel art, it probably isnt the best idea to turn on pixel snap. that's why it looks better from the editor.

Without Pixel Snap, it's even worse.
enter image description here

3 Answers

0 votes
Best answer

Changing base resolution to 640x360 solved this, now it scales properly with 16:9 resolutions.

by (378 points)
selected by
+2 votes

Since you aren't dealing with a 1:1 set of resolutions you have to address sub-pixel rendering in some way to get a smooth result.

Here's a tutorial about jitter-free pixel art scaling:
https://www.youtube.com/watch?v=2JbhkZe22bE

by (856 points)
+1 vote

You need to scale it using integer (whole number) factors.
When you are scaling from 1280x720 to 1920x1080, you are scaling by a factor of 1.5, which results in some pixels ending up larger than others.

To keep pixel size consistent you could for example change the base resolution to 960x540, which scales to 1920x1080 by a factor of 2.

by (16 points)

There are more resolutions than 1920x1080, I can't make it work just with one. I need this to be responsive.

Yes, it was just meant as an example, and I tried to make it as close to your original as possible. Seems you landed one that worked out better for multiple resolutions.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.