# Unity: Shader Graph and GPU-Instancing?

Unity Version: 2019.4.1f1

Render Pipeline: URP

I created a shader using Unity's ShaderGraph, and i want to apply GPU Instancing on this shader, but there is no way to declare per-instance properties inside the shader graph.

Is there a way to make GPU Instancing work on shader graphs' materials?

• It looks like the SRP Batcher is intended to replace the previous instanced rendering behaviour. Have you considered using a custom node in your shader graph to look up per-material properties from cbuffer UnityPerMaterial inside your graph? – DMGregory Jul 6 '20 at 17:03
• @DMGregory No, how can i do that? could you write an answer please. – Fadi Obaji Jul 6 '20 at 17:05
• If I had an answer for you, I'd have posted that instead of a comment. All I have to offer you at the moment are potentially useful avenues of exploration. – DMGregory Jul 6 '20 at 17:07
• I can't say for certain but I think I remember something about using MaterialPropertyBlocks in scripts was supposed to get around the instancing issues. But I could be wrong, this might have just been to increase performance when transferring data to the GPU. – Benjamin Danger Johnson Dec 4 '20 at 1:55

## 1 Answer

You can set the GPU Instancing in the inspector directly on the material you created:

• I did, but changing the material's properties will break the Instancing. – Fadi Obaji Jul 6 '20 at 17:12