本文整理汇总了C++中VisRenderContext_cl::SetDepthStencilTarget方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::SetDepthStencilTarget方法的具体用法?C++ VisRenderContext_cl::SetDepthStencilTarget怎么用?C++ VisRenderContext_cl::SetDepthStencilTarget使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::SetDepthStencilTarget方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InitializePostProcessors
//.........这里部分代码省略.........
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)));
}
else
{
hkvLog::Warning("Could not attach a depth-stencil target to the context of the \"%s\" post processor - depth testing will not work correctly.", pPostProcessor->GetTypeId()->m_lpszClassName);
}
}
}
else
{
VRenderTargetVersion_e targetVersion = (pPostProcessor->GetPriority() <= VIS_RENDERCONTEXTPRIORITY_POSTPROCESSOR_RESOLVED) ? VRTV_MSAA : VRTV_RESOLVED;
if((pPostProcessor->GetBufferUsageFlags() & VPostProcessingBaseComponent::USES_CUSTOM_RENDERTARGET) == 0)
{
pContext->SetRenderTarget(0, static_cast<VisRenderableTexture_cl*>(GetPostProcessColorTarget(targetVersion)));
pContext->SetDepthStencilTarget(static_cast<VisRenderableTexture_cl*>(GetPostProcessDepthStencilTarget(targetVersion)));
}
}
m_assignedContexts.Add(pContext);
pPostProcessor->InitializePostProcessor();
// Validity can only be determined after initialization, so deactivate the invalid postprocessor and retry the entire context setup
if(!pPostProcessor->IsValid())
{
// the post-processor will have deactivated itself by now
pPostProcessor->SetActive(false);
bInvalidPostProcessorActive = true;
}
}
}
while ( bInvalidPostProcessorActive );
m_bPostProcessorAssignmentDirty = false;
m_iPostProcessorUpdateCounter--;
VisRenderContext_cl::ElementManagerDeleteAllUnRef();
ANALYSIS_IGNORE_WARNING_BLOCK_END;
ANALYSIS_IGNORE_WARNING_BLOCK_END;
}