I was thinking about a new system to handle lightmaps, since the old system is complicated and has its issues.
I opened an issue for it, but I also want to discuss it here, for some feedback.
"The current system of lightmapping in T3D is not very practical to use, since you need to add the lightmap into each slot of each material that your shape uses, which creates several big problems:
1. You cannot reuse materials, since each material is only limited to one shape and I for example have materials that are reused over the game. So you would need to create a new material each time you reuse textures.
2. You cannot reuse shapes in different scenes, since the lightmap is fixed to the conditions they have been made for, so for each scene you would need to create a new shape with a new material to meet the new lighting conditions.
3. You have to setup each shape and each material by hand.
The idea I have will fix all that. My idea is to automatically add a lightmap, if available by providing a specific texture for it. So you would need to create a lightmap UV in the second UV channel for all your objects, bake the lightmap in modeling program and then export it, in Torque3D you would just add the lightmap for the model by naming it a specific way to indicate it is the lightmap for that shape.
Like with the terrain, where you have theTerrain.ter and theTerrain_basetex.dds then you would have myModel.dae and myModel_lightmap.dds and the engine would automatically apply it to the shape avoiding to having to use the material system. You could also setup multiple lightmaps for each scene light myModel_lightmap_scene1.dds, myModel_lightmap_scene2.dds etc. For control over it, you could have a checkbox for whether to use lightmap yes/no and which one to use and maybe an intensity slider and this would fix all the issues I named and make it overall more easy to use."
So what do you think? Is this doable or did I overlook issues with that system? What is basically needed is redirect the models lightmap directly to use the specific file and not using the material system, so point to a file and automatically apply it in the lightmap slot in the second UV texture for the model, depending on each object instance.