I am building a 3D scene in Unity and trying to export that in three.js. In the scene there are a lot of lights sources. I read that to save computational resources it is possible to generate a lightmap which stores lighting data like shadows in a texture for static objects. Now I am not sure I completely understand how this works in practice. These are my doubts, hopefully someone can shed some light:
- Is the lightmap intended to completely replace the light sources (no need to add Lights in the scene)?
- Or it is used only to provide shadows informations, thus it is possible to avoid casting/receiving shadows dynamically in the scene and save resources?
- There is one lightmap for the whole scene or should be one lightmap per object? In other words, how should I apply lightmaps in a three.js scene?
Taking the case of Unity, if I use “Generate Lighting” in the Lighting panel I see that Unity creates several images with lighting informations like:
Is it possible to use these files as lightmaps into a three.js scene? If yes, how should it be done?