Ogre::MaterialPtr mat = Ogre::MaterialManager::getSingleton().getByName("MyMaterial"); Ogre::Technique* tech = mat->getBestTechnique();
// Assume we have some mesh instance Ogre::MeshPtr mesh = Ogre::MeshManager::getSingleton().load("MyMesh.mesh", "General"); Ogre::Entity* entity = mSceneMgr->createEntity(mesh); Ogre::MaterialPtr mat = entity->getSubEntity(0)->getMaterial(); Ogre::Technique* tech = mat->getBestTechnique();In this example, we create an Ogre Entity based on a loaded mesh file and then retrieve the Material and getBestTechnique pointer for one of its SubEntities. Ogre3D is an open-source C++ graphics rendering engine library that can be used to create interactive 3D applications and games.