How to instantiate a Material instance object in c++?