Batching occlusion culling - performance

I’m just working on an interior scene with lots of identical small machinery parts.
First thing i did was to try how good batching works, so i put it into unity without merging any parts before and it worked great. Stats say sometimes up to 80 automatically batched objects. Next step is occlusion culling which also worked good.

But anyway performance on the ipod touch 1st gen is still a bit to slow at some points of the room.

I thought at the beginning that so many single objects would be an overkill for the automatic batching. I could merge the objects optimized for the occlusion culling, will that help? Or is the number of single objects not that important?

if batching works automatically and occlusion culling is setup there is no point in toying with it as you won’t get more performance, you can only lose it by fighting against occlusion culling when you combine them.

I would recommend to run it with the profiler and get some data.
Perhaps the slowdown is bound to the physics / collision (for example using mesh colliders could bite you that badly)

I have no mesh colliders in the scene - i’ll use primitives later.

The room contains 312 meshes - the maximum possible batches are 245.
A total of 10.4k tri - 14.8k verts. (I think the maximum visible while turning around in the room is about 7k)

Isn’t always checking 312 meshes for batching and culling to much?

batched 245 is about 225 too many.

You have a drawcall budget of roughly 30

Checking all that objects can potentially be a bit taxing, but as said: use the profiler, potentially additionally the gpu profiler in a second go to see what really is causing it.

blind guessing won’t help you :slight_smile:

But isn’t 245 the number of batched objects itself? There are “only” 312 meshes/objects at all - shouldn’t 245 batched draw calls need at least 490 pairs of identical objects?

I’ve got this number by placing the whole scene into the camera view and deactivating the occlusion culling before. This way emulated draw calls are 120 - but when the camera is placed inside the room the draw calls will go drastically down.
I’ll try some merging and more mesh optimizing now.

Is that the number of emulated drawcalls or objects?
The only interesting measure is the number of emulated drawcalls, there you have a budget of about 30

I would highly recommend to first do profiling then do other things.
It might show you an issue you didn’t even think about.

Also what was not talked about yet: do you have sounds playing in parallel and alike already present?
Or do you have monobehaviours on each single object that has update / fixedupdate?
Because that would be things that would have to be adressed.

It’s just a test of the scene, with the character controller from the iphone standard assets - nothing else but the room and the moving character.

Yes i really come sometimes over the 30 draw calls so i need to merge.

Did you ensure that your models use the exactly same material.

yes, anyway i found the problem: it’s a vertex light :sweat_smile: it affects the number of draw calls when batching by factor 10-20