本文整理汇总了C++中VisRenderContext_cl::IsPixelCounterQueryInProgress方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::IsPixelCounterQueryInProgress方法的具体用法?C++ VisRenderContext_cl::IsPixelCounterQueryInProgress怎么用?C++ VisRenderContext_cl::IsPixelCounterQueryInProgress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::IsPixelCounterQueryInProgress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateCoronas
//.........这里部分代码省略.........
// The component is not in m_Candidates yet, so we check whether it is a valid candidate
bool bIsLightOnScreen = pComponent->IsValidCandidate(pContext);
if (bIsLightOnScreen)
{
state.SetBit(pComponent->m_iIndex);
pContext->SetPixelCounterResult(pComponent->m_CoronaPixelCounter.GetNumber(), 0);
state.m_Candidates.Append(pComponent);
}
}
}
}
}
// Forces the retrieval all pending queries.
pContext->FetchPixelCounterTestResults( (iCoronaUpdateFlags & VCUF_FORCE_FETCH) > 0 );
// Retrieve Queries and update status of lens flares
if ((iCoronaUpdateFlags & VCUF_UPDATE) > 0)
{
for (int i=0; i < state.m_Candidates.GetSize(); ++i)
{
VCoronaCandidate& coronaCandidate = state.m_Candidates.ElementAt(i);
VCoronaComponent* pCorona = coronaCandidate.m_pCorona;
if (!pCorona || !pCorona->IsEnabled())
continue;
if (pCorona->GetOwner())
{
// Retrieve occlusion results of the last query
unsigned int iElementIndex = pCorona->m_CoronaPixelCounter.GetNumber();
bool bRes = !pContext->IsPixelCounterQueryInProgress(iElementIndex);
// Reschedule query if the old on could be retrieved or if a teleport forces us to re-query everything.
if (bRes | ((iCoronaUpdateFlags & VCUF_FORCE_SCHEDULE) > 0) )
pContext->SchedulePixelCounterTest(iElementIndex);
unsigned int iDrawnPixels = pContext->GetPixelCounterResult(iElementIndex) / iTexelsPerPixel;
float fVisibility = (float)iDrawnPixels / ((int)pCorona->QueryRadius * (int)pCorona->QueryRadius * 4);
// ATI fix for random insanely high return values.
if (iDrawnPixels > ((unsigned int)pCorona->QueryRadius * 2 + 1) * ((unsigned int)pCorona->QueryRadius * 2 + 1))
{
fVisibility = coronaCandidate.m_fLastVisibilityQuery;
}
if ((iCoronaUpdateFlags & VCUF_FORCE_FETCH) > 0)
{
// Force lens flare visibility to the current query value.
coronaCandidate.m_fCurrentVisibility = fVisibility;
coronaCandidate.m_fLastVisibilityQuery = fVisibility;
pCorona->UpdateVisibility(coronaCandidate.m_fLastVisibilityQuery, coronaCandidate.m_fCurrentVisibility);
}
else if (!m_bTeleportedLastFrame)
{
coronaCandidate.m_fLastVisibilityQuery = fVisibility;
pCorona->UpdateVisibility(coronaCandidate.m_fLastVisibilityQuery, coronaCandidate.m_fCurrentVisibility);
}
else
{
// if we were teleported, the last frame's query results must be invalidated
coronaCandidate.m_fCurrentVisibility = 0.0f;
coronaCandidate.m_fLastVisibilityQuery = 0.0f;