How can I resize a Sprite2D in a viewport without the sprite being distorted?
Example
On the left is a 2dSprite scaled to (2.4 by 2.4). On the right is the same sprite scaled to (2 by 2). For some reason scaling by any non whole number distorts the image.
Scene Tree
I am using a Sprite2D inside a SubViewport as the sprite of a Sprite3D. I am doing this because I need to use a clipping mask on the Sprite2D, and Sprite3D’s don’t have that functionality.
With nearest neighbor interpolation, scaling power of two numbers are quite simple, every pixel is turned into a larger square, anything else will have to fill some parts leaving oblong non-square pixels.
As an example I want you try manually resizing a image from 8x8 to 11x11. Maybe you can artistically decide on something that looks nice, but the computer is only doing math as fast as it can.
You could try Linear filtering but that’s the default so you may have already intentionally preferred Nearest.
Sorry to say these are your two options as dictated by GPUs. It is a hardware issue, and GPUs just don’t know how you would like to scale pixel art by 2.4
Dang well thank you anyway! Also would you happen to know why scaling works if I just was an png as the sprite for the 3dSprite? I’m just trying to figure out the logic so maybe I can find a work around?