Godot Version
Godot 4.3
Question
I am adding a sprite to the game and as the size of this sprite decreases, pixels appear. I want a clearer image, how can I do this?
Godot 4.3
I am adding a sprite to the game and as the size of this sprite decreases, pixels appear. I want a clearer image, how can I do this?
This is inevitable given how pixels work on a screen.
You could swap the sprite image for another image at smaller scales, which you have drawn to be better representative of your intended artwork at reduced scales.
It is the same scenario as when you scale an image up. Take a small image and scale it to 3 times its original size and it starts to look awful for instance.
Try reimporting the image with mipmaps enabled.
@gertkeno
Ooooh, what are mipmaps.
Excuse my ignorance but excited to find out. Not really a question as I will google it and find out.
I read about it here in the docs but it assumes I know what they are.
The way your GPU samples an image, especially a scaled down one will end up grainy. One could example this by taking a image, and scaling it down with “Nearest Neighbor”, then compare against scaling it down with “Linear”.
Mipmaps pre-scale textures down by powers of two; 64x64, 32x32, 16x16, all the way down to 2x2, with linear filtering to blur the smaller texture. The GPU automatically uses Mipmaps where the sample would be smaller than the texture.
Usually this is most helpful in 3D games where the artists cannot control how small or large textures are seen; You can see in this example the left side is grainy.
Thank you for the solution suggestions, but I am working on a 2D game. I drew a 3000x3000px character, but when I shrink it using the editor in the game, it becomes pixelated.
Mipmaps apply to 2D as well, but the best solution would be to not draw a 3000x3000 character and/or scale them down to an appropriate size in your image editing software.