当前位置: 首页>>代码示例>>C++>>正文


C++ CompositionTargetPass::_isSupported方法代码示例

本文整理汇总了C++中CompositionTargetPass::_isSupported方法的典型用法代码示例。如果您正苦于以下问题:C++ CompositionTargetPass::_isSupported方法的具体用法?C++ CompositionTargetPass::_isSupported怎么用?C++ CompositionTargetPass::_isSupported使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CompositionTargetPass的用法示例。


在下文中一共展示了CompositionTargetPass::_isSupported方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: isSupported

//-----------------------------------------------------------------------
bool CompositionTechnique::isSupported(bool acceptTextureDegradation)
{
	// A technique is supported if all materials referenced have a supported
	// technique, and the intermediate texture formats requested are supported
	// Material support is a cast-iron requirement, but if no texture formats 
	// are directly supported we can let the rendersystem create the closest 
	// match for the least demanding technique
	

    // Check output target pass is supported
    if (!mOutputTarget->_isSupported())
    {
        return false;
    }

    // Check all target passes is supported
    TargetPasses::iterator pi, piend;
    piend = mTargetPasses.end();
    for (pi = mTargetPasses.begin(); pi != piend; ++pi)
    {
        CompositionTargetPass* targetPass = *pi;
        if (!targetPass->_isSupported())
        {
            return false;
        }
    }

    TextureDefinitions::iterator i, iend;
    iend = mTextureDefinitions.end();
	TextureManager& texMgr = TextureManager::getSingleton();
    for (i = mTextureDefinitions.begin(); i != iend; ++i)
    {
		TextureDefinition* td = *i;

		// Firstly check MRTs
		if (td->formatList.size() > 
			Root::getSingleton().getRenderSystem()->getCapabilities()->getNumMultiRenderTargets())
		{
			return false;
		}


		for (PixelFormatList::iterator pfi = td->formatList.begin(); pfi != td->formatList.end(); ++pfi)
		{

			// Check whether equivalent supported
			if(acceptTextureDegradation)
			{
				// Don't care about exact format so long as something is supported
				if(texMgr.getNativeFormat(TEX_TYPE_2D, *pfi, TU_RENDERTARGET) == PF_UNKNOWN)
				{
					return false;
				}
			}
			else
			{
				// Need a format which is the same number of bits to pass
				if (!texMgr.isEquivalentFormatSupported(TEX_TYPE_2D, *pfi, TU_RENDERTARGET))
				{
					return false;
				}
			}
		}

		//Check all render targets have same number of bits
		if( !Root::getSingleton().getRenderSystem()->getCapabilities()->
			hasCapability( RSC_MRT_DIFFERENT_BIT_DEPTHS ) && !td->formatList.empty() )
		{
			PixelFormat nativeFormat = texMgr.getNativeFormat( TEX_TYPE_2D, td->formatList.front(),
																TU_RENDERTARGET );
			size_t nativeBits = PixelUtil::getNumElemBits( nativeFormat );
			for( PixelFormatList::iterator pfi = td->formatList.begin()+1;
					pfi != td->formatList.end(); ++pfi )
			{
				PixelFormat nativeTmp = texMgr.getNativeFormat( TEX_TYPE_2D, *pfi, TU_RENDERTARGET );
				if( PixelUtil::getNumElemBits( nativeTmp ) != nativeBits )
				{
					return false;
				}
			}
		}
	}
	
	// Must be ok
	return true;
}
开发者ID:JangoOs,项目名称:kbengine_ogre_demo,代码行数:87,代码来源:OgreCompositionTechnique.cpp


注:本文中的CompositionTargetPass::_isSupported方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。