Issue with rendered textures in pixel art game

Godot Version

4.3.dev5

Question

I want to make a prototype for a pixel art platformer. I’m using the icon.svg as a placeholder texture for my player character.

How come this texture looks so odd in the running project? What can I do to fix this issue?

These are my display and rendering project settings:

[display]

window/size/viewport_width=480
window/size/viewport_height=270
window/size/window_width_override=1920
window/size/window_height_override=1080
window/stretch/mode="viewport"

[rendering]

textures/canvas_textures/default_texture_filter=0

Everything looks fine in the 2d viewport.

The icon looks odd in the running project.

Change “viewport” to “canvas_items”. As far as I understand, the viewport mode means that rendered textures will have consistent pixel size. It doesn’t work well if you change the scale of sprites as you have done with the icon texture (?). I think that viewport works best when you want everything to be pixel perfect. It is the recommended mode for pixel art games but sometimes you might need to have elements that are not pixel perfect, like freely rotating sprites or a font that is not a pixel font.

1 Like

Thank you, this fixed the problem.

It’s strange because the documentation recommends “viewport” for pixel art games. Oh well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.