I’m working with an artist who sent me a 9700x9700 image (a 10x10 sprite sheet) to use for an idle animation. (This is for a 2D game). While I know this is much too big, I was wondering how much memory I ought to allow for textures in my game? Despite it’s size, the 9700x9700 is rendering without any lag. Given that I will also have to have backgrounds and multiple animated NPCs, what limits should I place on how big textures are to make sure I don’t run into any trouble?
The max texture supported by Godot (and a lot of hardware) is 16384x16384, so that’s your hard upper limit, but your actual limit may be much lower in practice. We’ve had at least one poster here who had an Android device that was giving him black textures on (IIRC) a texture that exceeded 8192 in one dimension.
Texture size limits are usually constrained by hardware design; it’ll be something internal to the GPU and how it addresses or caches texture memory. This tends to mean max sizes are powers of two, for the usual “how computers represent numbers” reasons. It’ll be some fixed number of bits.
Practically speaking, you’re probably safe if you keep things below 4096x4096, and definitely safe under 2048x2048. If you don’t care about mobile, you can probably do 8192x8192, and if you’re aiming for top-end PCs only you can probably get away with 16384x16384.
There is not really a magic number of how much memory you should use for your textures — gamedev is all about tradeoffs and tricks to do the best with what we have.
I would suggest starting with “what will appear on screen at what size”. That way you can determine the appropriate size your textures should be drawn for.
Then you can start looking into “what will appear at the same time”, so you can decide what can be pre-loaded, loaded on demand, loaded based on what you know will be shown soon, etc.
Don’t forget to look into texture import options, they can have a huge impact on memory usage and performance (VRAM compression for instance can be used for 2D games, even if it comes at a slight quality cost — i’ve used it massively for 2D commercial games with strong art direction and nobody ever complained)