// Level init, shutdown void CPixelVisibilitySystem::LevelInitPreEntity() { bool fastqueries = HasFastQueries(); // printf("\n ** fast queries: %s **", fastqueries?"true":"false" ); m_hwCanTestGlows = r_dopixelvisibility.GetBool() && fastqueries && engine->GetDXSupportLevel() >= 80; if ( m_hwCanTestGlows ) { CMatRenderContextPtr pRenderContext( materials ); OcclusionQueryObjectHandle_t query = pRenderContext->CreateOcclusionQueryObject(); if ( query != INVALID_OCCLUSION_QUERY_OBJECT_HANDLE ) { pRenderContext->DestroyOcclusionQueryObject( query ); } else { m_hwCanTestGlows = false; } } m_pProxyMaterial = materials->FindMaterial("engine/occlusionproxy", TEXTURE_GROUP_CLIENT_EFFECTS); m_pProxyMaterial->IncrementReferenceCount(); m_pDrawMaterial = materials->FindMaterial("engine/occlusionproxy_countdraw", TEXTURE_GROUP_CLIENT_EFFECTS); m_pDrawMaterial->IncrementReferenceCount(); m_freeQueriesList = m_queryList.CreateList(); m_activeSetsList = m_setList.CreateList(); m_freeSetsList = m_setList.CreateList(); }
unsigned short CPixelVisibilitySystem::AllocSet() { unsigned short node = m_setList.Head(m_freeSetsList); if ( node != m_setList.InvalidIndex() ) { m_setList.Unlink( m_freeSetsList, node ); } else { node = m_setList.Alloc(); m_setList[node].queryList = m_queryList.CreateList(); } m_setList.LinkToHead( m_activeSetsList, node ); return node; }
// Level init, shutdown void CPixelVisibilitySystem::LevelInitPreEntity() { m_hwCanTestGlows = r_dopixelvisibility.GetBool() && engine->GetDXSupportLevel() >= 80; if ( m_hwCanTestGlows ) { unsigned short query = materials->CreateOcclusionQueryObject(); if ( query != INVALID_OCCLUSION_QUERY_OBJECT_HANDLE ) { materials->DestroyOcclusionQueryObject( query ); } else { m_hwCanTestGlows = false; } } m_pProxyMaterial = materials->FindMaterial("engine/occlusionproxy", TEXTURE_GROUP_CLIENT_EFFECTS); m_pProxyMaterial->IncrementReferenceCount(); m_pDrawMaterial = materials->FindMaterial("engine/occlusionproxy_countdraw", TEXTURE_GROUP_CLIENT_EFFECTS); m_pDrawMaterial->IncrementReferenceCount(); m_freeQueriesList = m_queryList.CreateList(); m_activeSetsList = m_setList.CreateList(); m_freeSetsList = m_setList.CreateList(); }