Downscale sprites to improve perfomance in the Engine. Eg: 4096x4096 to 2048x2048.

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Black_Chess_King

Say we have a sprite sheet texture of about 4096x4096, to improve the perfomance can I downgrade the resolution of the sprite during runtime of the game, or I would need to re-import all assets with another texture of half the resolution of the original?

The goal is to improve perfomance. Someone suggested me to just use scale 0.50, but I don’t think that’s how video memory is allocated to the textures.

:bust_in_silhouette: Reply From: Calinou

You can tell Godot to downscale all textures by a factor of 2 when loading by calling VisualServer.texture_set_shrink_all_x2_on_set_data(true) in any script’s _ready() function. This is mainly intended for reducing aliasing when using very high-resolution assets at smaller resolutions in 2D projects. See Multiple resolutions in the documentation for more information.

However, if you want to provide just a single texture with a lower resolution, you’ll have to do it manually.