Search Issue Tracker
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
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.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- [Hub] No button to add Platform support to installed Unity versions
- GameObject selection inside Prefab causes Editor lag/freeze
- Camera does not Render a Video Player when Cameras Culling Mask is set to anything except "Everything"
- [iOS][Editor]Legacy Launch Images iPhone 6.5 Landscape resolution mislabelled in Player Settings/Splash Image
- The Marker does not Run and gets Skipped when running in Reverse