Hi there
I hope anyone could bring some light onto this subject, as I am not quite sure if I do fully understand what’s going on behind the scenes and the documentation on this subject is rather vague.
I’m currently experimenting with lightmapped prefabs (something like: Problems with instantiating baked prefabs ). Basically, I bake the prefabs in a scene and serialize on it the reference to the baked lightmap. On instantiation, the lightmap then gets added to the LightmapSettings.lightmaps array and the renderer of the prefab will point to that map by the setting the lightmapIndex property. This works fine, no matter in which scene the prefab will get instantiated.
Now, I’d like to use realtime GI in my project and therefore will bake the lightmaps for the prefab with the Realtime Global Illumination checkbox enabled. As expected, the ambient light does not get baked onto the lightmap anymore. But if I go ahead instantiating the prefab in a scene, which is not the one it was baked in, the lightmap seems to get wrongly interpreted as it renders the parts that should be affected by the realtime GI / ambient light completely black (as it is, in the baked texture). So there seems some information is going missing.
I noticed the renderer component also contains the properties realtimeLightmapIndex and realtimeLightmapScaleOffset. From the name I would assume, those refer to some realtime lighting data. However, the documentation does not really help there. I have no clue, what a realtime lightmap exactly is. Well, a lightmap that gets rendered realtime while running, I guess.
Clearly, the realtimeLightmapIndex is not used as index for the LightmapSettings.lightmaps array.
So, how exactly does a ‘realtime lightmap’ work? Where is this index used and how do I know, to which value it is to be set (e.g. in a different scene, not the one it was baked in)? Am I on the correct path for making realtime GI working, or am I completely wrong and the data I am looking for is somewhere different, maybe even inaccessible?
Would really appreciate some comments on this ![]()
Cheers





