39{
40 Super::OnUpdate(CameraEffect, PC);
41
42 if (PC == nullptr || PC->PlayerCameraManager == nullptr)
43 {
44 return;
45 }
46
48 {
49 return;
50 }
51
53
54 if (CamManager == nullptr)
55 {
56 return;
57 }
58
60
61 if (PostProcessComponent == nullptr)
62 {
63 return;
64 }
65
67 {
68 return;
69 }
70
71 const UWorld* World = PC->GetWorld();
72
73 if (World == nullptr)
74 {
75 return;
76 }
77
79 FPostProcessSettings PPSettings;
80 bool bHasPPSettings = false;
81 float PPWeight = 1.0f;
82
83 for (
const TPair<ECameraBlurEffectType, FCameraBlurEffectSettings>& Pair :
BlurSettings)
84 {
85 float CurrentStrength = 0.0f;
86 float CurrentWeight = 0.0f;
87
88 if (
TryGetBlurValues(Pair.Key, ElapsedTimeRatio, CurrentStrength, CurrentWeight) ==
false)
89 {
90 continue;
91 }
92
93 if (Pair.Key == ECameraBlurEffectType::ChromaticAberration)
94 {
95 PPSettings.bOverride_SceneFringeIntensity = true;
96 PPSettings.SceneFringeIntensity = CurrentStrength * 5.0f;
97 PPWeight = CurrentWeight;
98 bHasPPSettings = true;
99 continue;
100 }
101
102 if (Pair.Key == ECameraBlurEffectType::None)
103 {
104 continue;
105 }
106
107 PostProcessComponent->ApplyBlurMaterial(Pair.Key, CurrentStrength, CurrentWeight);
108 }
109
110 if (bHasPPSettings)
111 {
112 PostProcessComponent->SetBlurPPSettings(PPSettings, PPWeight);
113 }
114}
TMap< ECameraBlurEffectType, FCameraBlurEffectSettings > BlurSettings
Definition CameraBlurEffectProcessor.h:28
bool TryGetBlurValues(const ECameraBlurEffectType EffectType, const float ElapsedTimeRatio, float &OutStrength, float &OutWeight) const
Definition CameraBlurEffectProcessor.cpp:147