0 votes

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.

asked Mar 30 in Engine by The_Black_Chess_King (265 points)

1 Answer

+1 vote
Best answer

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.

answered Mar 30 by Calinou (5,758 points)
selected Mar 30 by The_Black_Chess_King
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.