Hey!
We’re currently trying to optimize the performance of our game, and we noticed some strange (to us) draw call increase with beast lightmapping.
Here is what we’ve tried:
starting with a new clean scene we place 1 unity cube with 1 material a 1000 times in a grid
camera has all these cubes in view and all are marked static
there a 0 lights in the scene and the pixel lights counts in the quality settings is set to 0
the total vertex count is 24.0k.
-
without lightmapping this it results
in 2 draw calls -
after a beast bake (texel res = 2: resulting in 1: 1k
lightmap) this still gives 2 draw
calls. -
after a beast bake with texel res = 22 resulting in 2: 1k lightmaps this gives 441 draw calls.
Can anyone tell me why this is happening?
Thanks a lot!
Edit:
I’ve edited the above results with using only cubes created in Unity, before i was using a model from my game.
which as dreamora describes can give different results
Update:
When I look at the combined mesh it seems as if it is broken up into 1 or two pieces, i would realy like to know how the batch decides it has to have 441 draw calls instead if the sub 10 I’d expect. It makes no sense to me.
Update 2:
I’ve filed a bug report and a developer is looking into it, will update if the problem is resolved.
Final Update:
I’ve learned that his bug will probably not be resolved anytime soon (not before the next update, if then even)
But Because we are not supporting iPhone 3g and below anyway we found a workaround in using just one 2k lightmap.
This resolution supports our specific needs. And with only 1 lightmap the batching doesn’t break.
Hey! Thanks for the answer! But I'm just using the light for baking, my quality settings are set to fastest with 0 pixel lights. Are they still working on some level? I'll try deleting them to see what happens. ---- Just tried deleting the light in the test scene after the bake and before the bake in both cases the draw calls stay 360. (still only two lightmaps which seems weird on its own as yesterday I had 458 draw calls in the same scene with the same amount of lightmaps)
– Jaywalkerindeed change of drawcalls should not happen with exactly the same amount of data. unless one thing in the level was a terrain, then it potentially could change depending on the view
– DreamoraI've re-tested with just using Unity cubes: no terrain; nothing, but unity cubes. I'm even baking without light. any ideas?
– Jaywalker