本文整理汇总了C++中VisBaseEntity_cl::GetCustomProjectionMatrixForForegroundObject方法的典型用法代码示例。如果您正苦于以下问题:C++ VisBaseEntity_cl::GetCustomProjectionMatrixForForegroundObject方法的具体用法?C++ VisBaseEntity_cl::GetCustomProjectionMatrixForForegroundObject怎么用?C++ VisBaseEntity_cl::GetCustomProjectionMatrixForForegroundObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisBaseEntity_cl
的用法示例。
在下文中一共展示了VisBaseEntity_cl::GetCustomProjectionMatrixForForegroundObject方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: MaskOutForegroundEntities
void VPostProcessTranslucencies::MaskOutForegroundEntities(const VisEntityCollection_cl &EntityCollection)
{
unsigned int iNumEntities = EntityCollection.GetNumEntries(); // this collection only contains foreground objects
if (m_spForegroundMaskTechnique==NULL || iNumEntities==0)
return;
unsigned int i;
const hkvMat4* pLastProj = NULL;
INSERT_PERF_MARKER_SCOPE("VPostProcessTranslucencies::MaskOutForegroundEntities");
Vision::RenderLoopHelper.BeginEntityRendering();
for (i=0; i<iNumEntities; i++)
{
VisBaseEntity_cl *pEntity = EntityCollection.GetEntry(i);
VASSERT_MSG(pEntity->IsObjectAlwaysInForegroundEnabled(), "Only entities with this flag should be passed to this function");
if (!pEntity->HasShadersForPass(VPT_PrimaryOpaquePass))
continue;
const hkvMat4* pThisProj = pEntity->GetCustomProjectionMatrixForForegroundObject();
if (pThisProj!=pLastProj)
{
VisRenderStates_cl::SetCurrentProjectionMatrix(pThisProj);
pLastProj = pThisProj;
}
// depth fill pass
Vision::RenderLoopHelper.RenderEntityWithShaders(pEntity, m_spForegroundMaskTechnique->GetShaderCount(), m_spForegroundMaskTechnique->GetShaderList());
}
Vision::RenderLoopHelper.EndEntityRendering();
// reset to context projection matrix
if (pLastProj)
{
VisRenderStates_cl::SetCurrentProjectionMatrix(NULL);
}
}
示例2: DrawTransparentForegroundEntities
// Renders foreground entities (i.e. entities which have been flagged as "always in foreground")
void VPostProcessTranslucencies::DrawTransparentForegroundEntities(const VisEntityCollection_cl &EntityCollection)
{
unsigned int iNumEntities = EntityCollection.GetNumEntries(); // this collection only contains foreground objects
if (iNumEntities==0 || m_spForegroundFillPassTechnique==NULL)
return;
INSERT_PERF_MARKER_SCOPE("VisionRenderLoop_cl::DrawForegroundEntities");
unsigned int i;
const hkvMat4* pLastProj = NULL;
Vision::RenderLoopHelper.BeginEntityRendering();
const int iPassCount = m_spForegroundFillPassTechnique->GetShaderCount();
for (int iPass=0;iPass<=iPassCount;iPass++) // +1 passes, where the last one is the actual material pass
{
for (i=0; i<iNumEntities; i++)
{
VisBaseEntity_cl *pEntity = EntityCollection.GetEntry(i);
// Render only Entities that are flagged as "always in foreground"
VASSERT_MSG(pEntity->IsObjectAlwaysInForegroundEnabled(), "Only entities with this flag should be passed to this function");
if (pEntity->HasShadersForPass(VPT_TransparentPass))
{
VDynamicMesh *pMesh = pEntity->GetMesh();
VisShaderSet_cl *pShaderSet = pEntity->GetActiveShaderSet();
VASSERT(pMesh && pShaderSet);
const hkvMat4* pThisProj = pEntity->GetCustomProjectionMatrixForForegroundObject();
if (pThisProj != pLastProj)
{
VisRenderStates_cl::SetCurrentProjectionMatrix(pThisProj);
pLastProj = pThisProj;
}
if (iPass<iPassCount) // depth fill pass
{
VCompiledShaderPass *pPass = m_spForegroundFillPassTechnique->GetShader(iPass);
Vision::RenderLoopHelper.RenderEntityWithShaders(pEntity, 1, &pPass);
}
else // material pass
{
const VisDrawCallInfo_t *pAssignment;
int iNumSurfaceShaders = pShaderSet->GetShaderAssignmentList(&pAssignment);
// If the shaders make use of the lighting information, we need to track the light grid
if (pMesh != NULL && pMesh->HasLitSurfaces() &&
(pShaderSet->GetCombinedTrackingMask() & (VSHADER_TRACKING_LIGHTGRID_PS|VSHADER_TRACKING_LIGHTGRID_GS|VSHADER_TRACKING_LIGHTGRID_VS)) )
{
Vision::RenderLoopHelper.TrackLightGridInfo(pEntity);
}
// Render the entity with the surface shader list
Vision::RenderLoopHelper.RenderEntityWithSurfaceShaderList(pEntity, iNumSurfaceShaders, pAssignment);
}
}
}
}
Vision::RenderLoopHelper.EndEntityRendering();
// reset to context projection matrix
if (pLastProj)
{
VisRenderStates_cl::SetCurrentProjectionMatrix(NULL);
}
}