OK, I seem to be getting confused with drawcalls and batching here. I am building my levels on a grid so I create parts of a level and build it in unity with the vertex snapping feature. All these meshes are less than 4 verts, basically a flat plane. Then I apply one material to all of them giving them the same material which logically means that I should only get 1 drawcall, but by the look of this picture, I am getting 30 drawcalls, sometimes 30+ depending on the shader used, what in the world is going on here?
It only means 1 drawcall if you never touch the material. should you do it at runtime then it will result in a cloned material and thus no batching any longer.
also the quads must not use skinned renderers as skinned models no longer batch in U3
In addition you might be missinterpreting it if you use pixel light for example which adds 1 drawcall per affected model
These arent skinned…these are simple planes (squares), I tested all the Unity built in shaders and i still get that amount of draw calls, there is no code at work here, these were all built in the editor. Also weird though in the status screen it says 1584 batched…
This is the only thing in the scene, i even opened a new scene and dropped this in and I still got 30 drawcalls, plus I just profiled it and the rendering is being killed at 65 with frametime averaging 95…not good…Im using the default diffuse shader for testing…
I just rechecked your image to be on the sure side.
But 1 thing to keep in mind is that it will never end on 1 drawcall.
Keep in mind, the idea of batching is that it becomes faster than it would be if it kept the meshes seperated, as such there is a border on how many distinct objects it will combine.
This border normally is in the range of 50-100 objects. (it depends on what information your mesh transports. optimally you only have vertex position + UV if you want as many objects per batch as possible and other factors)
Though if it reduced to 1 drawcall, your problem would be present but much worse performance wise actually, it would run at 10-15% of what you have at the time, perhaps 20% if you are lucky
You fire through a good 1600 objects which, given you want to go to mobile, is beyond any reasonable targeting I fear.
Get down to a few hundred at maximum that are in view at a time, optimally less.
I don’t assume you really need all of these to be dynamically drawn on their own (as I’ve not met a single thing requiring this in 15 years) so you optimally do the merging of the meshes into new meshes in the editor already as offline costs are “free” for the end performance.
If this is for something like a tilemap system, then I would recommend to do it correctly, which means that you have a tilemap management class that modifies 1 mesh (or 1 mesh per layer) as required instead of handling hundreds to thousands of single objects
So I am slowly selecting each mesh and noticing that some have different scales so i went back to maya and realized that i didnt freeze transforms on the scales, so I did that and reimported them which dropped the drawcalls dramatically. Thanks for the info too, I wont be showing the whole level all time, it was just a test for performance, the camera shows no more than 120 things being batched at a time.