| 432 | } |
| 433 | |
| 434 | void EveSpaceScene::Update( Be::Time realTime, Be::Time simTime ) |
| 435 | { |
| 436 | CCP_STATS_ZONE( __FUNCTION__ ); |
| 437 | |
| 438 | { |
| 439 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 440 | auto frame = renderContext.GetRecordingFrameNumber(); |
| 441 | Tr2RingBuffer::GetInstance<Float4x3>().SetFrameNumbers( frame, renderContext.GetRenderedFrameNumber() ); |
| 442 | Tr2RingBuffer::GetInstance<Tr2MorphTargetAnimationData>().SetFrameNumbers( frame, renderContext.GetRenderedFrameNumber() ); |
| 443 | |
| 444 | if( frame == m_lastUpdateFrame ) |
| 445 | { |
| 446 | // already updated this frame |
| 447 | |
| 448 | TriFrustum frustum; |
| 449 | frustum.DeriveFrustum( &Tr2Renderer::GetViewTransform(), &Tr2Renderer::GetViewPosition(), &Tr2Renderer::GetProjectionTransform(), Tr2Renderer::GetViewport() ); |
| 450 | |
| 451 | m_updateContext.SetFrustum( frustum ); |
| 452 | m_updateContext.SetHighDetailThreshold( g_eveSpaceSceneHighDetailThreshold / m_upscalingAmount ); |
| 453 | m_updateContext.SetMediumDetailThreshold( g_eveSpaceSceneMediumDetailThreshold / m_upscalingAmount ); |
| 454 | m_updateContext.SetLowDetailThreshold( g_eveSpaceSceneLowDetailThreshold / m_upscalingAmount ); |
| 455 | m_updateContext.SetVisibilityThreshold( g_eveSpaceSceneVisibilityThreshold / m_upscalingAmount ); |
| 456 | m_updateContext.SetLodFactor( g_eveSpaceSceneLODFactor / m_upscalingAmount ); |
| 457 | m_updateContext.m_raytracingEnabled = m_shadowQuality == ShadowQuality::SHADOW_RAYTRACED && m_enableShadows; |
| 458 | |
| 459 | // update the combined postprocess attributes |
| 460 | UpdatePostProcessAttributes(); |
| 461 | return; |
| 462 | } |
| 463 | m_lastUpdateFrame = frame; |
| 464 | } |
| 465 | |
| 466 | if( !m_update ) |
| 467 | { |
| 468 | return; |
| 469 | } |
| 470 | |
| 471 | m_updateContext.SetTime( simTime ); |
| 472 | m_updateContext.UpdateOrigin( m_ballpark ); |
| 473 | m_updateContext.SetDataTextureManager( m_dataTextureMgr ); |
| 474 | |
| 475 | TriFrustum frustum; |
| 476 | frustum.DeriveFrustum( &Tr2Renderer::GetViewTransform(), &Tr2Renderer::GetViewPosition(), &Tr2Renderer::GetProjectionTransform(), Tr2Renderer::GetViewport() ); |
| 477 | |
| 478 | m_updateContext.SetFrustum( frustum ); |
| 479 | m_updateContext.SetHighDetailThreshold( g_eveSpaceSceneHighDetailThreshold / m_upscalingAmount ); |
| 480 | m_updateContext.SetMediumDetailThreshold( g_eveSpaceSceneMediumDetailThreshold / m_upscalingAmount ); |
| 481 | m_updateContext.SetLowDetailThreshold( g_eveSpaceSceneLowDetailThreshold / m_upscalingAmount ); |
| 482 | m_updateContext.SetVisibilityThreshold( g_eveSpaceSceneVisibilityThreshold / m_upscalingAmount ); |
| 483 | m_updateContext.SetLodFactor( g_eveSpaceSceneLODFactor / m_upscalingAmount ); |
| 484 | m_updateContext.m_raytracingEnabled = m_shadowQuality == ShadowQuality::SHADOW_RAYTRACED && m_enableShadows; |
| 485 | |
| 486 | { |
| 487 | CCP_STATS_ZONE( "UpdateBackgroundObjects" ); |
| 488 | |
| 489 | for( auto it = m_backgroundObjects.begin(); it != m_backgroundObjects.end(); ++it ) |
| 490 | { |
| 491 | ( *it )->UpdateSyncronous( m_updateContext ); |
nothing calls this directly
no test coverage detected