本文整理汇总了C++中ogre::MaterialPtr::setFog方法的典型用法代码示例。如果您正苦于以下问题:C++ MaterialPtr::setFog方法的具体用法?C++ MaterialPtr::setFog怎么用?C++ MaterialPtr::setFog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::MaterialPtr
的用法示例。
在下文中一共展示了MaterialPtr::setFog方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateRenderTargetOverlay
void RenderWindow::CreateRenderTargetOverlay(int width, int height)
{
width = max(1, width);
height = max(1, height);
Ogre::TexturePtr renderTarget = Ogre::TextureManager::getSingleton().createManual(
rttTextureName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME,
Ogre::TEX_TYPE_2D, width, height, 0, Ogre::PF_A8R8G8B8, Ogre::TU_DYNAMIC_WRITE_ONLY_DISCARDABLE);
Ogre::MaterialPtr rttMaterial = Ogre::MaterialManager::getSingleton().create(
rttMaterialName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
Ogre::TextureUnitState *rttTuState = rttMaterial->getTechnique(0)->getPass(0)->createTextureUnitState();
rttTuState->setTextureName(rttTextureName);
rttTuState->setTextureFiltering(Ogre::TFO_NONE);
rttTuState->setNumMipmaps(1);
rttTuState->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP);
rttMaterial->setFog(true, Ogre::FOG_NONE); ///\todo Check, shouldn't here be false?
rttMaterial->setReceiveShadows(false);
rttMaterial->setTransparencyCastsShadows(false);
rttMaterial->getTechnique(0)->getPass(0)->setSceneBlending(Ogre::SBF_SOURCE_ALPHA, Ogre::SBF_ONE_MINUS_SOURCE_ALPHA);
rttMaterial->getTechnique(0)->getPass(0)->setDepthWriteEnabled(false);
rttMaterial->getTechnique(0)->getPass(0)->setDepthCheckEnabled(false);
rttMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
rttMaterial->getTechnique(0)->getPass(0)->setCullingMode(Ogre::CULL_NONE);
overlayContainer = Ogre::OverlayManager::getSingleton().createOverlayElement("Panel", "MainWindow Overlay Panel");
overlayContainer->setMaterialName(rttMaterialName);
overlayContainer->setMetricsMode(Ogre::GMM_PIXELS);
overlayContainer->setPosition(0, 0);
overlayContainer->setDimensions((Ogre::Real)width, (Ogre::Real)height);
overlayContainer->setPosition(0,0);
overlay = Ogre::OverlayManager::getSingleton().create("MainWindow Overlay");
overlay->add2D(static_cast<Ogre::OverlayContainer *>(overlayContainer));
overlay->setZOrder(500);
overlay->show();
// ResizeOverlay(width, height);
}