An implementation of http://www.blackpawn.com/texts/lightmaps/