- Home /
[SOLVED] Dynamic batching doesn't work when using "Standard" shader. Can someone explain why ?
Hi,
I tried to dynamically batch some objects that have less than 300 verts and tris and the objects do not batch when they have the standard shader on them. When using unlit mobile shader dynamic batching works fine. Why is this happening ? If you know why please reply.
Thank you, Gerald.
I used frame debugger and the reason that objects were not batching was because I didn't enable GPU Instancing of Standard shader. Thank you @Glurth.
Answer by chmodseven · May 03, 2018 at 03:17 PM
With the Standard shader, you've got yet another set of verts involved for the lighting data so the actual limit drops even further to 225 verts. Unlit and the old legacy Diffuse don't have the extra set, which is why they still work okay. As I recall, the hard limit is something like 900 verts, but that gets divided by how many sets (i.e. mesh verts, UV, lighting, etc) you're using. So for 3 sets of verts it's 300, and for 4 sets which Standard uses it's 225.
Yes it's 900 vertex attributes (position, normal, uv, uv2, color, tangent, ...)
Also keep in $$anonymous$$d that just using the same shader is not enough. You have to use the same shared material. That also means you must not access the "material" or "materials" property of a renderer as this will instantiate the material.
Your answer

Follow this Question
Related Questions
Unity 5, uv not working in standard shader 3 Answers
Has line on the edge of the mesh when use fade shader. Any idea how to solve? 0 Answers
Please help me resolve these errors related to shaders. 0 Answers
How to convert Legacy/Particles/Alpha Blended to Standard?And How to configure the standard option? 0 Answers
Warp StandardSpecular Reflections WITHOUT Affecting Viewdir? 0 Answers