Is it possible to bake lightmap for procedurally generated mesh?

Hi,

I asked this in forums, but I got no reply. I thought I try here…

For a mobile targeted game, I plan to create a tilemap which I estimate will be up to 50k triangles.
In order to optimize it, I decided to use very few textures.To further optimize it, I also want to bake the lightmap. However, I’m not sure if it is possible to do on a procedurally generated tilemap.

Because as far as I know, usually to bake the scene, they import all models and lights, mark them as static and then bake them. The problem is, I won’t have my map in the editor, it will be generated when the Awake() function is called. So I started to wonder if this is possible at all…

Many thanks in advance for your support.

No. Baking a lightmap is a (resource-intensive) activity that must be done in the editor prior to compilation, so there’s no way to do it for.procedural meshes generated at runtime.