- Home /
mesh.CombineMeshes messing with lighting and framerate
Hi,
I'm using mesh.CombineMeshes to lower the draw calls of my levels which are loaded from json. It works great, lowering from 2802 to 15 in one instance. However, the lights somehow barely work, why is that? And why is the framerate higher when the meshes are not combined?
Answer by whydoidoit · Mar 02, 2013 at 08:01 PM
A single mesh can only be affected by a limited number of lights - it'll choose the most significant ones and depending on the shader that number of realtime lights can be different, but 4 is normal. Lightmapping and light probes would give you better performance and closer to the effect you are looking for on the combined mesh.
In the stats you are showing you appear to have renduced the rendering cost by 6.9ms at the expense of more time in the main game CPU - are you sure you aren't constantly combining the meshes or doing something else?
It might even be the system trying to work out which of your lights to use.
Your answer
![](https://koobas.hobune.stream/wayback/20220613093659im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
MeshFilter and CombineMesh Doesn't Build Properly 1 Answer
Lighting Problem 2 Answers
Textures are dark after merging vertices 0 Answers
Issues with changing light colour 2 Answers
Problem with CombineMeshes on large number of meshes 1 Answer