本文整理汇总了C++中ogre::material::TechniqueIterator::getNext方法的典型用法代码示例。如果您正苦于以下问题:C++ TechniqueIterator::getNext方法的具体用法?C++ TechniqueIterator::getNext怎么用?C++ TechniqueIterator::getNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::material::TechniqueIterator
的用法示例。
在下文中一共展示了TechniqueIterator::getNext方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReplaceTextureOnMaterial
void ReplaceTextureOnMaterial(Ogre::MaterialPtr material, const std::string& original_name, const std::string& texture_name)
{
if (material.isNull())
return;
Ogre::TextureManager &tm = Ogre::TextureManager::getSingleton();
Ogre::TexturePtr tex = tm.getByName(texture_name);
Ogre::Material::TechniqueIterator iter = material->getTechniqueIterator();
while(iter.hasMoreElements())
{
Ogre::Technique *tech = iter.getNext();
assert(tech);
Ogre::Technique::PassIterator passIter = tech->getPassIterator();
while(passIter.hasMoreElements())
{
Ogre::Pass *pass = passIter.getNext();
Ogre::Pass::TextureUnitStateIterator texIter = pass->getTextureUnitStateIterator();
while(texIter.hasMoreElements())
{
Ogre::TextureUnitState *texUnit = texIter.getNext();
if (texUnit->getTextureName() == original_name)
{
if (tex.get())
texUnit->setTextureName(texture_name);
else
texUnit->setTextureName("TextureMissing.png");
}
}
}
}
}
示例2: SetSelfIllumination
void EC_WidgetCanvas::SetSelfIllumination(bool illuminating)
{
if (material_name_.empty())
return;
Ogre::ColourValue emissiveColor;
if (illuminating)
emissiveColor = Ogre::ColourValue(1.0f, 1.0f, 1.0f, 1.0f);
else
emissiveColor = Ogre::ColourValue(0.0f, 0.0f, 0.0f, 0.0f);
Ogre::MaterialPtr material = Ogre::MaterialManager::getSingleton().getByName(material_name_);
if (!material.isNull())
{
Ogre::Material::TechniqueIterator iter = material->getTechniqueIterator();
while(iter.hasMoreElements())
{
Ogre::Technique *tech = iter.getNext();
if (!tech)
continue;
Ogre::Technique::PassIterator passIter = tech->getPassIterator();
while(passIter.hasMoreElements())
{
Ogre::Pass *pass = passIter.getNext();
if (pass)
pass->setSelfIllumination(emissiveColor);
}
}
}
}
示例3: validateCompositionTargetPass
bool MainCamera::validateCompositionTargetPass(Ogre::CompositionTargetPass& compositionPass)
{
Ogre::CompositionTargetPass::PassIterator compPassIter = compositionPass.getPassIterator();
while (compPassIter.hasMoreElements()) {
Ogre::CompositionPass* compositorPass = compPassIter.getNext();
compositorPass->getMaterial()->load();
Ogre::Material::TechniqueIterator techIter = compositorPass->getMaterial()->getSupportedTechniqueIterator();
while (techIter.hasMoreElements()) {
Ogre::Technique::PassIterator _passIter = techIter.getNext()->getPassIterator();
while (_passIter.hasMoreElements()) {
Ogre::Pass* pass = _passIter.getNext();
//Also disallow camera polygon mode overide. This is because if it's turned on,
//and the camera is switched to polygon mode, the end result will be one single
//large polygon being shown. This is not what we want.
pass->setPolygonModeOverrideable(false);
if (pass->hasFragmentProgram()) {
if (pass->getFragmentProgram()->hasCompileError()) {
return false;
}
}
}
}
}
return true;
}
示例4: Animation
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr, OEngine::Render::OgreRenderer& _rend): Animation(_rend)
{
mInsert = ptr.getRefData().getBaseNode();
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
assert (ref->base != NULL);
if(!ref->base->model.empty())
{
const std::string &mesh = "meshes\\" + ref->base->model;
std::string meshNumbered = mesh + getUniqueID(mesh) + ">|";
NifOgre::NIFLoader::load(meshNumbered);
mBase = mRend.getScene()->createEntity(meshNumbered);
mBase->setVisibilityFlags(RV_Actors);
bool transparent = false;
for (unsigned int i=0; i < mBase->getNumSubEntities(); ++i)
{
Ogre::MaterialPtr mat = mBase->getSubEntity(i)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements())
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements())
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
}
}
}
mBase->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
std::string meshZero = mesh + "0000>|";
if((mTransformations = (NIFLoader::getSingletonPtr())->getAnim(meshZero)))
{
for(std::size_t init = 0; init < mTransformations->size(); init++)
{
mRindexI.push_back(0);
mTindexI.push_back(0);
}
mStopTime = mTransformations->begin()->getStopTime();
mStartTime = mTransformations->begin()->getStartTime();
mShapes = (NIFLoader::getSingletonPtr())->getShapes(meshZero);
}
mTextmappings = NIFLoader::getSingletonPtr()->getTextIndices(meshZero);
mInsert->attachObject(mBase);
}
}
示例5: Animation
CreatureAnimation::CreatureAnimation(const MWWorld::Ptr& ptr): Animation()
{
mInsert = ptr.getRefData().getBaseNode();
MWWorld::LiveCellRef<ESM::Creature> *ref = ptr.get<ESM::Creature>();
assert (ref->mBase != NULL);
if(!ref->mBase->mModel.empty())
{
std::string mesh = "meshes\\" + ref->mBase->mModel;
mEntityList = NifOgre::NIFLoader::createEntities(mInsert, &mTextKeys, mesh);
for(size_t i = 0; i < mEntityList.mEntities.size(); i++)
{
Ogre::Entity *ent = mEntityList.mEntities[i];
ent->setVisibilityFlags(RV_Actors);
bool transparent = false;
for (unsigned int j=0; j < ent->getNumSubEntities() && !transparent; ++j)
{
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements() && !transparent)
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements() && !transparent)
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
}
}
}
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
}
if(mEntityList.mSkelBase)
{
Ogre::AnimationStateSet *aset = mEntityList.mSkelBase->getAllAnimationStates();
Ogre::AnimationStateIterator as = aset->getAnimationStateIterator();
while(as.hasMoreElements())
{
Ogre::AnimationState *state = as.getNext();
state->setEnabled(true);
state->setLoop(false);
}
}
}
}
示例6: 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
}
示例7: while
void
Terrain::_applyFogMode(const Ogre::MaterialPtr& material, Ogre::FogMode oldFogMode, Ogre::FogMode newFogMode) const
{
if (oldFogMode == newFogMode)
return;
if (mData->mSupportedFogReplacements.empty())
return;
Ogre::String newProgramName;
Ogre::Material::TechniqueIterator ti = material->getTechniqueIterator();
while (ti.hasMoreElements())
{
Ogre::Technique* technique = ti.getNext();
Ogre::Technique::PassIterator pi = technique->getPassIterator();
while (pi.hasMoreElements())
{
Ogre::Pass* pass = pi.getNext();
if (pass->hasVertexProgram() &&
_checkFogProgramName(pass->getVertexProgram(), oldFogMode, newFogMode, newProgramName))
{
pass->setVertexProgram(newProgramName);
}
if (pass->hasFragmentProgram() &&
_checkFogProgramName(pass->getFragmentProgram(), oldFogMode, newFogMode, newProgramName))
{
pass->setFragmentProgram(newProgramName);
}
if (pass->hasShadowCasterVertexProgram() &&
_checkFogProgramName(pass->getShadowCasterVertexProgram(), oldFogMode, newFogMode, newProgramName))
{
pass->setShadowCasterVertexProgram(newProgramName);
}
if (pass->hasShadowReceiverVertexProgram() &&
_checkFogProgramName(pass->getShadowReceiverVertexProgram(), oldFogMode, newFogMode, newProgramName))
{
pass->setShadowReceiverVertexProgram(newProgramName);
}
if (pass->hasShadowReceiverFragmentProgram() &&
_checkFogProgramName(pass->getShadowReceiverFragmentProgram(), oldFogMode, newFogMode, newProgramName))
{
pass->setShadowReceiverFragmentProgram(newProgramName);
}
}
}
}
示例8: findFogPassesByName
void GroundFog::findFogPassesByName (const Ogre::String& passName) {
Ogre::MaterialManager *matManager = Ogre::MaterialManager::getSingletonPtr();
Ogre::MaterialManager::ResourceMapIterator matIt = matManager->getResourceIterator();
while (matIt.hasMoreElements()) {
Ogre::MaterialPtr mat = matIt.getNext();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements()) {
Ogre::Technique *tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements()) {
Ogre::Pass *pass = passIt.getNext();
if (pass->getName() == passName) {
mPasses.insert(pass);
}
}
}
}
forceUpdate();
}
示例9: 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;
}
示例10: GetTextureNamesFromMaterial
void GetTextureNamesFromMaterial(Ogre::MaterialPtr material, StringVector& textures)
{
textures.clear();
if (material.isNull())
return;
// Use a set internally to avoid duplicates
std::set<std::string> textures_set;
Ogre::Material::TechniqueIterator iter = material->getTechniqueIterator();
while(iter.hasMoreElements())
{
Ogre::Technique *tech = iter.getNext();
assert(tech);
Ogre::Technique::PassIterator passIter = tech->getPassIterator();
while(passIter.hasMoreElements())
{
Ogre::Pass *pass = passIter.getNext();
Ogre::Pass::TextureUnitStateIterator texIter = pass->getTextureUnitStateIterator();
while(texIter.hasMoreElements())
{
Ogre::TextureUnitState *texUnit = texIter.getNext();
const std::string& texname = texUnit->getTextureName();
if (!texname.empty())
textures_set.insert(texname);
}
}
}
std::set<std::string>::iterator i = textures_set.begin();
while (i != textures_set.end())
{
textures.push_back(*i);
++i;
}
}
示例11: Animation
ActivatorAnimation::ActivatorAnimation(const MWWorld::Ptr &ptr)
: Animation(ptr)
{
MWWorld::LiveCellRef<ESM::Activator> *ref = mPtr.get<ESM::Activator>();
assert (ref->mBase != NULL);
if(!ref->mBase->mModel.empty())
{
std::string mesh = "meshes\\" + ref->mBase->mModel;
createEntityList(mPtr.getRefData().getBaseNode(), mesh);
for(size_t i = 0;i < mEntityList.mEntities.size();i++)
{
Ogre::Entity *ent = mEntityList.mEntities[i];
bool transparent = false;
for (unsigned int j=0;j < ent->getNumSubEntities() && !transparent; ++j)
{
Ogre::MaterialPtr mat = ent->getSubEntity(j)->getMaterial();
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements() && !transparent)
{
Ogre::Technique* tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements() && !transparent)
{
Ogre::Pass* pass = passIt.getNext();
if (pass->getDepthWriteEnabled() == false)
transparent = true;
}
}
}
ent->setVisibilityFlags(RV_Misc);
ent->setRenderQueueGroup(transparent ? RQG_Alpha : RQG_Main);
}
setAnimationSource(mesh);
}
}
示例12: unloadTheMesh
// unload all about this mesh. The mesh itself and the textures.
// BETWEEN FRAME OPERATION
void VisCalcFrustDist::unloadTheMesh(Ogre::MeshPtr meshP) {
if (m_shouldCullTextures) {
Ogre::Mesh::SubMeshIterator smi = meshP->getSubMeshIterator();
while (smi.hasMoreElements()) {
Ogre::SubMesh* oneSubMesh = smi.getNext();
Ogre::String subMeshMaterialName = oneSubMesh->getMaterialName();
Ogre::MaterialPtr subMeshMaterial = (Ogre::MaterialPtr)Ogre::MaterialManager::getSingleton().getByName(subMeshMaterialName);
if (!subMeshMaterial.isNull()) {
Ogre::Material::TechniqueIterator techIter = subMeshMaterial->getTechniqueIterator();
while (techIter.hasMoreElements()) {
Ogre::Technique* oneTech = techIter.getNext();
Ogre::Technique::PassIterator passIter = oneTech->getPassIterator();
while (passIter.hasMoreElements()) {
Ogre::Pass* onePass = passIter.getNext();
Ogre::Pass::TextureUnitStateIterator tusIter = onePass->getTextureUnitStateIterator();
while (tusIter.hasMoreElements()) {
Ogre::TextureUnitState* oneTus = tusIter.getNext();
Ogre::String texName = oneTus->getTextureName();
Ogre::TexturePtr texP = (Ogre::TexturePtr)Ogre::TextureManager::getSingleton().getByName(texName);
if (!texP.isNull()) {
// if (texP.useCount() <= 1) {
texP->unload();
LG::IncStat(LG::StatCullTexturesUnloaded);
// LG::Log("unloadTheMesh: unloading texture %s", texName.c_str());
// }
}
}
}
}
}
}
}
if (m_shouldCullMeshes) {
LG::OLMeshTracker::Instance()->MakeUnLoaded(meshP->getName(), Ogre::String(), NULL);
LG::IncStat(LG::StatCullMeshesUnloaded);
// LG::Log("unloadTheMesh: unloading mesh %s", mshName.c_str());
}
}
示例13: findFogPassesByName
void GroundFog::findFogPassesByName (const Ogre::String& passName) {
Ogre::MaterialManager *matManager = Ogre::MaterialManager::getSingletonPtr();
Ogre::MaterialManager::ResourceMapIterator matIt = matManager->getResourceIterator();
while (matIt.hasMoreElements()) {
#if (OGRE_VERSION < ((1 << 16) | (9 << 8) | 0))
Ogre::MaterialPtr mat = matIt.getNext();
#else
Ogre::MaterialPtr mat = matIt.getNext().staticCast<Ogre::Material>();
#endif
Ogre::Material::TechniqueIterator techIt = mat->getTechniqueIterator();
while (techIt.hasMoreElements()) {
Ogre::Technique *tech = techIt.getNext();
Ogre::Technique::PassIterator passIt = tech->getPassIterator();
while (passIt.hasMoreElements()) {
Ogre::Pass *pass = passIt.getNext();
if (pass->getName() == passName) {
mPasses.insert(pass);
}
}
}
}
forceUpdate();
}
示例14: _updateShaders
//.........这里部分代码省略.........
" { \n";
} else if (blend) {
vertexProgSource += " if (gl_MultiTexCoord0.y != 0.0) \n"
" { \n";
}
if (blend) {
vertexProgSource +=
//Blend the base of nearby grass into the terrain
" color.w = clamp(color.w, 0.0, 1.0) * 4.0 * ((dist / fadeRange) - 0.1); \n"
" } \n";
}
if (fadeTechnique == FADETECH_GROW || fadeTechnique == FADETECH_ALPHAGROW) {
vertexProgSource += " position.y -= grassHeight * clamp((2.0 * dist / fadeRange) - 1.0, 0.0, 1.0); \n";
}
vertexProgSource += " gl_Position = gl_ModelViewProjectionMatrix * position; \n"
" gl_FrontColor = color; \n"
" gl_TexCoord[0] = gl_MultiTexCoord0; \n";
if (geom->getSceneManager()->getFogMode() == Ogre::FOG_EXP2) {
vertexProgSource += " gl_FogFragCoord = clamp(exp(- gl_Fog.density * gl_Fog.density * gl_Position.z * gl_Position.z), 0.0, 1.0); \n";
} else {
vertexProgSource += " gl_FogFragCoord = gl_Position.z; \n";
}
vertexProgSource += "}";
}
vertexShader = HighLevelGpuProgramManager::getSingleton().createProgram(vsName, ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, shaderLanguage, GPT_VERTEX_PROGRAM);
vertexShader->setSource(vertexProgSource);
if (shaderLanguage == "hlsl") {
vertexShader->setParameter("target", "vs_1_1");
vertexShader->setParameter("entry_point", "main");
} else if (shaderLanguage == "cg") {
vertexShader->setParameter("profiles", "vs_1_1 arbvp1");
vertexShader->setParameter("entry_point", "main");
}
// GLSL can only have one entry point "main".
vertexShader->load();
}
//Now the vertex shader (vertexShader) has either been found or just generated
//(depending on whether or not it was already generated).
tmpMat->load();
Ogre::Material::TechniqueIterator techIterator = tmpMat->getSupportedTechniqueIterator();
while (techIterator.hasMoreElements()) {
Ogre::Technique* tech = techIterator.getNext();
//Apply the shader to the material
Pass *pass = tech->getPass(0);
pass->setVertexProgram(vsName);
GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters();
if (shaderLanguage.compare("glsl"))
//glsl can use the built in gl_ModelViewProjectionMatrix
params->setNamedAutoConstant("worldViewProj", GpuProgramParameters::ACT_WORLDVIEWPROJ_MATRIX);
params->setNamedAutoConstant("camPos", GpuProgramParameters::ACT_CAMERA_POSITION_OBJECT_SPACE);
params->setNamedAutoConstant("fadeRange", GpuProgramParameters::ACT_CUSTOM, 1);
if (animate) {
params->setNamedConstant("time", 1.0f);
params->setNamedConstant("frequency", 1.0f);
params->setNamedConstant("direction", Ogre::Vector4::ZERO);
}
if (lighting) {
params->setNamedAutoConstant("objSpaceLight", GpuProgramParameters::ACT_LIGHT_POSITION_OBJECT_SPACE);
params->setNamedAutoConstant("lightDiffuse", GpuProgramParameters::ACT_DERIVED_LIGHT_DIFFUSE_COLOUR);
params->setNamedAutoConstant("lightAmbient", GpuProgramParameters::ACT_DERIVED_AMBIENT_LIGHT_COLOUR);
}
if (fadeTechnique == FADETECH_GROW || fadeTechnique == FADETECH_ALPHAGROW) {
params->setNamedConstant("grassHeight", maxHeight * 1.05f);
}
pass->getVertexProgramParameters()->setNamedConstant("fadeRange", fadeRange);
}
}
//Now the material (tmpMat) has either been found or just created (depending on whether or not it was already
//created). The appropriate vertex shader should be applied and the material is ready for use.
//Apply the new material
material = tmpMat;
}
Ogre::Technique* tech = material->getBestTechnique();
if (tech && tech->getNumPasses()) {
Ogre::Pass* pass = tech->getPass(0);
if (pass->hasVertexProgram()) {
Ogre::GpuProgramParametersSharedPtr params = pass->getVertexProgramParameters();
if (!params.isNull()) {
params->setIgnoreMissingParams(true);
}
}
}
}
}
示例15: SetData
//.........这里部分代码省略.........
Ogre::DataStreamPtr modified_data = Ogre::DataStreamPtr(new Ogre::MemoryDataStream((u8 *)(&output_str[0]), output_str.size()));
matmgr.parseScript(modified_data, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::MaterialPtr tempmat;
tempmat = matmgr.getByName(tempname);
if (tempmat.isNull())
{
OgreRenderingModule::LogWarning(std::string("Failed to create an Ogre material from material asset ") +
source->GetId());
return false;
}
if(!tempmat->getNumTechniques())
{
OgreRenderingModule::LogWarning("Failed to create an Ogre material from material asset " +
source->GetId());
return false;
}
ogre_material_ = tempmat->clone(id_);
tempmat.setNull();
matmgr.remove(tempname);
if (ogre_material_.isNull())
{
OgreRenderingModule::LogWarning("Failed to create an Ogre material from material asset " +
source->GetId());
return false;
}
// Now go through all the texturenames and restore \ back to / and @ to :
Ogre::Material::TechniqueIterator iter = ogre_material_->getTechniqueIterator();
while (iter.hasMoreElements())
{
Ogre::Technique *tech = iter.getNext();
Ogre::Technique::PassIterator passIter = tech->getPassIterator();
while (passIter.hasMoreElements())
{
Ogre::Pass *pass = passIter.getNext();
Ogre::Pass::TextureUnitStateIterator texIter = pass->getTextureUnitStateIterator();
while (texIter.hasMoreElements())
{
Ogre::TextureUnitState *texUnit = texIter.getNext();
std::string texname = texUnit->getTextureName();
if (texname.find('\\') != std::string::npos)
{
ReplaceCharInplace(texname, '\\', '/');
ReplaceCharInplace(texname, '@', ':');
texUnit->setTextureName(texname);
}
}
}
}
//workaround: if receives shadows, check the amount of shadowmaps. If only 1 specified, add 2 more to support 3 shadowmaps
if(ogre_material_->getReceiveShadows() && shadowquality_ == Shadows_High && ogre_material_->getNumTechniques() > 0)
{
Ogre::Technique *tech = ogre_material_->getTechnique(0);
if(tech)
{
Ogre::Technique::PassIterator passiterator = tech->getPassIterator();
while(passiterator.hasMoreElements())
{
Ogre::Pass* pass = passiterator.getNext();
Ogre::Pass::TextureUnitStateIterator texiterator = pass->getTextureUnitStateIterator();
int shadowmaps = 0;
while(texiterator.hasMoreElements())