本文整理汇总了C++中VisRenderContext_cl::GetLODReferenceContext方法的典型用法代码示例。如果您正苦于以下问题:C++ VisRenderContext_cl::GetLODReferenceContext方法的具体用法?C++ VisRenderContext_cl::GetLODReferenceContext怎么用?C++ VisRenderContext_cl::GetLODReferenceContext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisRenderContext_cl
的用法示例。
在下文中一共展示了VisRenderContext_cl::GetLODReferenceContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RenderProjectedWallmarks
// renders visible wallmarks of specified pass type (pre or post, which is relevant in deferred context)
void VWallmarkManager::RenderProjectedWallmarks(VPassType_e ePassType)
{
INSERT_PERF_MARKER_SCOPE("Wallmark Rendering (VWallmarkManager::RenderProjectedWallmarks)");
const int iWallmarkCount = m_AllProjectedWallmarks.Count();
IVisVisibilityCollector_cl *pVisCollector = Vision::Contexts.GetCurrentContext()->GetVisibilityCollector();
if (!pVisCollector || !iWallmarkCount)
return;
const VisStaticGeometryInstanceCollection_cl *pGeoInstances = pVisCollector->GetVisibleStaticGeometryInstances();
VisStaticGeometryInstance_cl::ResetTags();
pGeoInstances->TagEntries();
VisStaticGeometryInstanceCollection_cl &targetGiCollection = m_TempGeoInstanceCollection;
VisRenderContext_cl *pContext = Vision::Contexts.GetCurrentContext();
VisRenderContext_cl *pLODContext = pContext->GetLODReferenceContext();
hkvVec3 vLODPos = pLODContext ? pLODContext->GetCamera()->GetPosition() : pContext->GetCamera()->GetPosition();
unsigned int iContextFilter = pContext->GetRenderFilterMask();
const VisFrustum_cl *pFrustum = pVisCollector->GetBaseFrustum();
int i;
for (i=0;i<iWallmarkCount;i++)
{
VProjectedWallmark *pProjWallmark = m_AllProjectedWallmarks.GetAt(i);
if ((pProjWallmark->GetVisibleBitmask() & iContextFilter)==0 || (ePassType & pProjWallmark->m_ePassType) == 0)
continue;
pProjWallmark->PrepareForRendering();
const VisStaticGeometryInstanceCollection_cl &wmGiList = pProjWallmark->GetStaticGeometryCollection();
#ifdef HK_DEBUG
const int iNum = wmGiList.GetNumEntries();
for (int j=0;j<iNum;j++)
{
VisStaticGeometryInstance_cl *pInst = wmGiList.GetEntry(j);
VASSERT_MSG(pInst && (pInst->GetGeometryType()==STATIC_GEOMETRY_TYPE_MESHINSTANCE || pInst->GetGeometryType()==STATIC_GEOMETRY_TYPE_TERRAIN), "The wallmark conains invalid primitive references")
}
#endif
// clip against its bounding box (primitive visibility might overestimate visible parts)
const hkvAlignedBBox &bbox = pProjWallmark->GetBoundingBox();
if (pProjWallmark->m_fFarClipDistance>0.f && pProjWallmark->m_fFarClipDistance<bbox.getDistanceTo(vLODPos))
continue;
if (pFrustum && !pFrustum->Overlaps(bbox))
continue;
const int iGeomFilter = pProjWallmark->GetGeometryTypeFilterMask();
if (iGeomFilter&PROJECTOR_AFFECTS_STATICMESHES)
{
// standard geometry
targetGiCollection.Clear();
wmGiList.GetTaggedEntriesOfType(targetGiCollection,STATIC_GEOMETRY_TYPE_MESHINSTANCE);
if (targetGiCollection.GetNumEntries())
{
// render the static geometry instances using lightmapped or non-lightmapped shader
VProjectorShaderPass *pShader = GetWallmarkShader(pProjWallmark,STATIC_GEOMETRY_TYPE_MESHINSTANCE);
Vision::RenderLoopHelper.RenderStaticGeometryWithShader(targetGiCollection, *pShader);
}
}
if (iGeomFilter&PROJECTOR_AFFECTS_TERRAIN)
{
// terrain geometry (different shader)
targetGiCollection.Clear();
wmGiList.GetTaggedEntriesOfType(targetGiCollection,STATIC_GEOMETRY_TYPE_TERRAIN);
if (targetGiCollection.GetNumEntries()>0)
{
// render the static geometry instances using lightmapped or non-lightmapped shader
VProjectorShaderPass *pShader = GetWallmarkShader(pProjWallmark,STATIC_GEOMETRY_TYPE_TERRAIN);
if (pShader)
Vision::RenderLoopHelper.RenderStaticGeometryWithShader(targetGiCollection, *pShader);
}
}
// entities
if (iGeomFilter&PROJECTOR_AFFECTS_ENTITIES)
{
const VisEntityCollection_cl *pVisibleEntities = pVisCollector->GetVisibleEntities();
const unsigned int iInfluenceMask = pProjWallmark->GetInfluenceBitmask();
m_TempEntityCollection.Clear();
const int iEntCount = pVisibleEntities->GetNumEntries();
for (int j=0;j<iEntCount;j++)
{
VisBaseEntity_cl *pEntity = pVisibleEntities->GetEntry(j);
if (pEntity==NULL || (pEntity->GetVisibleBitmask()&iInfluenceMask)==0)
continue;
const hkvAlignedBBox &entityBox(*pEntity->GetCurrentVisBoundingBoxPtr());
if (!entityBox.overlaps(bbox))
continue;
m_TempEntityCollection.AppendEntry(pEntity);
}
if (m_TempEntityCollection.GetNumEntries()>0)
{
VProjectorShaderPass *pShader = GetWallmarkShader(pProjWallmark,STATIC_GEOMETRY_TYPE_MESHINSTANCE); // we can use this shader - VS skinning is used implicitly
Vision::RenderLoopHelper.RenderEntitiesWithShader(m_TempEntityCollection, *pShader);
}
}
//.........这里部分代码省略.........