-
Notifications
You must be signed in to change notification settings - Fork 5
/
OptiFlowUE4.patch
47 lines (43 loc) · 2.52 KB
/
OptiFlowUE4.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/./UE4-original/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp b/./UnrealEngine-release/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp
index 382055c..0131405 100644
--- a/./UE4-original/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp
+++ b/./UnrealEngine-release/Engine/Source/Runtime/Renderer/Private/PostProcess/PostProcessing.cpp
@@ -1050,7 +1050,8 @@ static FRenderingCompositeOutputRef AddPostProcessMaterialChain(
EBlendableLocation InLocation,
FRenderingCompositeOutputRef SeparateTranslucency = FRenderingCompositeOutputRef(),
FRenderingCompositeOutputRef PreTonemapHDRColor = FRenderingCompositeOutputRef(),
- FRenderingCompositeOutputRef PostTonemapHDRColor = FRenderingCompositeOutputRef())
+ FRenderingCompositeOutputRef PostTonemapHDRColor = FRenderingCompositeOutputRef(),
+ FRenderingCompositeOutputRef VelocityRT = FRenderingCompositeOutputRef())
{
if( !Context.View.Family->EngineShowFlags.PostProcessing ||
!Context.View.Family->EngineShowFlags.PostProcessMaterial ||
@@ -1130,8 +1131,10 @@ static FRenderingCompositeOutputRef AddPostProcessMaterialChain(
{
Node->SetInput(ePId_Input2, PreTonemapHDRColor);
Node->SetInput(ePId_Input3, PostTonemapHDRColor);
- }
-
+ } else {
+ Node->SetInput(ePId_Input2, VelocityRT);
+ }
+
LastestOutput = FRenderingCompositeOutputRef(Node);
}
@@ -1456,7 +1459,7 @@ void FPostProcessing::Process(FRHICommandListImmediate& RHICmdList, const FViewI
VelocityInput = Context.Graph.RegisterPass(new(FMemStack::Get()) FRCPassPostProcessInput(VelocityRT));
}
- Context.FinalOutput = AddPostProcessMaterialChain(Context, BL_BeforeTranslucency, SeparateTranslucency);
+ Context.FinalOutput = AddPostProcessMaterialChain(Context, BL_BeforeTranslucency, SeparateTranslucency,FRenderingCompositeOutputRef(),FRenderingCompositeOutputRef(),VelocityInput);
static const auto CVar = IConsoleManager::Get().FindTConsoleVariableDataInt(TEXT("r.DepthOfFieldQuality"));
check(CVar)
diff --git a/./UE4-original/Engine/Config/ConsoleVariables.ini b/./UnrealEngine-release/Engine/Config/ConsoleVariables.ini
index 4e9ddce..4a59278 100644
--- a/./UE4-original/Engine/Config/ConsoleVariables.ini
+++ b/./UnrealEngine-release/Engine/Config/ConsoleVariables.ini
@@ -63,3 +63,6 @@
;r.AsyncPipelineCompile=0
net.UseAdaptiveNetUpdateFrequency=0
+
+; OptiFlow patch: without this velocity buffer won't be calculated even for movable, but currently still objects or stationary objects
+r.BasePassOutputsVelocity=True