本文整理汇总了C++中VisRenderContext_cl::SetRenderAndDepthStencilTargets方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::SetRenderAndDepthStencilTargets方法的具体用法?C++ VisRenderContext_cl::SetRenderAndDepthStencilTargets怎么用?C++ VisRenderContext_cl::SetRenderAndDepthStencilTargets使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::SetRenderAndDepthStencilTargets方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializePostProcessors
//.........这里部分代码省略.........
VPostProcessingBaseComponent* pPostProcessor = postProcessors[iPostProcessorIndex];
pPostProcessor->m_iTargetIndex = iPostProcessorIndex;
const VisRenderContext_cl* pFinalTargetContext = GetFinalTargetContext();
bool bRenderIntoFinalTargetContext = (iPostProcessorIndex >= iCopyPPIndex);
int iPosX, iPosY, iWidth, iHeight;
float zMin, zMax;
if(bRenderIntoFinalTargetContext)
{
pFinalTargetContext->GetViewport(iPosX, iPosY, iWidth, iHeight, zMin, zMax);
}
else
{
GetReferenceContext()->GetViewport(iPosX, iPosY, iWidth, iHeight, zMin, zMax);
}
VisRenderContext_cl* pContext = new VisRenderContext_cl(pFinalTargetContext->GetCamera(), 90.0f, 90.0f, iWidth, iHeight, 0.0f, 0.0f, pFinalTargetContext->GetRenderFlags());
pContext->SetRenderFilterMask(pFinalTargetContext->GetRenderFilterMask());
pContext->SetViewport(iPosX, iPosY, iWidth, iHeight, zMin, zMax);
pContext->SetViewProperties(pFinalTargetContext->GetViewProperties());
pContext->SetName(pPostProcessor->GetTypeId()->m_lpszClassName);
pContext->SetVisibilityCollector(pFinalTargetContext->GetVisibilityCollector(), false);
pContext->SetPriority(pPostProcessor->GetPriority());
pContext->SetUserData(pPostProcessor);
pContext->SetRenderLoop(new PostProcessRenderLoop_cl(pPostProcessor));
if(bRenderIntoFinalTargetContext)
{
pContext->SetRenderAndDepthStencilTargets(pFinalTargetContext);
if (bUsesOffscreenRenderTarget)
{
// If possible, try to give the post processors that render directly into the final target context a useful depth-stencil target.
// This is only possible if the final target context has MSAA disabled.
bool bCanReplaceDST = false;
if(pFinalTargetContext->RendersIntoBackBuffer())
{
#if !defined(_VISION_ANDROID) && !defined(_VISION_TIZEN) && !defined(_VISION_NACL)
// On Android, the back buffer context uses a fixed FBO, so we can't replace the DST.
bCanReplaceDST = Vision::Video.GetCurrentConfig()->m_eMultiSample == VVIDEO_MULTISAMPLE_OFF;
#endif
}
else if(pFinalTargetContext->GetRenderTarget(0) != NULL)
{
bCanReplaceDST = static_cast<VisRenderableTexture_cl*>(pFinalTargetContext->GetRenderTarget(0))->GetConfig()->m_iMultiSampling <= 1;
}
int iRefWidth, iRefHeight, iFinalWidth, iFinalHeight;
pFinalTargetContext->GetSize(iFinalWidth, iFinalHeight);
GetReferenceContext()->GetSize(iRefWidth, iRefHeight);
if(iRefWidth != iFinalWidth || iRefHeight != iFinalHeight)
{
bCanReplaceDST = false;
}
if(bCanReplaceDST)
{
pContext->SetDepthStencilTarget(static_cast<VisRenderableTexture_cl*>(GetPostProcessDepthStencilTarget(VRTV_RESOLVED)));
}