MCPcopy Create free account
hub / github.com/carbonengine/trinity / UpdateImpostors

Method UpdateImpostors

trinity/Eve/EveSpaceScene.cpp:1567–1674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1565}
1566
1567void EveSpaceScene::UpdateImpostors( Tr2RenderContext& renderContext )
1568{
1569 if( !m_impostorManager || m_impostorManager->GetRenderQueueLength() == 0 )
1570 {
1571 return;
1572 }
1573
1574 CCP_STATS_ZONE( __FUNCTION__ );
1575 GPU_REGION( renderContext, "Impostors Update" );
1576
1577 CTriViewport fakeViewport;
1578 fakeViewport.width = 128;
1579 fakeViewport.height = 128;
1580
1581 Tr2Renderer::PushViewTransform();
1582 Tr2Renderer::PushProjection();
1583 renderContext.m_esm.PushViewport();
1584
1585 ON_BLOCK_EXIT( [&] {
1586 renderContext.m_esm.PopViewport();
1587 Tr2Renderer::PopProjection();
1588 Tr2Renderer::PopViewTransform();
1589 } );
1590
1591 m_impostorManager->BeginUpdateAtlas( renderContext );
1592 ON_BLOCK_EXIT( [&] { m_impostorManager->EndUpdateAtlas( renderContext ); } );
1593
1594 ITr2TextureProvider* bkDepthMapTexVar = nullptr;
1595
1596 if( m_depthMapVar.GetType() == TRIVARIABLE_TEXTURE_RES )
1597 {
1598 m_depthMapVar.GetValue( bkDepthMapTexVar );
1599 if( bkDepthMapTexVar )
1600 {
1601 bkDepthMapTexVar->Lock();
1602 }
1603
1604 m_depthMapVar = m_impostorManager->GetItemDepthStencil();
1605 }
1606 ON_BLOCK_EXIT( [&] {
1607 if( m_depthMapVar.GetType() == TRIVARIABLE_TEXTURE_RES )
1608 {
1609 m_depthMapVar = bkDepthMapTexVar;
1610 if( bkDepthMapTexVar )
1611 {
1612 bkDepthMapTexVar->Unlock();
1613 }
1614 }
1615 UpdateVariableStore();
1616 } );
1617
1618 UpdateVariableStore();
1619
1620 Vector3 eye = Tr2Renderer::GetInverseViewTransform().GetTranslation();
1621 Vector3 up = TransformNormal( Vector3( 0, 1, 0 ), Tr2Renderer::GetInverseViewTransform() );
1622
1623 for( size_t i = 0; i < m_impostorManager->GetRenderQueueLength(); ++i )
1624 {

Callers

nothing calls this directly

Calls 15

SetViewTransformFunction · 0.85
GetViewTransformFunction · 0.85
GetViewPositionFunction · 0.85
GetProjectionTransformFunction · 0.85
PopulatePerFramePSDataFunction · 0.85
PopulatePerFrameVSDataFunction · 0.85
GetRenderQueueLengthMethod · 0.80
PushViewportMethod · 0.80
PopViewportMethod · 0.80
BeginUpdateAtlasMethod · 0.80
EndUpdateAtlasMethod · 0.80
GetItemDepthStencilMethod · 0.80

Tested by

no test coverage detected