Sps with material plugin

A SPS is drawn with a single draw call, so all elements from the SPS are drawn with the same material. What you can do is to create a vertex buffer that gives you the instance id in the shader: