I’m using shadows causes performance problem because it creates tons of batches.
~25,000 batches, shadows enabled, direct lighting, 124ms frame on a users machine:
i.imgur.com/pfDEx7j.jpg
on my machine:
~29,000 batches, shadows enabled, direct lighting:
i.imgur.com/tDY1CD4.jpg
~4,400 batches, shadows disabled, direct lighting:
i.imgur.com/TRu1ot8.jpg
179 batches, shadows disabled, deferred lighting:
i.imgur.com/gU4BaYD.jpg
I’m using CustomGeometry to create the level models, could it be related to the lack of batching?
It seems like it creates a batch for every visible triangle.
Any idea what might cause it?