- Home /
Negative Scale and Dynamic Batching
I have 4 copies of a prefab in a scene with just a camera. Unity 5.2.0f3. Camera is perspective, prefab is mesh, material + texture. A (0, 0, 0) B (5, 0, 0) C (0, 0, 10) D (10, 0, 10)
First Question: All 5 of them dynamically batch into a single draw call. If I set any of them to a negative scale on X, the batch is broken. Now, I would like for the negatively scaled asset to also batch, but of more concern to me is that if I set B or C this way, I get not 2 but 3 draw calls. Groups of opaque renderers should not have their batching interrupted like this. Can anyone shed some light on this?
Second Question: If I have more than one of them with negative scale, those ones do not batch. Unity documentation states that multiple objects with non-uniform scale will batch with each other, so even if they don't batch with the non-scaled ones, they should still batch with each other. Can anybody explain why this is the case?
Answer by Dave-Carlile · Sep 18, 2015 at 12:35 PM
There are lots of things that can prevent batching. According to the documentation,
Generally, objects should be using the same transform scale.
I had two very specific questions about the inner workings of dynamic batching, and you linked me to the batching overview page and then quoted it. That doesn't provide any new information on either of my questions. I specifically mentioned in my second question that the objects which aren't batching do have the same transform scale.
Well, you know, sometimes things get misread, so have patience. The point was, batching can be finicky and it's easy to miss something.
Searching around it seems like there are issues with negative scales breaking batches, but I wasn't able to find anyone who could say why. Workarounds included reversing the texture or rotating the object and using a positive scale, but those folks were using sprites so that probably isn't a solution for you. $$anonymous$$aybe one of the smart people will chime in.
Answer by jackerlo · Oct 07, 2018 at 04:39 AM
October 2018 and back to this question, any solvets yet?
Your answer
Follow this Question
Related Questions
Is it possible to mirror a gameobject in shader ? 1 Answer
Should I build my level with few meshes or many meshes on the iPhone? 1 Answer
Batching problem: Poor forest tiles don't batch [fixed but not sure why xD] 1 Answer
Are batching and atlas almost useless ?!!! 2 Answers
Vertex colours - can they improve performance? Do they affect batching? 1 Answer