Sprites tearing and warping

Hi! I have a problem with a game I am making. When the sprite size is not a whole number, it seems to warp in a way that makes it look weird. I am using a CRT filter, but even then I don’t think that’s the problem. Here is a picture:

I really need to find a way to fix this, because, with whole numbers, the player sprite is either too big, or too small.

Are you changing the size of your sprite in the editor to a custom size?

If so, you may want to resize the other sprites to fit in with the original size of the player sprite.

no, I am using the scale tool to change the size.

Scale tool? What do you mean by that?

Scale event I mean, sorry.

Ok, so you’re changing the scale in GDevelop.

What do you mean with your earlier comment that by changing it with whole numbers it’s either too big or too small? Too big or small for the screen or the other objects around it? Or something else?

I mean that in comparison to the screen size as well as the other objects around it its too big or too small with whole numbers.

If the sprite’s resolution is being scaled to non-integer numbers (8.6x8.6 pixels instead of 9x9 or 8x8), you will always have distortion.

This is called subpixel rendering, and is due to how graphic scaling works. Too few pixels at too small resolutions, or non-integer/full pixels at small resolutions, will create a shimmer effect as it moves.

1 Like

You can change the viewport size easily enough in the project settings.

And you can alter the other srpite’s sizes. Or, ideally, correct the size of the images on disk, so when they are used for sprites they don’t need further resizing.

1 Like