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.

in Engine by (371 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.

by (11,899 points)
selected by
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.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.