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

Method UpdatePostProcessAttributes

trinity/Eve/EveSpaceScene.cpp:346–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

344}
345
346void EveSpaceScene::UpdatePostProcessAttributes()
347{
348 if( !m_display )
349 {
350 return;
351 }
352
353 // is this ok?
354 m_sceneDefaultPostProcessAttributes->FromPostProcess( m_sceneDefaultPostProcess, PostProcessEnums::SCENE_DEFAULT_PRIORITY, 1.0f );
355
356 std::vector<Tr2PostProcessAttributes*> postProcessAttributes;
357
358 for( auto& owner : m_componentRegistry->GetComponents<ITr2PostProcessOwner>() )
359 {
360 postProcessAttributes.push_back( owner->GetPostProcessAttributes() );
361 }
362
363 postProcessAttributes.push_back( m_sceneDefaultPostProcessAttributes );
364
365 if( !postProcessAttributes.empty() )
366 {
367 if( !m_combinedPostProcess )
368 {
369 m_combinedPostProcess.CreateInstance();
370 }
371
372 std::sort(
373 begin( postProcessAttributes ),
374 end( postProcessAttributes ),
375 []( Tr2PostProcessAttributes* a, Tr2PostProcessAttributes* b ) {
376 return a->priority > b->priority;
377 } );
378 if( g_enablePostProcessDebugging )
379 {
380 PriorityBlend::AttributesDebugObserver<Tr2PostProcessAttributes> observer;
381 Tr2PostProcessAttributes::MergeInto( *m_combinedPostProcess, postProcessAttributes, &observer );
382 m_postProcessDebug = observer.GetDict();
383 }
384 else
385 {
386 Tr2PostProcessAttributes::MergeInto( *m_combinedPostProcess, postProcessAttributes );
387 m_postProcessDebug = {};
388 }
389 if( m_sceneDefaultPostProcess )
390 {
391 m_combinedPostProcess->SetDynamicExposure( m_sceneDefaultPostProcess->GetDynamicExposureIfAvailable() );
392 m_combinedPostProcess->SetTaa( m_sceneDefaultPostProcess->GetTaaIfAvailable() );
393 m_combinedPostProcess->SetTonemapping( m_sceneDefaultPostProcess->GetTonemappingIfAvailable() );
394 m_combinedPostProcess->SetFog( m_sceneDefaultPostProcess->GetFogIfAvailable() );
395 m_combinedPostProcess->SetGodRays( m_sceneDefaultPostProcess->GetGodRaysIfAvailable() );
396 m_combinedPostProcess->SetGenericEffect( m_sceneDefaultPostProcess->GetGenericEffectIfAvailable() );
397 }
398 else
399 {
400 m_combinedPostProcess->SetDynamicExposure( nullptr );
401 m_combinedPostProcess->SetTaa( nullptr );
402 m_combinedPostProcess->SetTonemapping( nullptr );
403 m_combinedPostProcess->SetFog( nullptr );

Callers

nothing calls this directly

Calls 15

FromPostProcessMethod · 0.80
emptyMethod · 0.80
CreateInstanceMethod · 0.80
GetDictMethod · 0.80
SetDynamicExposureMethod · 0.80
SetTaaMethod · 0.80
GetTaaIfAvailableMethod · 0.80
SetTonemappingMethod · 0.80
SetFogMethod · 0.80

Tested by

no test coverage detected