I’m currently trying to get myself out of a lightmapping issue. I’ve been working on a Unity arch/viz project for a client for a few months now. Being a novice at lightmappign before starting this project, I’ve been able to teach myself most of what I need to know.
I’m taking 3 sections of a skyscraper that are meant to be turned on/off to show off major sections of the building. The bottom floor is the “Lobby” slice, the middle is the “Office” slice, and the top is the “Roof”. In order to get the baked lighting look I’m looking for, I’ve decided to put each slice into their own individual scenes and bake each slice separately.
I have been able to get my separate bakes, but whenever I try to merge one slice from a separate scene into my current scene (ex: try to take the Office slice from one scene and put it into the Lobby scene), the lightmapping looks all wonky and bad. I assume it has to do with the current scene trying to write it’s current lightmap data onto the merged slice rather than merging the lightmaps from the other scene.
I’ve tried copy/pasting the slice and also making a prefab of the slice, but it still looks wrong. Is there any way around this or is it impossible to use lightmaps from two separate scenes? I apologize if this isn’t a good explanation.
When Unity lightmaps a scene it uses a separate 2nd UV channel and the appropriate UV layout as specified for each of model files (e.g. ‘apply light-mapping UV’s’ or imported UV mapping) then on a per scene basis it generates lightmaps based on bouncing light (GI) in the scene between the objects in regard of scene lightmapping parameters, e.g. number of maps, resolution etc. as specified in the docs:
Unity has no concept of merging scenes in regard of lightmapping as lightmapping would need to treat any merged objects from different scenes together as one scene in order to calculate the influence of light between each other. To that end you have a choice to load separate scenes together at run-time or in your game view e.g
Or simply re-lightmap the new merged scene, to the best of my knowlegde.
But, when I load scene, all my lightmaps seems broken. The objects from additively loaded scene lost lightmaps and gone white, and original scene objects has change lightmaps in wrong way.
We have the same requirement and we are having the same problem. Even when we point the renderers from the loaded scene to the correct lightmap index, they load at the wrong scale and position.
It’s not clear if the OP was talking about at run-time, or in the editor. In the editor, I don’t think so. But at run-time I can get baked lightmaps to come in fine, but not real-time. If I try to load real-time GI, only the last loaded scene works, and at that the contrast is off. And loading the baked maps, I do get errors about missing GI files, even tho I dont have real-time GI in the scenes i’m trying to load.
What’s adding to my problems is the whole chasing thing. It’s tough to get clean tests because if you have baked real-time GI into a scene once, it thinks it’s still there. You can clear the cache of the project, but that wipes everything out.
I’ve heard you can get the GI snapshot into a scene by creating an asset bundle of the scene, loading it, then loading that scene. But i’ve not worked through that yet.
I’m simply loading the scenes with loadleveladditive. I’m not doing any other coding regarding the index or anything. (see link below)
No, importing the asset bundle at runtime then loading the level as you normally would. Sounds like it just makes the lightmap snapshot available, but like I said, I haven’t tried or worked through it yet.
Thanks for the reply. I created a new project just to test if I was missing something. But nope, it’s still the same. Unless anyone can spot another reason why this might not be working for me?
@jnt What rendering path you using? I just did another test project and It didn’t work, I couldn’t see the lightmaps. I was in was in forward. Switched to deffered and it worked.
Released version of Unity is 5.0.0f4, so please verify your use cases against that, especially that there were some fixes to baked lightmaps wrt additive level loading in one of the last release candidates.
Once you confirm that baked lightmaps don’t behave as expected when additively loading levels, please submit a bug report and post the case number here. Thanks a bunch!
For some reason it was reactivated, we’ll check that. That said, it still makes sense at least for one of you to provide a repro, so we can double check.
@topofsteel_1 thanks for your scene! It helped me find from where the issue is coming from. So in your project if you bake pre computed Realtime GI in the Hall_Bake scene or Room_Bake you do have the issue even if lights are set to bake only and that was my issue too.