Hi,
I want to create lightmaps of (3d) building models for an isometric game (4 directions basically).
I used to be able to place the building prefab in a scene with a camera and a light and then call Lightmapping.Bake(). In the callback bakeCompleted I would then call Texture2D lightmap = LightmapSettings.lightmaps[0].lightmapColor; and save that file.
But this is not working anymore, LightmapSettings.lightmaps is always empty when the callback is called.
I have tried to use Lightmapping.BakeAsync() in a coroutine and yielding until Lightmapping.isRunning is false but the result is the same, no lightmap.
Is there another way to do this? Is there a known bug?
(At runtime I manually add the right lightmap to LightmapSettings.lightmaps and then set MeshRenderer.lightmapIndex)
regards,
Patrick