本文整理汇总了C++中TextureUnitState::is3D方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureUnitState::is3D方法的具体用法?C++ TextureUnitState::is3D怎么用?C++ TextureUnitState::is3D使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextureUnitState
的用法示例。
在下文中一共展示了TextureUnitState::is3D方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: checkHardwareSupport
//.........这里部分代码省略.........
compileErrors << "compile error.";
else
compileErrors << "not supported.";
compileErrors << std::endl;
return false;
}
}
if (currPass->hasFragmentProgram())
{
// Check fragment program version
if (!currPass->getFragmentProgram()->isSupported())
{
// Can't do this one
compileErrors << "Pass " << passNum <<
": Fragment program " << currPass->getFragmentProgram()->getName()
<< " cannot be used - ";
if (currPass->getFragmentProgram()->hasCompileError())
compileErrors << "compile error.";
else
compileErrors << "not supported.";
compileErrors << std::endl;
return false;
}
}
else
{
// Check a few fixed-function options in texture layers
Pass::TextureUnitStateIterator texi = currPass->getTextureUnitStateIterator();
size_t texUnit = 0;
while (texi.hasMoreElements())
{
TextureUnitState* tex = texi.getNext();
// Any Cube textures? NB we make the assumption that any
// card capable of running fragment programs can support
// cubic textures, which has to be true, surely?
if (tex->is3D() && !caps->hasCapability(RSC_CUBEMAPPING))
{
// Fail
compileErrors << "Pass " << passNum <<
" Tex " << texUnit <<
": Cube maps not supported by current environment."
<< std::endl;
return false;
}
// Any 3D textures? NB we make the assumption that any
// card capable of running fragment programs can support
// 3D textures, which has to be true, surely?
if (tex->getTextureType() == TEX_TYPE_3D && !caps->hasCapability(RSC_TEXTURE_3D))
{
// Fail
compileErrors << "Pass " << passNum <<
" Tex " << texUnit <<
": Volume textures not supported by current environment."
<< std::endl;
return false;
}
// Any Dot3 blending?
if (tex->getColourBlendMode().operation == LBX_DOTPRODUCT &&
!caps->hasCapability(RSC_DOT3))
{
// Fail
compileErrors << "Pass " << passNum <<
" Tex " << texUnit <<
": DOT3 blending not supported by current environment."
<< std::endl;
return false;
}
++texUnit;
}
// We're ok on operations, now we need to check # texture units
if (!currPass->hasFragmentProgram())
{
// Keep splitting this pass so long as units requested > gpu units
while (numTexUnitsRequested > numTexUnits)
{
// chop this pass into many passes
currPass = currPass->_split(numTexUnits);
numTexUnitsRequested = currPass->getNumTextureUnitStates();
// Advance pass number
++passNum;
// Reset iterator
i = mPasses.begin() + passNum;
// Move the new pass to the right place (will have been created
// at the end, may be other passes in between)
assert(mPasses.back() == currPass);
std::copy_backward(i, (mPasses.end()-1), mPasses.end());
*i = currPass;
// Adjust pass index
currPass->_notifyIndex(passNum);
}
}
}
}
// If we got this far, we're ok
return true;
}