Original Post
hi I have lots of small rectangular (vertical) textures and I want to pack them into one big power-of-two texture. I think that to do the optimal packing is NPC problem so Id settle for something decent (not optimal). I've seen it done in AngelCode's bitmap font program - you choose the letters you want and it packs them into single texture, unfortunatly its not open-source. Using google I found lots of unrelated PDF's and one related site - titled packing lightmaps it is a great tutorial but I have some unanswered questions, 1) the tutorial starts from a big square and splits it into rectangles as the small textures come. How do I know what size the big square should be? 2) He indicates in the tutorial that for best results the rectangles should be sorted by size (inserted largest first), but by what dimension should I sort? The tallest may not be the widest. 3) As my textures are mostly vertical oriented (height>width) Im afraid I will have lots of wasted space there... maybe the algorithm should be edited to attempt rotating the rectangles? 4) Do you know of other references/algorithms for this problem? ps. Im not sure if this is the right forum to put this thread in... thanks in advance, Iftah.

