- Home /
Batching Nightmare, What affects dynamic Batching!?
so i have a problem, that can't be fully described with words... I have a script that can organize gameobjects into a small "box" uniformly in 3-space and to the orientation of the object its creating, it does this procedurally through code. this script has scroll functions and all sorts.
so heres the problem... in some instances it decides to create objects that don't dynamically batch even tho they should. and sometimes certain shaders batch... and other times they don't... on the same objects. with no way of knowing why this is trouble shooting it has been unbearable.
so this is a list of things i have figured out effect batching in very unexpected ways...
Realtime Shadows - These stealthily unoptimized things can hinder dynamic batching even in objects that are not even in the raycast. use with extreme caution on low end computers
Parenting - even if you think your scales are all uniform and correct, parents with scale will still change way it dynamically batches
Import Settings - sounds strange, though many of these options effect vertex counts in your seemingly small models. esspecially such options like "Split Tangents", "Generate Lightmap uv's"
Transparencies - Something thats also a bit odd, with alot of transparencies you run into problems (like with trees and branches) with distance sorting and other transparency related operations decreasing how much actually batches.
so to help get an answer I have a this Link, to a test scene that better explains what it is that is happening. this scene comes with the procedural code aswell (tho not commented the best, its there for more indepth reference)
I have also seen Dynamic Batching and Instantiating, which seems like a similar issue.
any help at all would be appreciated
Refer to the answer by nerophon here : http://answers.unity3d.com/questions/36050/why-isnt-dynamic-batching-working.html . Sorry that's all I have apart from the API : http://docs.unity3d.com/Documentation/$$anonymous$$anual/DrawCallBatching.html . $$anonymous$$ain considerations are : vertex information, instanced materials, using SetTextureOffset, transparency, scaling. Check the information under Dynamic Batching in the Unity docs (the second link)
wow to add to the list of things to check for... Post processing effects can add a draw call for every object on the screen... doesn't make much sense, colour correction added 250 draw calls to a scene with 125... watch out for these sneaky buggers :P
"a problem, that can't be fully described with words..." love it ..