Jagged edges when up- or downscaling resolution

Godot Version

v4.5.1

Question

I am working on a 2D game, firstly for PC, but want to keep the possibility for port to phone/tablet open, so I have started experimenting with ratios and resolutions.

I’ve set 1920x1080 as the “default” resolution, while keeping the scale, as I want players of any screensize to see the same world layout and keeping player size in a fixed ratio compared to resolution. (Stretch Mode: viewport, Aspect: keep, Scale mode: fractional)

But when I increase- or decrease resolution, the player gets such sharp, jagged edges. I've tried changing default texture filters; Linear, Nearest, Linear mipmap, but I don't see any difference.

Are there any other options I can look into, or do I need to re-think the entire way of doing this?

By the way - it's no problem for me to scale up- or down the animations/spritesheets. All my artwork is vector-based.

The scaling mode can be important here, especially if it’s pixel art.
Try changing Window > Stretch > Scale Mode to integer to see if it helps.

Thanks for the suggestion marcythejinx!

If I choose Scale Mode to Integer, the resolution stays the same, but the game gets a big, black frame, but that’s maybe what you meant? I would like the whole game to get scaled up (but without the jagged edges).

And maybe I should have specified - the game isn’t pixel art, it is more like Ori and the Blind Forest or Hollow Knight (but nowhere near the level of stunning visuals or gameplay).

This is the expected default behavior with integer scaling, there’s a note to set Window.min_size when using it, though it probably will not help the game anyway if it’s not using pixel art.

I’d recommend checking out the documentation on multiple resolutions and see if you can find anything useful there, it explains the preferred settings for both desktop and mobile. Consider that your scaling settings will probably have to be completely different between desktop and mobile to achieve the desired look on both of them. I’d try not to worry about it too much, if you’re aiming to release on desktop first you can worry about scaling it to mobile later, that’s the case with most games that get mobile ports.

Also, depending on the resolution of your sprites, you could try to enable mipmaps and see if that helps with scaling them down.

Thanks again marcythejinx!

I had studied that manual-page before, but re-reading, and testing Stretch mode=canvas_items instead of viewport looks so much better! The edges are considerably smoother :+1: