本文整理汇总了C++中ogre::TextureUnitState::setColourOperation方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::setColourOperation方法的具体用法?C++ TextureUnitState::setColourOperation怎么用?C++ TextureUnitState::setColourOperation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::setColourOperation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createMaterial
Ogre::MaterialPtr AssetLoader::createMaterial(Ogre::String name, int index, aiMaterial* mat)
{
Ogre::MaterialManager* omatMgr = Ogre::MaterialManager::getSingletonPtr();
std::ostringstream matname;
matname << name.data() << "_mat";
matname.widen(4);
matname.fill('0');
matname << index;
Ogre::String matName = matname.str();
Ogre::ResourceManager::ResourceCreateOrRetrieveResult status = omatMgr->createOrRetrieve(matName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
Ogre::MaterialPtr omat = status.first;
aiColor4D clr(1.0, 1.0, 1.0, 1.0);
aiGetMaterialColor(mat, AI_MATKEY_COLOR_DIFFUSE, &clr);
omat->getTechnique(0)->getPass(0)->setDiffuse(clr.r, clr.g, clr.b, clr.a);
aiGetMaterialColor(mat, AI_MATKEY_COLOR_SPECULAR, &clr);
omat->getTechnique(0)->getPass(0)->setSpecular(clr.r, clr.g, clr.b, clr.a);
aiGetMaterialColor(mat, AI_MATKEY_COLOR_AMBIENT, &clr);
omat->getTechnique(0)->getPass(0)->setAmbient(clr.r, clr.g, clr.b);
aiGetMaterialColor(mat, AI_MATKEY_COLOR_EMISSIVE, &clr);
omat->getTechnique(0)->getPass(0)->setSelfIllumination(clr.r, clr.g, clr.b);
omat->getTechnique(0)->getPass(0)->setShadingMode(Ogre::SO_GOURAUD);
omat->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBT_TRANSPARENT_ALPHA);
omat->getTechnique(0)->getPass(0)->setLightingEnabled(true);
omat->getTechnique(0)->getPass(0)->setDepthCheckEnabled(true);
//omat->getTechnique(0)->getPass(0)->setVertexColourTracking(Ogre::TVC_DIFFUSE);
aiString path;
aiReturn res = mat->GetTexture(aiTextureType_DIFFUSE, 0, &path);
if (res == AI_SUCCESS) {
Ogre::TextureUnitState* stateBase = omat->getTechnique(0)->getPass(0)->createTextureUnitState();
stateBase->setColourOperation(Ogre::LBO_MODULATE);
stateBase->setTextureName(path.data);
}
return omat;
}