1. 程式人生 > >[Unity優化]批處理02:動態批處理

[Unity優化]批處理02:動態批處理

osi 如果 unit 多個 技術分享 cal lba ocs 同時

參考鏈接:

https://docs.unity3d.com/Manual/DrawCallBatching.html

1.

要求mesh不能超過900個頂點屬性,同時不能超過300個頂點

如果shader用到了Vertex Position, Normal and single UV,那麽不能超過300個頂點

如果shader用到了Vertex Position, Normal, UV0, UV1 and Tangent,那麽不能超過180個頂點

如下,Cube可以被批處理,Sphere不可以被批處理(單個Sphere頂點數>500)

技術分享圖片

技術分享圖片

2.

transform的scale屬性不能有負值

如下,圖一均為(1,1,1),圖二將其中一個改為(1,-0.1,1)

技術分享圖片

技術分享圖片

3.

使用不同的材質會破壞批處理

4.

多個pass的shader會破壞批處理

[Unity優化]批處理02:動態批處理