- Home /
Lightmapping multi mesh model with static and dynamic parts
I have a model of a building which has parts of the walls separated into multiple meshes. This is so i can have parts that are 'destructible', these parts are set to be dynamic so they can be animated to fall off the building. The main mesh is set to static as it will not move.
My problem is that light batching is making the static and dynamic parts obvious even though they share the same material and texture they look different colors.
These buildings are all the same gameObjects with parts disabled to show destruction.
Any advice on how to rectify this would be much appreciated.
Answer by Skelly1983 · Aug 19, 2018 at 09:57 PM
After playing about with some lightmapping settings this issue has been resolved.
This was fixed by changing my lightmap resolution from 15 to 22 texels per unit.
This has made the color difference only minor, and increasing the resolution more would no doubt make these exact, but once it has been post-processed it is no longer visible so will leave at this resolution.
Answer by ignacevau · Aug 19, 2018 at 09:16 PM
When you set an object to static, it automatically also makes it lightmap static, which means that all the lighting calculations are done beforehand and the lights on the object will remain the same. To fix this, you have 2 possibilities:
After clicking on the drop down arrow next to the static checkbox on the dynamic part, check lightmap static (nothing else)
After clicking on the drop down arrow next to the static checkbox on the static part, uncheck lightmap static (keep everything else)
You should try one of these ways to make your objects have the same lighting.
Cant be this as the meshes are are all siblings to each other, the parent object is not set to static to avoid the issue you have stated, each sibling object that is to remain static is set too static, each sibling object that is meant to move has static unchecked. They are set as static independently. Thanks for your response though.
I don't think that you fully understand what I mean. There is a difference between static and lightmap static. Since your issue is with the lighting, you can set the non-static objects, in other words, the objects that will move, to lightmap static and then your dynamic objects will have baked lighting just as your non-moving objects, without being actually static objects.
No I do fully understand, but what you are suggesting would not have worked, having the static part set to be not lightmap static and the dynamic part to be lightmap static, would simply have reversed the effect on my models, the static parts would have been darker and the dynamic parts would have been lighter,
I guess that you didn't read it correctly? I stated that you should try one of these ways, either make your dynamic parts lightmap static OR make the static parts not lightmap static.
Your answer
Follow this Question
Related Questions
Static batching breaks UVs 0 Answers
Why is static batching causing so much lag? 1 Answer
Preserve lightmap on instantiated object 0 Answers
Unity not lightmapping Sketchup object 0 Answers