Batching does not work. Showing Objects have different MaterialPropertyBlock set

I thought that is the point of the whole MaterialPropertyBlock - differnet MatrialPropertyBlock and everything else the same. The code looks like this:

Renderer renderer = GetComponent<Renderer>();
MaterialPropertyBlock propBlock = new MaterialPropertyBlock();
renderer.GetPropertyBlock(propBlock);
propBlock.SetTexture("_MainTex", thumbTex);
renderer.SetPropertyBlock(propBlock);

and shader is a simple Unlit shader with

Properties
{
  [PerRendererData]_MainTex ("Texture", 2D) = "black" {}

The frame debugger still shows these as individual draw calls and does not batch them and reason is
“Objects have different MaterialPropertyBlock set”

1 Like

Material Property Blocks will still break batches - You’re changing the data being sent to the GPU after all.

The benefit of using property blocks is to organize the data in a way that does not require creating new material instances for small changes.

MaterialPropertyBlock Increases Draw Call? ?_ga=2.176209509.1939402863.1578323465-101237914.1464905439

https://thomasmountainborn.com/2016/05/25/materialpropertyblocks/

That makes sense. Thank you