- Home /
Does dynamic batching and vertex shader work together?
I want to know if it is technically possible to create a shader that allows dynamic batching and vertex displacement together. I work with shader forge and found out, that the vertex shader doesn't work in my case, when I allow dynamic batching.
best, Andre
Answer by SkandYxyz · Jan 28, 2016 at 08:30 PM
Okay, i have been able to use vertex displacement and dynamic batching together with shaderforge, so yes it is possible.
But you need to take care of scaling, In my case my mesh had a very big scaling and i didn't recognize the displacement.
The interesting thing here is, that the scaling is different, if I disable dynamic batching or enable it. This might be a shaderforge or unity related behaviour.
Another very annoying behaviour i recognize is, that when using dynamic batching, the scaling changes from time to time. sometimes it is the same as without dynamic batching and sometimes it is multiplied with the object localscaling.
Unfortunately this is a question leading to more questions, but I share my experience ;) Maybe it is better to have the same localObjectScaling=1 in every batched object and do the scaling with the vertex shader. This would prevent this issues.
Your answer
Follow this Question
Related Questions
Dissable Batching in Shader 0 Answers
Dynamic batching and object local vertex position 0 Answers
How do I set up custom shader options without killing batching? 0 Answers
Dynamic Batching and vertex shader animation 2 Answers
Add new vertex attributes for a shader,Create vertex attributes 0 Answers