Archived

This topic is now archived and is closed to further replies.

Lightmap packing

This topic is 5047 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello all! Does anyone knows if there exists an algorithm to optimally pack a given set of polygon into texture quads so that texture space wasting is minimal and the number of texture to use is minimal? I would be interested also in related papers or in your ideas.

Share this post


Link to post
Share on other sites
*Optimal* might be tricky. I know I''ve seen at least one paper on this specific subject (lightmap packing) but I can''t for the life of me remember its name or author. A simple method which isn''t optimal but might be good enough is to compute the individual lightmap rectangles for each polygon and then pack those rectangles into your set of lightmaps. A simple greedy algorithm using quadtrees works ok for the actual rectangle packing (although you will likely wind up with slivers of wasted space).

How much space is wasted depends on the polygon shapes, if they are mostly rectangular, of similar sizes then you''ll get nice packing, if they are all long triangles then you could easily waste half or more lightmap space.

Share this post


Link to post
Share on other sites