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

Method FromPostProcess

trinity/PostProcess/Tr2PostProcessAttributes.cpp:362–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

360}
361
362void Tr2PostProcessAttributes::FromPostProcess( Tr2PostProcess2* postProcess, PostProcessEnums::Priority inPriority, float inIntensity )
363{
364 // important to nuke any old values
365 Reset();
366
367 intensity = inIntensity;
368 priority = inPriority;
369
370 if( !postProcess )
371 {
372 return;
373 }
374
375 if( auto signalLoss = postProcess->GetSignalLossIfAvailable() )
376 {
377 signalLossIntensity = Attribute( signalLoss->m_strength, true );
378 }
379
380 if( auto bloom = postProcess->GetBloomIfAvailable() )
381 {
382 bloomBrightness = Attribute( bloom->m_bloomBrightness, true );
383 bloomLuminanceScale = Attribute( bloom->m_luminanceScale, true );
384 bloomLuminanceThreshold = Attribute( bloom->m_luminanceThreshold, true );
385 grimeIntensity = Attribute( bloom->m_grimeWeight, true );
386 grimePath = Attribute( bloom->m_grimePath, true );
387
388 bloomSizeScale = Attribute( bloom->m_sizeScale, true );
389 bloomDirectionalWeight = Attribute( bloom->m_directionalWeight, true );
390 bloomStepSize1 = Attribute( bloom->m_stepSizes[0], true );
391 bloomStepSize2 = Attribute( bloom->m_stepSizes[1], true );
392 bloomStepSize3 = Attribute( bloom->m_stepSizes[2], true );
393 bloomStepSize4 = Attribute( bloom->m_stepSizes[3], true );
394 bloomStepSize5 = Attribute( bloom->m_stepSizes[4], true );
395 bloomStepSize6 = Attribute( bloom->m_stepSizes[5], true );
396 bloomStepTint1 = Attribute( bloom->m_stepTints[0], true );
397 bloomStepTint2 = Attribute( bloom->m_stepTints[1], true );
398 bloomStepTint3 = Attribute( bloom->m_stepTints[2], true );
399 bloomStepTint4 = Attribute( bloom->m_stepTints[3], true );
400 bloomStepTint5 = Attribute( bloom->m_stepTints[4], true );
401 bloomStepTint6 = Attribute( bloom->m_stepTints[5], true );
402 }
403 if( auto filmGrain = postProcess->GetFilmGrainIfAvailable() )
404 {
405 filmGrainIntensity = Attribute( filmGrain->m_intensity, true );
406 filmGrainSize = Attribute( filmGrain->m_grainSize, true );
407 filmGrainDensity = Attribute( filmGrain->m_grainDensity, true );
408 filmGrainContrast = Attribute( filmGrain->m_grainContrast, true );
409 filmGrainBrightnessModifier = Attribute( filmGrain->m_brightnessModifier, true );
410 filmGrainColored = Attribute( filmGrain->m_colored, true );
411 filmGrainColorAmount = Attribute( filmGrain->m_colorAmount, true );
412 }
413 if( auto desaturate = postProcess->GetDesaturateIfAvailable() )
414 {
415 // negative is desaturation, positive is saturation, so move the zero point to 0.0 from 1.0
416 saturation = Attribute( desaturate->m_intensity - 1.0f, true );
417 }
418 if( auto fade = postProcess->GetFadeIfAvailable() )
419 {

Callers 1

Calls 11

ResetFunction · 0.85
AttributeClass · 0.85
GetBloomIfAvailableMethod · 0.80
GetFadeIfAvailableMethod · 0.80
GetAvilableSortedLutsMethod · 0.80

Tested by

no test coverage detected