本文整理汇总了C++中CompositionPass::getClearDepth方法的典型用法代码示例。如果您正苦于以下问题:C++ CompositionPass::getClearDepth方法的具体用法?C++ CompositionPass::getClearDepth怎么用?C++ CompositionPass::getClearDepth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CompositionPass
的用法示例。
在下文中一共展示了CompositionPass::getClearDepth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: preViewportUpdate
//-----------------------------------------------------------------------
void CompositorChain::preViewportUpdate(const RenderTargetViewportEvent& evt)
{
// Only set up if there is at least one compositor enabled, and it's this viewport
if(evt.source != mViewport || !mAnyCompositorsEnabled)
return;
// set original scene details from viewport
CompositionPass* pass = mOriginalScene->getTechnique()->getOutputTargetPass()->getPass(0);
CompositionTargetPass* passParent = pass->getParent();
if (pass->getClearBuffers() != mViewport->getClearBuffers() ||
pass->getClearColour() != mViewport->getBackgroundColour() ||
pass->getClearDepth() != mViewport->getDepthClear() ||
passParent->getVisibilityMask() != mViewport->getVisibilityMask() ||
passParent->getMaterialScheme() != mViewport->getMaterialScheme() ||
passParent->getShadowsEnabled() != mViewport->getShadowsEnabled())
{
// recompile if viewport settings are different
pass->setClearBuffers(mViewport->getClearBuffers());
pass->setClearColour(mViewport->getBackgroundColour());
pass->setClearDepth(mViewport->getDepthClear());
passParent->setVisibilityMask(mViewport->getVisibilityMask());
passParent->setMaterialScheme(mViewport->getMaterialScheme());
passParent->setShadowsEnabled(mViewport->getShadowsEnabled());
_compile();
}
Camera *cam = mViewport->getCamera();
if (cam)
{
/// Prepare for output operation
preTargetOperation(mOutputOperation, mViewport, cam);
}
}
示例2: collectPasses
void CompositorInstance::collectPasses(TargetOperation &finalState, CompositionTargetPass *target)
{
/// Here, passes are converted into render target operations
Pass *targetpass;
Technique *srctech;
MaterialPtr mat, srcmat;
CompositionTargetPass::PassIterator it = target->getPassIterator();
while(it.hasMoreElements())
{
CompositionPass *pass = it.getNext();
switch(pass->getType())
{
case CompositionPass::PT_CLEAR:
queueRenderSystemOp(finalState, new RSClearOperation(
pass->getClearBuffers(),
pass->getClearColour(),
pass->getClearDepth(),
pass->getClearStencil()
));
break;
case CompositionPass::PT_STENCIL:
queueRenderSystemOp(finalState, new RSStencilOperation(
pass->getStencilCheck(),pass->getStencilFunc(), pass->getStencilRefValue(),
pass->getStencilMask(), pass->getStencilFailOp(), pass->getStencilDepthFailOp(),
pass->getStencilPassOp(), pass->getStencilTwoSidedOperation()
));
break;
case CompositionPass::PT_RENDERSCENE:
if(pass->getFirstRenderQueue() < finalState.currentQueueGroupID)
{
/// Mismatch -- warn user
/// XXX We could support repeating the last queue, with some effort
LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+mCompositor->getName()+": Attempt to render queue "+
StringConverter::toString(pass->getFirstRenderQueue())+" before "+
StringConverter::toString(finalState.currentQueueGroupID));
}
/// Add render queues
for(int x=pass->getFirstRenderQueue(); x<=pass->getLastRenderQueue(); ++x)
{
assert(x>=0);
finalState.renderQueues.set(x);
}
finalState.currentQueueGroupID = pass->getLastRenderQueue()+1;
finalState.findVisibleObjects = true;
finalState.materialScheme = target->getMaterialScheme();
break;
case CompositionPass::PT_RENDERQUAD:
srcmat = pass->getMaterial();
if(srcmat.isNull())
{
/// No material -- warn user
LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+mCompositor->getName()+": No material defined for composition pass");
break;
}
srcmat->compile();
if(srcmat->getNumSupportedTechniques()==0)
{
/// No supported techniques -- warn user
LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+mCompositor->getName()+": material "+srcmat->getName()+" has no supported techniques");
break;
}
srctech = srcmat->getBestTechnique(0);
/// Create local material
MaterialPtr mat = createLocalMaterial();
/// Copy and adapt passes from source material
Technique::PassIterator i = srctech->getPassIterator();
while(i.hasMoreElements())
{
Pass *srcpass = i.getNext();
/// Create new target pass
targetpass = mat->getTechnique(0)->createPass();
(*targetpass) = (*srcpass);
/// Set up inputs
for(size_t x=0; x<pass->getNumInputs(); ++x)
{
String inp = pass->getInput(x);
if(!inp.empty())
{
if(x < targetpass->getNumTextureUnitStates())
{
targetpass->getTextureUnitState((ushort)x)->setTextureName(getSourceForTex(inp));
}
else
{
/// Texture unit not there
LogManager::getSingleton().logMessage("Warning in compilation of Compositor "
+mCompositor->getName()+": material "+srcmat->getName()+" texture unit "
+StringConverter::toString(x)+" out of bounds");
}
}
}
}
queueRenderSystemOp(finalState, new RSQuadOperation(this,pass->getIdentifier(),mat));
break;
}
//.........这里部分代码省略.........