本文整理汇总了C++中TextureUnitState::_setTexturePtr方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::_setTexturePtr方法的具体用法?C++ TextureUnitState::_setTexturePtr怎么用?C++ TextureUnitState::_setTexturePtr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::_setTexturePtr方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
//-----------------------------------------------------------------------
void DeferredLightRenderOperation::execute(SceneManager *sm, RenderSystem *rs)
{
Ogre::Camera* cam = mViewport->getCamera();
mAmbientLight->updateFromCamera(cam);
Technique* tech = mAmbientLight->getMaterial()->getBestTechnique();
injectTechnique(sm, tech, mAmbientLight, 0);
const LightList& lightList = sm->_getLightsAffectingFrustum();
for (LightList::const_iterator it = lightList.begin(); it != lightList.end(); it++)
{
Light* light = *it;
Ogre::LightList ll;
ll.push_back(light);
//if (++i != 2) continue;
//if (light->getType() != Light::LT_DIRECTIONAL) continue;
//if (light->getDiffuseColour() != ColourValue::Red) continue;
LightsMap::iterator dLightIt = mLights.find(light);
DLight* dLight = 0;
if (dLightIt == mLights.end())
{
dLight = createDLight(light);
}
else
{
dLight = dLightIt->second;
dLight->updateFromParent();
}
dLight->updateFromCamera(cam);
tech = dLight->getMaterial()->getBestTechnique();
//Update shadow texture
if (dLight->getCastChadows())
{
SceneManager::RenderContext* context = sm->_pauseRendering();
sm->prepareShadowTextures(cam, mViewport, &ll);
sm->_resumeRendering(context);
Pass* pass = tech->getPass(0);
TextureUnitState* tus = pass->getTextureUnitState("ShadowMap");
assert(tus);
const TexturePtr& shadowTex = sm->getShadowTexture(0);
if (tus->_getTexturePtr() != shadowTex)
{
tus->_setTexturePtr(shadowTex);
}
}
injectTechnique(sm, tech, dLight, &ll);
}
}