I’m using a custom terrain material (Unity 5.1.2) that has shader that is based on the built-in Standard terrain shader. I have a custom property that I’m setting each frame. It seems that the value of that property is only assigned once and changing it later on has no effect. I’ve played around and noticed that the only way to change the property (terrain.templateMaterial.SetMatrix(“myMatrix”, something) ) is to set the terrain custom material to null at the beginning of the frame and re-apply the material on LateUpdate or something like that. This solves the problem but the performance drops significantly due to reassigning of the material.
Does anyone know why this is happening? I can recall that in the past (Unity 4.x) there was no such problem.