Search Issue Tracker
By Design
Votes
0
Found in
2017.4.0f1
2018.3.0a1
2019.1.0a1
2019.1.0b5
2019.2.0a1
Issue ID
1137194
Regression
No
Cannot use multiple materials on a single sub-mesh when static batching is enabled
How to reproduce:
1. Open attached project "case_1137194-StaticBatchingIssue" and scene "StaticBatchScene"
2. Enter Play Mode
3. Observe the GameView or Scene View
Expected result: cubes which have static batching enabled continue to use the same materials as before entering Play Mode
Actual result: cubes with static batching enabled only use the first material in their appropriate MeshRenderer's "Materials" list
Reproducible with: 2017.4.24f1, 2018.3.10f1, 2019.1.0b8, 2019.2.0a9
Note: static batching is enabled here from a script but the behavior is the same when the GameObjects are marked as static. This problem is especially salient when using transparent materials which should render on top of materials earlier in the list but are not used at all
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Mobile] Developer Console does not appear when an error is thrown
- [HDRP] Game view renders artifacts when Camera's Component "Post Anti-aliasing" is set to "TAA" and Dynamic Resolution's "Forced Screen Percentage" is changed
- A deactivated Prefab's name color becomes white when a GameObject in the scene is deactivated
- The Game view becomes blank when using Frame Debugger with MSAA and Texture binding enabled in Play Mode
- NullReferenceException is thrown when changing the Inspector preview selection
Resolution Note:
By design because static batching would combine the meshes to 1 mesh if the meshes are using same (first) material. This is because once it's combined, the big combined mesh will be drawn only once. It will affect performance if the whole combined mesh are rendered again for just a part with a second material.
User should either separate the mesh that needs multiple materials or try to modify the mesh to merge the materials into one.