Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batches vs Tris performance

Tags:

unity3d

We have a asset with 12k tris (A cargo container) we found a nicer looking asset at the Unity Asset store with 3.5k tris. However the physical length of the new asset is half of the old one so to keep the same level design we need two objects for each old object.

We have static batching ticked for the objects.

New asset vs the old stats looking at the same spot in the same scene

tris: 800k vs 1.1m
verts 900k vs 1.4m
batches: 611 vs 490
setpass calls: 192 vs 167

Bonus
Lightmap: 150mb vs 200mb

So we have more batches and draw calls obviously because the larger amount of objects. Is the decrease in tri count worth increase in batch/setpass calls?

Our target platform is SteamVR (Desktop PC and HTC Vive / Rift) and recommended specs will be GTX 970 and mid range CPU

Old asset in background new asset(s) in foreground enter image description here

like image 955
Anders Avatar asked Oct 31 '22 00:10

Anders


1 Answers

Generally, draw calls are more expensive than just the number of tris. Of course you would need to profile for practical results. Be aware that, as stated in the docs, batching will only work under certain conditions, one of them being, that the mesh has less than 900(?) vertices, among others. It is possible, that you can optimize your scene much more by performing custom batching via an editor tool, like OnPostprocessScene during build or whatever fits your pipeline. You can use the CustomBatchingUtility, MeshUtility or write your own. Then you don't need a tradeoff, you get the best of both worlds.

like image 101
Xarbrough Avatar answered Dec 14 '22 04:12

Xarbrough