- Home /
Lightweight Render Pipeline has increased draw calls
In the project I've been working on, most of my game objects have been using the Mobile/Diffuse shader. It had GPU Instancing enabled so all these objects were being batched nicely.
I recently cloned the project and decided to give LWRP a try. So now, the shader I'm using for these objects is "Lightweight Render Pipeline/Simple Lit". I enabled GPU Instancing for this material as well. However, despite the significant decrease in polygon and vertex count (which is great), the draw calls have increased significantly. In the previous project (with no LWRP), the draw calls fluctuated between 19 and 24. But in this project (with LWRP), the draw calls fluctuate between 130 and 160. What's going on? Why aren't they being batched?
Well that default shader (LWRP/Simple Lit) is a bit lengthy under the hood. It's compiled code goes over 44k lines versus the 2350 for $$anonymous$$obile/Diffuse, although that doesn't necessarily lead to a change in draw calls.
Have you tried using a more barebones custom shader that only performs the diffuse?
No I haven't. Does batching not work with LWRP shaders? I remember watching some talks about LWRP and in the demonstration, the draw calls decreased after using LWRP.