Just wondering if it would be possible to allow developers to choose the batching factors per project/per platform?
Unity has dynamic and static batching that depend upon a set of criteria that trigger whether or not Unity will attempt to batch a mesh that is repeated in the scene?
The trouble is that these parameters seem to vary between versions/builds of Unity and the developer can only tweak their meshes/materials and shaders to gain the best performance from Unity.
So would it not be better to allow the developer to select the parameters for batching or even force Unity to batch specific objects?
If it can batch, I want it to batch. If it cant, I will do my best to make it suitable for batching… Why do you think the developer having control over this would be a good thing?
I don’t think its a case of ‘enforce batching’ option will guarantee it will batch (maybe I’m wrong here - rendering isnt my strong point?), unless the engine with such an option went to the trouble of auto-magically re-uv’ing meshes to use a single texture of course.
Doesn’t that make perfect sense, though? The platform determines the optimum batching properties, which are implemented by the engine. That in turn determines the optimum configuration of our content, which can be implemented by us.
What is an example of a batching criteria that you’d like to change, and how do you think it would positively impact performance and/or workflow?
See that’s the problem as I don’t think the platform or hardware is taken into account, as far as I can tell there is a strict set of fixed criteria for all projects regardless of target hardware or project specific considerations.
So you could be building your game to target the Oculus Rift VR specification hardware, where the GPU could easily batch much more complex scenery but Unity with it’s none configurable batching criteria limits your games performance.
Hopefully DirectX 12 and Vulkan will not be limited in this way but even with closer to the metal API’s we might want more flexible controllable tweakable parameters that are not just locked in stone for all platforms.
There tons of ways to batch depending on the optimal balance. We do nearly all our batching manually (UI does a soild job without too much intervention). By doing it manually (in a few cases at the art level itself), we can be proactive and even a bit predictive. We know at virtually every point what can be in play, and most of the what will becoming next. So we can batch based on actual needs, wether in the scene or not, and we do some shader trickery for low priority stuff. In select cases have alternative assets specifically built to be batched with siblings in certain scenarios.
It’s all about planning. Our game is content heavy, and realistically way over the line for the lowest end devices we support. Barring cutting content, being creative about batching is our only solution. (Mostly) Unity engineers have been very helpful in our addressing our memory challenges, but we are at the point were shaving a Mb or two is a win for us.
On the flip side if you want to break batching, (not sure why you would), that’s, use different materials, extra passes, scaling etc.