Trouble with pixel-perfect scaling from 640 x 360 to 1920 x 1080.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By vileswamphag

I’m making a 2D pixel art game, and am having trouble getting it to scale properly to 1080 resolution. The default resolution is 640 x 360, but when I enter fullscreen mode on my 1920 x 1080 monitor, the pixels aren’t to scale properly, even though it should scale cleanly by 3x.

I have adjusted the appropriate project and image settings to ensure pixel-perfect scaling. My stretch mode is in viewport, aspect is keep, I have changed the image import settings to 2D pixel and disabled mipmaps, filtering, and anti-aliasing where possible.

It is probably worth noting that I have no problems when I set the resolution to 1280 x 720 - it’s super crisp and looks great - the issue only appears when running it in fullscreen on my 1920 x 1080 monitor.

I am new to Godot, so I am hoping it’s something simple and obvious that I’ve missed? Thanks!

:bust_in_silhouette: Reply From: DamianTWinter

Hello. Did you check your test width and test height, located just beneath your resolution settings in project settings? It should be set to a multiple of your actual resolution

Hiya! Yeah, I’ve tried it on 320x180, 640x360, 1280x720 and Fullscreen 1920x1080 - with resolutions of both 320x180 and 640x360. Usually keep it on 1280x720 for testing, where graphics scale just fine.

vileswamphag | 2021-01-04 10:08

Hi again. My apologies for the delay. I went to sleep after my post. So, it only seems to not resolve correctly in fullscreen, which is 1920x1080 on your monitor. In this case, you actually have “Fullscreen” checked in project settings and also your test width and test height set to 1920x1080? When you say that the pixels “aren’t to scale properly”, you’re actually seeing the pixels being distorted and not square? I’m trying to recreate the issue on my end.

DamianTWinter | 2021-01-04 18:06

No problem! :slight_smile:

And yes, the squares are distorted, and I think slightly blurry - as if scaling to some other resolution that it doesn’t quite fit into. It’s most noticeable with text, with a lot of individual pixels scaling to 2x3, rather than 3x3.

I’ve tried it with a test width of 1920x1080 in Fullscreen, and with a test width of the smaller resolutions which I then make fullscreen in-game with ’ OS.window_fullscreen '. Both yield the same distorted results.

vileswamphag | 2021-01-04 18:15

I’m still trying to get similar results over here, but haven’t just yet. When you set the game resolution and test resolution to 1920 x 1080, but do NOT have “Fullscreen” selected, do you get the same result? I wasn’t quite clear on that part. One thing to check is that your Windows > Settings > Display > Scale and layout is set to 100%. I’ll keep trying over here, just so you know.

DamianTWinter | 2021-01-04 19:01

Yup, tried it with and without Fullscreen enabled, same results on both.

And I’m not sure what setting you mean? I’ve had a look and there doesn’t seem to be a category for Scale anywhere in the Project Settings? I managed to find a ‘Display Scale’ option in the Editor Settings, which was on Auto, so I changed it to 100% just to check, and there was no change.

vileswamphag | 2021-01-04 19:14

Oh, I’m sorry. I meant your actual Windows OS settings. I was assuming that you’re running on Windows. But since it’s acting the same both at that resolution alone and also with Fullscreen selected, it’s probably not the issue.

DamianTWinter | 2021-01-04 19:32

Ah! Of course! My bad XD

And yay! That’s sorted the problem! Changed it from 125% to 100% and it works like a charm. Thank you so much! Was hoping it would be something simple that I had overlooked - probably should have remembered this sooner really aha, it’s caused me trouble in the past.

One question though - do you know if this would still be an issue on other peoples’ displays if I exported the game? Or is it just an editor issue? 125% scaling seems to be the default these days, and I wouldn’t want it causing problems.

Either way, this has definitely explained and resolved the main issue - so thanks again!

vileswamphag | 2021-01-04 19:42

I’m glad that helped. No problem at all :slight_smile: I’ve had that issue with other things in the past.

As far as how your game will display on other monitors scaled at 125%, I’m not sure. You could always export and test, but I think that it will be an issue as it stands. I’m guessing that you’ll have to implement some sort of letterboxing. I am not positive on that, though.

I hope you can get that one answered. Best of luck!

DamianTWinter | 2021-01-04 20:58