Figure: CPU material setup is streamlined while the three illustrative draw commands remain.
Figure: CPU material setup is streamlined while the three illustrative draw commands remain.

Cause and mechanism

SRP Batcher reduces CPU setup work for rendering. Vertex animation or Object Space calculations alone do not make a Shader incompatible. Multiple Materials alone are not enough to decide either. Inspect compatibility for the actual Shader and pass, then measure CPU time rather than draw-call count alone.

Check and correct the setup

  1. Inspect SRP batches, shader variants, and renderers in Frame Debugger. Submeshes normally require separate material/pass draws.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data
  2. In handwritten shaders, keep numeric material properties in UnityPerMaterial and built-in per-draw properties in UnityPerDraw. Keep textures and samplers outside constant buffers.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data
  3. Renderers using MaterialPropertyBlock are excluded. Compare instancing for many identical meshes and measure CPU rendering time.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data

Limits and verification

Different materials can share an SRP batch when they use the same variant. Atlasing is a separate draw-count optimization. Choose vertex coordinate spaces for the effect, rather than changing them to fix batching.

A focused diagnostic setup

Place two meshes using one graph/material and compare zero deformation with active deformation. Separate deformation from variants and Renderer settings.

Test in this order

  1. Compare SRP batches and variants with deformation enabled/disabled.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data
  2. Temporarily remove property blocks and differing keywords.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data
  3. Restore the effect and inspect CPU rendering time and displaced bounds independently.
    Inspect positions and directions as separate data
    Inspect positions and directions as separate data

Interpret the result

An unchanged boundary with deformation disabled points elsewhere. SRP Batcher compatibility does not reduce vertex work or automatically merge draws; investigate other bottlenecks too.

Related explanations

References