- Home /
StaticBatchingUtility Combine one mesh have different materials
IMPORTANT: only objects with the same material can be batched, thus it is useful to share as many textures/material as you can. 文档上说 相同材质的才会被batched 但是我看合并的combined mesh 里有不一样的材质 这样不同的材质合为一个mesh 性能有什么影响吗
edit (Google Translate)
The document says that the same material will be batched. But I see that there are different materials in the merged mesh. What effect does the different materials have on one mesh performance?
Answer by Bunny83 · May 09, 2019 at 09:32 AM
If the resulting mesh has multiple materials they are actual seperately rendered since each material requires to be setup before rendering (SetPass). Be aware that when you use the Renderer,material(s) property Unity will automatically create unique instances of the materials for this renderer. Even the different objects seem to have the same material, they actually don't. The material has to be literally the same material instance. If assigned by code you have to use sharedMaterial(s) to avoid automatic instancing.
Your answer
![](https://koobas.hobune.stream/wayback/20220612201017im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
batch moveing files 0 Answers
Batch Objects with Different Colors and Scales 2 Answers
How to reduce drawcalls on duplicated trees? 1 Answer
Dynamic batching breaks with the material Mobile/Alpha Blended. 0 Answers
Trying to reduce draw calls but...? 2 Answers