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
- Rigidbody2D.Slide API does not have the needed configuration when creating a 2D Top-Down character controller
- Opening reference for "Playables"component redirects to a missing page
- Sprite Renderer image is changed when switching Mask Interaction and changing Sprite to a shared Sprite
- An unsigned integer is not compared with an integer correctly in player when using IL2CPP backend
- Graphical artifacts are being rendered in Scenes that are loaded during run-time when GPU Resident Drawer is turned on
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.