25 Reasons to Interrupt Unity Rendering Batches

  1. Additional Vertex Streams  — The object specifies additional streams of vertex information using MeshRenderer.additionalVertexStreams.

  2. Deferred Objects on Different Lighting Layers  — The object is on a different lighting layer.

  3. Deferred Objects Split by Shadow Distance  — One of the two objects is within the shadow distance and the other is not.

  4. Different Combined Meshes  — The object belongs to another static mesh that has been merged.

  5. Different Custom Properties  — This object sets a different MaterialProperyBlock.

  6. Different Lights  — the object is affected by a different Forward Light

  7. Different Materials  — The object uses different materials.

  8. Different Reflection Probes  — This object is affected by different Reflection Probes.

  9. Different Shadow Caster Hash  — This object uses a different shadow casting shader, or has different shader parameters/keywords that affect the output of the shadow casting pass.

  10. Different Shadow Receiving Settings  — This object has different Receive Shadows parameters set, or some objects are within shadow distance and others are outside.

  11. Different Static Batching Flags  — This object uses different static batching settings.

  12. Dynamic Batching Disabled to Avoid Z-Fighting  - Dynamic batching is turned off in Player Settings, or temporarily turned off in the current environment to avoid Z-Fighting.

  13. Instancing Different Geometries  — Render different meshes or sub-mesh using GPU Instancing.

  14. Lightmapped Objects  — Objects that use different lightmaps, or have different lightmap UV conversion relationships in the same lightmap.

  15. Lightprobe Affected Objects  — Objects are affected by other Light Probes.

  16. Mixed Sided Mode Shadow Casters  — Objects have different Cast Shadows settings.

  17. Multipass  — The object uses a shader with multiple passes.

  18. Multiple Forward Lights  — This object is affected by the rendering of multiple forward lights.

  19. Non-instanceable Property Set  — Sets non-instanced properties for instanced shaders.

  20. Odd Negative Scaling  — The object is scaled to oddly negative values, such as (1,-1,1).

  21. Shader Disables Batching  — The shader explicitly disables batching using the "DisableBatching" tag.

  22. Too Many Indices in Dynamic Batch  — Too many dynamic batch indexes (over 32k).

  23. Too Many Indices in Static Batch  — Too many combined grid indices in Static Batch. 48k for OpenGL ES, 32k for OSX, and 64k for other platforms.

  24. Too Many Vertex Attributes for Dynamic Batching  — Submesh to be dynamically batched has over 900 vertex attributes.

  25. Too Many Vertices for Dynamic Batching  — The number of submesh vertices to be dynamically batched exceeds 300.

This project demonstrates different situations where Unity has to interrupt a batch while rendering.
Best used with Unity 5.6b4+, the frame debugger window shows why Unity is starting a new batch.

GitHub - Unity-Technologies/BatchBreakingCause: This project demonstrates different cases when Unity has to break a batch while rendering.

For Article 7:

Using a material property block is faster than using a material, and costs almost a quarter of the time spent manipulating a material. At the same time, whether it is a material or a material property block, the first operation takes more time than the subsequent operations. Especially the material, it can be seen that when the material is used for the first time to change the attribute operation, the cost of the copy operation is still very large. 

Replacing Material Property Actions with MaterialPropertyBlock - UWA Blog

Guess you like

Origin blog.csdn.net/qq_42672770/article/details/122995901