Is it possible to set per-renderer renderQueue without instantiating a material?

Simple question, just as the title say - is it possible to set per-renderer renderQueue without instantiating a material? I saw MaterialPropertyBlocks can do that with other shader properties, but didn’t find a way to set render queues in similar way.

Also, on the related subject - do you have to add [PerRendererData] attributes in your shader code to gain performance benefits from using MaterialPropertyBlocks?

If anyone wonders about the answer, I found this:

It was very well hidden. All renderers have API for it but only sprites expose it in the editor. Setting values to renderer.sortingOrder = … instead of renderer.material.renderQueue = … seems to have the same effect.

Does anyone know are there some downsides to using this to sort render order?

1 Like