MaterialPropertyBlock's SetVectorArray does not work as expected with Standard shader.

Pretty much same exact problem as here MaterialPropertyBlock's SetVectorArray doesn't work as expected

But its not a custom shader. Its default Standard unity shader on unity 2017.2.15

I do the same thing, prep array of colors, feed to Graphics.DrawMeshInstanced(), provide matrices, etc, all works proper, but it takes only the first color from array.

What should i do?

The problem is exactly the same as the one in the thread you linked to.

The Standard Shader doesn’t have the color value setup to be an instanced value. You’ll need to write a custom shader to get that.

1 Like

Before i posted i was looking through all the standard shader files and couldnt find any instanced props and was thinking - hey maybe im just stupid, and its in some other files.

Baffling that its not enabled by default.

1 Like

What if I make a copy of Standard.shader as for example “MyStandard”, add the properties I need in UnityStandardInput.cginc to a UNITY_INSTANCING_BUFFER_START(MyProps), and use UNITY_ACCESS_INSTANCED_PROP(Props, “property”) where needed, would it work?

Yes.