# Warning: A different rendering setup is being used for rendering than the one used for instantiating. Batch break.

- **ID:** `unity/rendering-batch-break-instantiation`
- **Domain:** unity
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Material property blocks or shader keywords differ between instantiation and rendering of a GameObject, causing the GPU instancing batch to break.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2022.3 | active | — | — |
| Unity 2023.1 | active | — | — |
| Unity 2021.3 | active | — | — |

## Workarounds

1. **Ensure all instanced objects use the same MaterialPropertyBlock values by assigning them in a single batch: `MaterialPropertyBlock block = new MaterialPropertyBlock(); renderer.GetPropertyBlock(block); block.SetColor("_Color", Color.red); renderer.SetPropertyBlock(block);`** (80% success)
   ```
   Ensure all instanced objects use the same MaterialPropertyBlock values by assigning them in a single batch: `MaterialPropertyBlock block = new MaterialPropertyBlock(); renderer.GetPropertyBlock(block); block.SetColor("_Color", Color.red); renderer.SetPropertyBlock(block);`
   ```
2. **Disable per-instance shader keywords by removing `#pragma multi_compile` variants that vary per object, or use `Shader.EnableKeyword` globally.** (75% success)
   ```
   Disable per-instance shader keywords by removing `#pragma multi_compile` variants that vary per object, or use `Shader.EnableKeyword` globally.
   ```
3. **Use `Graphics.DrawMeshInstanced` with a shared material and property block array instead of individual renderers.** (85% success)
   ```
   Use `Graphics.DrawMeshInstanced` with a shared material and property block array instead of individual renderers.
   ```

## Dead Ends

- **** — Disabling GPU instancing globally reduces performance and doesn't address the root cause of property block mismatch. (40% fail)
- **** — Setting material.renderQueue manually often ignores the underlying shader property block differences. (60% fail)
- **** — Using MaterialPropertyBlock.Clear() before every draw call may cause flickering and still not synchronize with instancing. (50% fail)
