Fine tuning camera zoom in pixel art

Godot Version

v4.5.stable.mono.official [876b29033]

Question

As far as I’m aware, the only acceptable 16:9 low resolutions are 320x180, 640x360, and eventually 160x90 (if you go for something really tiny). In my case 320x180 is a little too zoomed in, and 640x360 is a little too zoomed out. If I have to I can work with one of them, but is there anything that would work in between? I tried zooming camera in and out, but it absolutely obliterates the pixel art (pixels are distorted and squashed). I’m sorry if this is an obvious question, but I couldn’t find anything.

I’m not expert on this so this may be an ‘obviously stupid answer’ but did you try 480x270?

1 Like

I don’t know if I did but it doesn’t scale perfectly to every common resolution: 720p, 1080p, 1440p, 4K. For example 720 / 270 is 2.(6), and it should be whole number.

I found this. Maybe it’ll help you. Also read the comments as it looks like it doesn’t work in some Camera node configurations.

1 Like

This seems to be unrelated. I actually had issues with shimmering environment, but it was fixed by changing stretch mode to viewport. And it seems to me that it’s much easier to just attach camera as child of the player, instead of placing it randomly in the scene.
I do still have issues with player character violently shaking, but this is entirely different issue that I don’t want to include in this topic.

1 Like

It’s worth mentioning that I’m using Snap 2D Vertices to Pixel. There is a lot of controversy about it online, some people say it’s essential for pixel art, some people say it does more harm than good. Without it it seems you have much more control over your resolution, but there can be some minor distortion, I think most players won’t notice it unless they actively search for it.
But I want to know how to handle resolution with this option activated.

Bumping up the topic since I still don’t know the answer. Maybe choosing something that scales to HD and FHD would be enough, but I don’t know if people with 1440p and 4K monitors will be able to properly see everything.

This question still haunts me so I’ve asked it on reddit. The answer I’ve got is to use AspectRatioContainer, and then internal resolution automatically adjusts to everything else. I haven’t tested that yet, so I don’t know if it works as expected, but I want to write it down for future generations in case it does work.