本文整理汇总了C++中IDriver::supportEMBM方法的典型用法代码示例。如果您正苦于以下问题:C++ IDriver::supportEMBM方法的具体用法?C++ IDriver::supportEMBM怎么用?C++ IDriver::supportEMBM使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDriver
的用法示例。
在下文中一共展示了IDriver::supportEMBM方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isSupportedByDriver
// ***************************************************************************
bool CMaterial::isSupportedByDriver(IDriver &drv, bool forceBaseCaps) const
{
uint numTexStages = drv.getNbTextureStages();
// special case for radeon : though 3 stages are supported, do as if there were only 2, because of the texEnvColor feature
// not managed in Direct3D : emulation is provided, but for no more than 2 constants (and if diffuse is not used)
if (numTexStages == 3) numTexStages = 2;
if (forceBaseCaps) numTexStages = std::min(numTexStages, (uint) 2);
switch(getShader())
{
case Normal:
{
if (getNumUsedTextureStages() > numTexStages) return false;
// see if each tex env is supported
for(uint k = 0; k < IDRV_MAT_MAXTEXTURES; ++k)
{
if (getTexture(k))
{
switch(getTexEnvOpRGB(k))
{
case InterpolateConstant: if (!drv.supportBlendConstantColor()) return false;
case EMBM: if (forceBaseCaps || !drv.supportEMBM() || !drv.isEMBMSupportedAtStage(k)) return false;
case Mad: if (!drv.supportMADOperator()) return false;
default: break;
}
switch(getTexEnvOpAlpha(k))
{
case InterpolateConstant: if (!drv.supportBlendConstantColor()) return false;
case EMBM: if (forceBaseCaps || !drv.supportEMBM() || !drv.isEMBMSupportedAtStage(k)) return false;
case Mad: if (!drv.supportMADOperator()) return false;
default: break;
}
}
}
return true;
}
break;
case Bump: return false; // not impl.
case UserColor: return true;
case LightMap: return true;
case Specular: return true;
case Caustics: return false;
case PerPixelLighting: return drv.supportPerPixelLighting(true);
case PerPixelLightingNoSpec: return drv.supportPerPixelLighting(false);
case Cloud: return true;
case Water: return true;
default:
nlassert(0); // unknown shader, must complete
}
return false;
}