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

Method Render3DUI

trinity/Eve/EveSpaceScene.cpp:2882–2934  ·  view source on GitHub ↗

--------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2880
2881// --------------------------------------------------------------------------------------
2882void EveSpaceScene::Render3DUI( Tr2RenderContext& renderContext )
2883{
2884 renderContext.AddGpuMarker( __FUNCTION__ );
2885
2886 Matrix identity = IdentityMatrix();
2887 std::vector<ITr2Renderable*> renderables;
2888 Tr2RenderableSortList transparentObjects;
2889
2890 TriFrustum frustum;
2891 frustum.DeriveFrustum( &Tr2Renderer::GetViewTransform(), &Tr2Renderer::GetViewPosition(), &Tr2Renderer::GetProjectionTransform(), renderContext.m_esm.GetViewport() );
2892
2893 renderContext.m_esm.BeginManagedRendering();
2894 renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_OPAQUE );
2895
2896 PopulatePerFramePSData( m_perFramePS, renderContext );
2897 PopulatePerFrameVSData( m_perFrameVS, renderContext );
2898
2899 Tr2ParallelDo( m_uiObjects.begin(), m_uiObjects.end(), [&]( IEveSpaceObject2* obj ) { obj->UpdateVisibility( m_updateContext, identity ); } );
2900
2901 for( auto it = m_uiObjects.begin(); it != m_uiObjects.end(); ++it )
2902 {
2903 IEveSpaceObject2* obj = *it;
2904 obj->GetRenderables( renderables, nullptr );
2905 }
2906
2907 GetAllBatchesFromRenderables( renderables, transparentObjects, false, m_secondaryBatches );
2908 PrepareTransparentBatch( transparentObjects, m_secondaryBatches );
2909
2910 UpdateQuadRenderer( frustum, m_uiObjects, renderContext );
2911 Tr2QuadRenderer::Instance()->GetBatches( TRIBATCHTYPE_OPAQUE, m_secondaryBatches[TRIBATCHTYPE_OPAQUE] );
2912 Tr2QuadRenderer::Instance()->GetBatches( TRIBATCHTYPE_ADDITIVE, m_secondaryBatches[TRIBATCHTYPE_ADDITIVE] );
2913
2914 FinalizeBatches( m_secondaryBatches );
2915 UpdateVariableStore();
2916
2917 ApplyPerFrameData( renderContext );
2918
2919 // --------------------------------------------------------------------------------------
2920 RenderOpaqueBatches( m_secondaryBatches, renderContext );
2921
2922 renderContext.SetReadOnlyDepth( true );
2923 RenderTransparentBatches( m_secondaryBatches, renderContext );
2924 renderContext.SetReadOnlyDepth( false );
2925
2926 Tr2QuadRenderer::Instance()->DoneRendering( renderContext );
2927
2928 RenderDebugInfo( renderContext );
2929
2930 renderContext.m_esm.EndManagedRendering();
2931 renderContext.m_esm.ApplyStandardStates( Tr2EffectStateManager::RM_OPAQUE );
2932
2933 ClearBatches( m_secondaryBatches );
2934}
2935
2936void EveSpaceScene::PopulateAndApplyPerFrameData( Tr2RenderContext& renderContext )
2937{

Callers 1

ExecuteMethod · 0.80

Calls 15

GetViewTransformFunction · 0.85
GetViewPositionFunction · 0.85
GetProjectionTransformFunction · 0.85
PopulatePerFramePSDataFunction · 0.85
PopulatePerFrameVSDataFunction · 0.85
BeginManagedRenderingMethod · 0.80
ApplyStandardStatesMethod · 0.80
DoneRenderingMethod · 0.80
EndManagedRenderingMethod · 0.80
RenderDebugInfoFunction · 0.50
AddGpuMarkerMethod · 0.45
DeriveFrustumMethod · 0.45

Tested by

no test coverage detected