本文整理汇总了C++中ogre::Technique::getSchemeName方法的典型用法代码示例。如果您正苦于以下问题:C++ Technique::getSchemeName方法的具体用法?C++ Technique::getSchemeName怎么用?C++ Technique::getSchemeName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Technique
的用法示例。
在下文中一共展示了Technique::getSchemeName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reset
void MeshResourceMarker::reset()
{
//destroy entity
if (entity_)
{
context_->getSceneManager()->destroyEntity( entity_ );
entity_ = 0;
}
// destroy all the materials we've created
S_MaterialPtr::iterator it;
for ( it = materials_.begin(); it!=materials_.end(); it++ )
{
Ogre::MaterialPtr material = *it;
if (!material.isNull())
{
for (size_t i = 0; i < material->getNumTechniques(); ++i)
{
Ogre::Technique* t = material->getTechnique(i);
// hack hack hack, really need to do a shader-based way of picking, rather than
// creating a texture for each object
if (t->getSchemeName() == "Pick")
{
Ogre::TextureManager::getSingleton().remove(t->getPass(0)->getTextureUnitState(0)->getTextureName());
}
}
material->unload();
Ogre::MaterialManager::getSingleton().remove(material->getName());
}
}
materials_.clear();
}
示例2: handleSchemeNotFound
//copied from ogre sample browser
Ogre::Technique* gkMaterialLoader::handleSchemeNotFound(unsigned short schemeIndex, const Ogre::String& schemeName,
Ogre::Material* originalMaterial, unsigned short lodIndex, const Ogre::Renderable* rend)
{
#ifdef OGREKIT_USE_RTSHADER_SYSTEM
Ogre::RTShader::ShaderGenerator* shaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
GK_ASSERT(shaderGenerator);
Ogre::Technique* generatedTech = 0;
if (schemeName == Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME)
{
bool techniqueCreated;
techniqueCreated = shaderGenerator->createShaderBasedTechnique(
originalMaterial->getName(), Ogre::MaterialManager::DEFAULT_SCHEME_NAME, schemeName);
if (techniqueCreated)
{
shaderGenerator->validateMaterial(schemeName, originalMaterial->getName());
Ogre::Material::TechniqueIterator itTech = originalMaterial->getTechniqueIterator();
while (itTech.hasMoreElements())
{
Ogre::Technique* curTech = itTech.getNext();
if (curTech->getSchemeName() == schemeName)
{
generatedTech = curTech;
break;
}
}
}
}
if (!generatedTech)
{
gkLogMessage("Material: " << schemeName << " isn't found.");
}
else
{
gkLogMessage("Material: " << schemeName << " is found.");
}
return generatedTech;
#else
return 0;
#endif
}
示例3: handleSchemeNotFound
/** This class demonstrates basic usage of the RTShader system.
It sub class the material manager listener class and when a target scheme callback
is invoked with the shader generator scheme it tries to create an equivalent shader
based technique based on the default technique of the given material.
*/
Ogre::Technique* MaterialMgrListener::handleSchemeNotFound(unsigned short schemeIndex,
const Ogre::String& schemeName, Ogre::Material* originalMaterial, unsigned short lodIndex,
const Ogre::Renderable* rend)
{
Ogre::Technique* generatedTech = NULL;
// Case this is the default shader generator scheme.
if (schemeName == Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME)
{
bool techniqueCreated;
// Create shader generated technique for this material.
techniqueCreated = mShaderGenerator->createShaderBasedTechnique(
originalMaterial->getName(),
Ogre::MaterialManager::DEFAULT_SCHEME_NAME,
schemeName);
// Case technique registration succeeded.
if (techniqueCreated)
{
// Force creating the shaders for the generated technique.
mShaderGenerator->validateMaterial(schemeName, originalMaterial->getName());
// Grab the generated technique.
Ogre::Material::TechniqueIterator itTech = originalMaterial->getTechniqueIterator();
while (itTech.hasMoreElements())
{
Ogre::Technique* curTech = itTech.getNext();
if (curTech->getSchemeName() == schemeName)
{
generatedTech = curTech;
break;
}
}
}
}
return generatedTech;
}