b32 #1 It is called a lightmapper. I think you can find a code example for that in the code archives on this site.