本文整理汇总了C++中ogre::MaterialPtr::getUnsupportedTechniquesExplanation方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialPtr::getUnsupportedTechniquesExplanation方法的具体用法?C++ MaterialPtr::getUnsupportedTechniquesExplanation怎么用?C++ MaterialPtr::getUnsupportedTechniquesExplanation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MaterialPtr
的用法示例。
在下文中一共展示了MaterialPtr::getUnsupportedTechniquesExplanation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkMaterial
bool ShaderManager::checkMaterial(const std::string& materialName, const std::string& schemeName)
{
// OGRE scheme is switched in caller
Ogre::MaterialPtr material = static_cast<Ogre::MaterialPtr>(Ogre::MaterialManager::getSingleton().load(materialName, "General"));
if (material->getNumSupportedTechniques() == 0) {
S_LOG_INFO("The material '" << material->getName() << "' has no supported techniques with scheme " << schemeName << ". The reason for this is: \n" << material->getUnsupportedTechniquesExplanation());
return false;
}
S_LOG_INFO("The material '" << material->getName() << "' has " << material->getNumSupportedTechniques() << " supported techniques out of " << material->getNumTechniques());
// Check that we use desired scheme, but not fallbacked to default
if (material->getBestTechnique()->getSchemeName() != schemeName) {
S_LOG_INFO("The material '" << material->getName() << "' has best supported scheme " << material->getBestTechnique()->getSchemeName() << ". Was looking for " << schemeName);
return false;
}
S_LOG_INFO("The material '" << material->getName() << "' supported with scheme " << schemeName);
return true;
}
示例2: compileMaterial
bool Simple::compileMaterial(Ogre::MaterialPtr material, std::set<std::string>& managedTextures) const
{
material->removeAllTechniques();
Ogre::Technique* technique = material->createTechnique();
if (!mTerrainPageSurfaces.empty()) {
//First add a base pass
auto surfaceLayer = mTerrainPageSurfaces.begin()->second;
Ogre::Pass* pass = technique->createPass();
pass->setLightingEnabled(false);
Ogre::TextureUnitState * textureUnitState = pass->createTextureUnitState();
textureUnitState->setTextureScale(1.0f / surfaceLayer->getScale(), 1.0f / surfaceLayer->getScale());
textureUnitState->setTextureName(surfaceLayer->getDiffuseTextureName());
textureUnitState->setTextureCoordSet(0);
for (auto& layer : mLayers) {
addPassToTechnique(*mGeometry, technique, layer, managedTextures);
}
}
if (mTerrainPageShadow) {
addShadow(technique, mTerrainPageShadow, material, managedTextures);
}
// addLightingPass(technique, managedTextures);
material->load();
if (material->getNumSupportedTechniques() == 0) {
S_LOG_WARNING("The material '" << material->getName() << "' has no supported techniques. The reason for this is: \n" << material->getUnsupportedTechniquesExplanation());
return false;
}
return true;
}
示例3: compileMaterial
bool Simple::compileMaterial(Ogre::MaterialPtr material)
{
material->removeAllTechniques();
Ogre::Technique* technique = material->createTechnique();
for (SurfaceLayerStore::const_iterator I = mTerrainPageSurfaces.begin(); I != mTerrainPageSurfaces.end(); ++I) {
const TerrainPageSurfaceLayer* surfaceLayer = I->second;
if (I == mTerrainPageSurfaces.begin()) {
Ogre::Pass* pass = technique->createPass();
pass->setLightingEnabled(false);
//add the first layer of the terrain, no alpha or anything
Ogre::TextureUnitState * textureUnitState = pass->createTextureUnitState();
textureUnitState->setTextureScale(1.0f / surfaceLayer->getScale(), 1.0f / surfaceLayer->getScale());
textureUnitState->setTextureName(surfaceLayer->getDiffuseTextureName());
textureUnitState->setTextureCoordSet(0);
} else {
if (surfaceLayer->intersects(*mGeometry)) {
addPassToTechnique(*mGeometry, technique, surfaceLayer);
}
}
}
if (mTerrainPageShadow) {
addShadow(technique, mTerrainPageShadow, material);
}
material->load();
if (material->getNumSupportedTechniques() == 0) {
S_LOG_WARNING("The material '" << material->getName() << "' has no supported techniques. The reason for this is: \n" << material->getUnsupportedTechniquesExplanation());
return false;
}
return true;
}