本文整理汇总了C++中ogre::Technique::setSchemeName方法的典型用法代码示例。如果您正苦于以下问题:C++ Technique::setSchemeName方法的具体用法?C++ Technique::setSchemeName怎么用?C++ Technique::setSchemeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Technique
的用法示例。
在下文中一共展示了Technique::setSchemeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: handleSchemeNotFound
Ogre::Technique* GBufferSchemeHandler::handleSchemeNotFound(unsigned short schemeIndex,
const Ogre::String& schemeName, Ogre::Material* originalMaterial, unsigned short lodIndex,
const Ogre::Renderable* rend)
{
Ogre::MaterialManager& matMgr = Ogre::MaterialManager::getSingleton();
Ogre::String curSchemeName = matMgr.getActiveScheme();
matMgr.setActiveScheme(Ogre::MaterialManager::DEFAULT_SCHEME_NAME);
Ogre::Technique* originalTechnique = originalMaterial->getBestTechnique(lodIndex, rend);
matMgr.setActiveScheme(curSchemeName);
Ogre::Technique* gBufferTech = originalMaterial->createTechnique();
gBufferTech->removeAllPasses();
gBufferTech->setSchemeName(schemeName);
Ogre::Technique* noGBufferTech = originalMaterial->createTechnique();
noGBufferTech->removeAllPasses();
noGBufferTech->setSchemeName("NoGBuffer");
for (unsigned short i=0; i<originalTechnique->getNumPasses(); i++)
{
Ogre::Pass* originalPass = originalTechnique->getPass(i);
PassProperties props = inspectPass(originalPass, lodIndex, rend);
if (!props.isDeferred)
{
//Just copy the technique so it gets rendered regularly
Ogre::Pass* clonePass = noGBufferTech->createPass();
*clonePass = *originalPass;
continue;
}
Ogre::Pass* newPass = gBufferTech->createPass();
MaterialGenerator::Perm perm = getPermutation(props);
const Ogre::MaterialPtr& templateMat = mMaterialGenerator.getMaterial(perm);
//We assume that the GBuffer technique contains only one pass. But its true.
*newPass = *(templateMat->getTechnique(0)->getPass(0));
fillPass(newPass, originalPass, props);
}
return gBufferTech;
}
示例2: createConfiguration
bool OgreMaterial::createConfiguration (const std::string& name)
{
for (int i=0; i<mMaterial->getNumTechniques(); ++i)
{
if (mMaterial->getTechnique(i) == mMaterial->getTechnique(name))
return false;
}
Ogre::Technique* t = mMaterial->createTechnique();
t->setSchemeName (name);
t->setName (name);
if (mShadowCasterMaterial != "")
t->setShadowCasterMaterial(mShadowCasterMaterial);
return true;
}
示例3: createConfiguration
bool OgreMaterial::createConfiguration (const std::string& name, unsigned short lodIndex)
{
for (int i=0; i<mMaterial->getNumTechniques(); ++i)
{
if (mMaterial->getTechnique(i)->getSchemeName() == name && mMaterial->getTechnique(i)->getLodIndex() == lodIndex)
return false;
}
Ogre::Technique* t = mMaterial->createTechnique();
t->setSchemeName (name);
t->setLodIndex (lodIndex);
if (mShadowCasterMaterial != "")
t->setShadowCasterMaterial(mShadowCasterMaterial);
mMaterial->compile();
return true;
}