{ material.SetInt("_StencilRef", x); } relies on serialization. Therefore, if the property is not declared in the *.mat file, attempting to set this property in C# has no effect.