pixel-dungeon-gdx
pixel-dungeon-gdx copied to clipboard
Texture packing
Right now, we change sprites every time we draw something on screen. This generates lots of GL texture binding, that is very costly.
A much better solution is to pack the textures into a map and use the same for everything. A quick test suggests that all PD textures can be packed on a 2035x266 texture (when using rotation and non-power-of-two textures) or 2048x512 (without rotation and power-of-two). By splitting font3x.png
, we can even get to a 1024x1024 texture, very useful if we want to target (very) old devices without support for 2048x2048 maximum texture size, but maybe that's a non-issue.