- Home /
Batching problem: Poor forest tiles don't batch [fixed but not sure why xD]
Hi,
Some of my objects don't seem to like batching, since they don't want to do it :( Yet others do batch :S I don't know what I'm doing wrong.
My sea-tile batches: (note: batches 64)
Yet my forst don't want to: (note: batches 0 :( )
Both images show a level of 8x8tiles, each tile is one prefad, which I create many times :P
The sea tile is just a cube with the simple water material on it. My forest tile consists out of one cube and three trees, all have the same material:
Is there anything I have to do to make these batch other than giving them the same material ? Or is it something else I'm doing wrong ?
Edit: Each tree has 134 verts, so the entire prefab has more than 400 verts. Though I tried and delete one of the trees (so the prefab has less then 300 verts) but still the non-batching problem stays :S
Edit: FIXED Well I've seem to have fixed it ! It was something with the shader, when I use the diffuse shader that comes with unity (or some other shaders that come with unity, haven't tested them all though) the batching doesn't seem to work. It does work when I use my own custom shader. I don't know what's the difference, but who cares, it works :D
Thanks for the help !
-Pablo
Answer by The-Oddler · Apr 10, 2011 at 12:48 PM
Fixed it myself :D I also added the fix to the main post, but I can't say that it is answered so I'll answer it here myself:
Apparently dynamic batching doesn't work with some shaders. I was using the diffuse shader that comes with unity and when I changed it it suddenly works now ! Not sure why it works with some, and not with other, if anyone knows this I'm very interested in that answer ;)
Greets
-The Oddler
Your answer
Follow this Question
Related Questions
What is the alternative to Material Property Blocks when using SRP Batcher? 0 Answers
Why does the frame debugger say node uses different shader when it isn't? 0 Answers
When Static Batching and building, objects checked Static do not appear 1 Answer
Is there any way I can statically batch procedurally generated objects? 0 Answers
Why scale break a batch? 1 Answer