Lightmap packing...

Blitz3D Forums/Blitz3D Programming/Lightmap packing...

You might look at the YAL code in the archive. That links looks like the way it's being done YAL.