本文整理汇总了C++中ogre::TextureUnitState::setContentType方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::setContentType方法的具体用法?C++ TextureUnitState::setContentType怎么用?C++ TextureUnitState::setContentType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::setContentType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}