Usually texture atlases are built either:
- as a seperate content pre-processing step
- or once when the game starts
What I want to do is create and update atlases on the fly when:
- A new texture file appears on the disk (or when a file gets removed)
- Pixel data and/or size of the texture changes (file gets changed)
As a seperate use-case - it's also useful when all assets can't be loaded in memory at once:
Different subsets of textures are used within different levels (yet are not set in stone as player can bring new assets from another level, or find a random drop which introduces a new texture from a vast library).
There a wealth of information on texture-packing algorithms in a all at once scenarios.
What algorithms are there for packing atlases dynamically (add/remove/resize texture)?
What rectangle packing with removal algorithms are there?
- Textures of arbitrary size
- Multiple power-of-two bins
- Both adding and removing has to be fast and online
- Removal operation should NOT trigger repacking of the whole atlas. Moving an occupied rectangle or two is acceptable (but better avoided?).