本文整理汇总了C++中ogre::Technique::setShadowCasterMaterial方法的典型用法代码示例。如果您正苦于以下问题:C++ Technique::setShadowCasterMaterial方法的具体用法?C++ Technique::setShadowCasterMaterial怎么用?C++ Technique::setShadowCasterMaterial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Technique
的用法示例。
在下文中一共展示了Technique::setShadowCasterMaterial方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: materialCreated
void App::materialCreated(sh::MaterialInstance* m, const std::string& configuration, unsigned short lodIndex)
{
Ogre::Technique* t = static_cast<sh::OgreMaterial*>(m->getMaterial())->getOgreTechniqueForConfiguration (configuration, lodIndex);
if (pSet->shadow_type == Sh_None)
{
t->setShadowCasterMaterial("");
return;
}
/*if (m->hasProperty("transparent") && m->hasProperty("cull_hardware") &&
sh::retrieveValue<sh::StringValue>(m->getProperty("cull_hardware"), 0).get() == "none")
{
// Crash !?
assert(!MaterialManager::getSingleton().getByName("PSSM/shadow_caster_nocull").isNull ());
t->setShadowCasterMaterial("shadowcaster_nocull");
}*/
if (m->hasProperty("instancing") && sh::retrieveValue<sh::StringValue>(m->getProperty("instancing"), 0).get() == "true")
{
t->setShadowCasterMaterial("shadowcaster_instancing");
}
if (!m->hasProperty("transparent") || !sh::retrieveValue<sh::BooleanValue>(m->getProperty("transparent"), 0).get())
{
t->setShadowCasterMaterial("shadowcaster_noalpha");
}
}
示例2: buildDepthShadowMaterial
//-------------------------------------------------------------------------------
Ogre::MaterialPtr CSceneManagerEditor::buildDepthShadowMaterial(Ogre::MaterialPtr cpyMat)
{
if(mShadowsTechnique->get() >= (int)Ogre::SHADOWTYPE_TEXTURE_ADDITIVE && mShadowsTechnique->get() <= (int)Ogre::SHADOWTYPE_TEXTURE_MODULATIVE_INTEGRATED)
{
Ogre::String matName = "DepthShadows/" + cpyMat->getName();
Ogre::MaterialPtr ret = Ogre::MaterialManager::getSingleton().getByName(matName);
if (ret.isNull())
{
ret = cpyMat->clone(matName);
Ogre::Technique *t = ret->getTechnique(0);
t->setShadowCasterMaterial("Ogre/shadow/depth/caster");
Ogre::Pass *p = t->getPass(0);
p->setVertexProgram("Ogre/shadow/receiver/depth/pssm3/vp");
p->setFragmentProgram("Ogre/shadow/receiver/depth/pssm3/fp");
Ogre::TextureUnitState *tu = p->createTextureUnitState();
tu->setName("shadow0");
tu->setContentType(Ogre::TextureUnitState::CONTENT_SHADOW);
tu->setTextureAddressingMode(Ogre::TextureUnitState::TAM_BORDER);
tu->setTextureBorderColour(Ogre::ColourValue(1,1,1,1));
tu = p->createTextureUnitState();
tu->setName("shadow1");
tu->setContentType(Ogre::TextureUnitState::CONTENT_SHADOW);
tu->setTextureAddressingMode(Ogre::TextureUnitState::TAM_BORDER);
tu->setTextureBorderColour(Ogre::ColourValue(1,1,1,1));
tu = p->createTextureUnitState();
tu->setName("shadow2");
tu->setContentType(Ogre::TextureUnitState::CONTENT_SHADOW);
tu->setTextureAddressingMode(Ogre::TextureUnitState::TAM_BORDER);
tu->setTextureBorderColour(Ogre::ColourValue(1,1,1,1));
Ogre::Vector4 splitPoints;
const Ogre::PSSMShadowCameraSetup::SplitPointList& splitPointList =
static_cast<Ogre::PSSMShadowCameraSetup*>(mPSSMSetup.get())->getSplitPoints();
for (int i = 0; i < 3; ++i)
{
splitPoints[i] = splitPointList[i];
}
p->getFragmentProgramParameters()->setNamedConstant("pssmSplitPoints", splitPoints);
}
return ret;
}
else
return cpyMat;
}
示例3: 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;
}
示例4: 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;
}