I creating a class whose job is simply to allocate regions of a 2D texture for texture atlasing.
This is fairly trivial by itself, but this has to be done in real-time and be absolutely as fast as possible while minimizing the amount of unused space in the texture, even though the order of allocations is not known in advanced (allocations cannot be sorted, which would also make this trivial).
Fun challenge for me, if only I didn’t have a super-tight deadline.
I’m currently considering partitioning the surface of the texture using a modified quad-tree while favoring a specific quadrant during the search based on requested allocation size (large allocations would favor the upper-left while smaller ones would favor the lower-right), but as I said I my first implementation will be the final implementation so it absolutely must be the fastest possible scheme.
So my question is if anyone knows of any existing super-fast routines for handling this task.
L. Spiro