- Home /
baking and lightmapping with dynamic level building
Greetings, I've been building different levels in one scene using only a few prefabs (with multiple objects per prefab) and instantiating them onto their rightfull place.
Now i've recently started looking at baking a scene, which ofcourse will be hard to do so when you have an empty scene. So i put the prefabs into my scene, bake the lights, and remove them afterwords.
When I run the game and it works perfectly ( as long as the prefabs instantiate on exactly the same places). But the're multiple level setups with a few changes into prefabs positioning, prefab use etc.
After some research I learned you can lightmap a scene, store the lightmaps (and probes) into the resource assets and set them correctly using code.
So now i have one scene, 3 different level setups and 3 folders with the lightmap assigned to that certain level. And it worked pretty good a long as it would be only 1 lightmap.
The problem is that 1 lightmap won't do much good for creating a good image, so i need more of them. But when i assign 2 or more lightmaps while instantiating a level, they always get mixed up by the meshrenderers.
I've tried lightmapping per prefab, but each bake responds differently and overwrites lightmap 1 when baking lightmap 2 for a different prefab.
Any help or ideas would be great! Thanks in Advance
Some people have been suggesting some work arounds for this problem:
Set the lightmap per prefab into a shader
Bake the lightmap into the texture in its 3D model environment
Create multiple scenes as they originally hold the lightmaps
I feel reluctant using these methods as i really want my above one to work. Any suggestions or opinions on this matter?
I'm having similar problem. Could you tell me more about the method you mentioned? "you can lightmap a scene, store the lightmaps (and probes) into the resource assets and set them correctly using code." Thank you so much!
Your answer
Follow this Question
Related Questions
bake point light into 0 Answers
Multiple lightmaps / 1 scene 1 Answer
[RESOLVED] lost lighting information on baked prefabs when instantiated 1 Answer