So I have this pixel art game I’m working on, and it has a problem. The textures are reinported without filtering and the screen resolution is 640 x 360 px. The problem is that because of the small resolution, the game looks a bit blurry on large monitors. I want to make the game looks chrisp and at the same time to move pixel perfect, like on a NES or Gameboy.
One way you can do it is by getting the actual screen resolution and resizing your window to that, then scaling your scene by the appropriate factor (for example *2 for 1280x720, *3 for 1920x1080).
This only looks good for resolutions that are integer multiples of your base resolution, though - for everything in between you get uneven pixels.
I tried what you suggested, by adding changing the resolution to 1920 x 1080 px, then adding the entire scene to a Viewport node with the size of 640 x 360 that is a child of a Viewport Container with the same size, but with the scale x: 3 and y: 3.
But it doesn’t seem make any difference.
Here’s a comparation between the scene in the editor and the actual game:
Don’t scale your images, change your camera zoom. Leave your images with the same resolution as you imported them and scale 1. Then change your camera zoom to a multiple of 2 (2, 4, 6, 8…)
that should fix the issue, I know it solved it for me.
Oh, and go to your project settings and change the default texture filter to “Nearest” so every image you import is filtered like that by default and you don’t have to manually change them one by one.
This is the solution for Godot 4. I’m using Godot 3.5.1 that doesn’t have a tab called Textures, nor Texture Filter setting. I’m Searching for a way to do this in Godot 3.
Thank you for your suggestion anyways!
Ouch.
Still, the first paragraph of my answer applies, don’t scale the images, leave them as they are and use your camera zoom. You just have to manually set the texture filter of all your sprites to “Nearest” and you’re done.