renyong 1 рік тому
коміт
e762213f82
52 змінених файлів з 7520 додано та 0 видалено
  1. 0 0
      Config/DefaultEditor.ini
  2. 69 0
      Config/DefaultEngine.ini
  3. 4 0
      Config/DefaultGame.ini
  4. 85 0
      Config/DefaultInput.ini
  5. BIN
      Content/Maps/Map.umap
  6. 15 0
      Cooperate.uproject
  7. BIN
      Intermediate/CachedAssetRegistry.bin
  8. 0 0
      Intermediate/Config/CoalescedSourceConfigs/Crypto.ini
  9. 0 0
      Intermediate/Config/CoalescedSourceConfigs/Dataflow.ini
  10. 2729 0
      Intermediate/Config/CoalescedSourceConfigs/Engine.ini
  11. 3 0
      Intermediate/Config/CoalescedSourceConfigs/GameUserSettings.ini
  12. 0 0
      Intermediate/Config/CoalescedSourceConfigs/InternationalizationExport.ini
  13. 0 0
      Intermediate/Config/CoalescedSourceConfigs/LocalizationServiceSettings.ini
  14. 0 0
      Intermediate/Config/CoalescedSourceConfigs/ObjectMixer.ini
  15. 0 0
      Intermediate/Config/CoalescedSourceConfigs/ObjectMixerSerializedData.ini
  16. 0 0
      Intermediate/Config/CoalescedSourceConfigs/TranslationPickerSettings.ini
  17. 0 0
      Intermediate/Config/CoalescedSourceConfigs/UnrealInsightsSettings.ini
  18. BIN
      Intermediate/ReimportCache/3688439234.bin
  19. 489 0
      Intermediate/ShaderAutogen/PCD3D_ES3_1/AutogenShaderHeaders.ush
  20. 511 0
      Intermediate/ShaderAutogen/PCD3D_SM5/AutogenShaderHeaders.ush
  21. 511 0
      Intermediate/ShaderAutogen/PCD3D_SM6/AutogenShaderHeaders.ush
  22. BIN
      Saved/AutoScreenshot.png
  23. BIN
      Saved/Autosaves/PackageRestoreData.json
  24. 5 0
      Saved/Config/CrashReportClient/UECC-Windows-AF982C714DB45882F05D3DA247E6F065/CrashReportClient.ini
  25. 1 0
      Saved/Config/WindowsEditor/Compat.ini
  26. 1 0
      Saved/Config/WindowsEditor/ControlRig.ini
  27. 1 0
      Saved/Config/WindowsEditor/DatasmithContent.ini
  28. 1 0
      Saved/Config/WindowsEditor/DeviceProfiles.ini
  29. 3 0
      Saved/Config/WindowsEditor/Editor.ini
  30. 1227 0
      Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini
  31. 1 0
      Saved/Config/WindowsEditor/EditorScriptingUtilities.ini
  32. 70 0
      Saved/Config/WindowsEditor/Engine.ini
  33. 1 0
      Saved/Config/WindowsEditor/EnhancedInput.ini
  34. 1 0
      Saved/Config/WindowsEditor/FullBodyIK.ini
  35. 1 0
      Saved/Config/WindowsEditor/GLTFExporter.ini
  36. 1 0
      Saved/Config/WindowsEditor/Game.ini
  37. 29 0
      Saved/Config/WindowsEditor/GameUserSettings.ini
  38. 1 0
      Saved/Config/WindowsEditor/Hardware.ini
  39. 1 0
      Saved/Config/WindowsEditor/Input.ini
  40. 1 0
      Saved/Config/WindowsEditor/Interchange.ini
  41. 1 0
      Saved/Config/WindowsEditor/Lightmass.ini
  42. 1 0
      Saved/Config/WindowsEditor/Metasound.ini
  43. 1 0
      Saved/Config/WindowsEditor/Niagara.ini
  44. 1 0
      Saved/Config/WindowsEditor/Paper2D.ini
  45. 1 0
      Saved/Config/WindowsEditor/RuntimeOptions.ini
  46. 1 0
      Saved/Config/WindowsEditor/Scalability.ini
  47. 1 0
      Saved/Config/WindowsEditor/Synthesis.ini
  48. 1 0
      Saved/Config/WindowsEditor/TraceDataFilters.ini
  49. 1 0
      Saved/Config/WindowsEditor/VariantManagerContent.ini
  50. BIN
      Saved/Config/WorldState/3574860746.json
  51. 1749 0
      Saved/Logs/Cooperate.log
  52. BIN
      Saved/SourceControl/UncontrolledChangelists.json

+ 0 - 0
Config/DefaultEditor.ini


+ 69 - 0
Config/DefaultEngine.ini

@@ -0,0 +1,69 @@
1
+
2
+
3
+[/Script/EngineSettings.GameMapsSettings]
4
+GameDefaultMap=/Engine/Maps/Templates/OpenWorld
5
+
6
+[/Script/WindowsTargetPlatform.WindowsTargetSettings]
7
+DefaultGraphicsRHI=DefaultGraphicsRHI_DX12
8
+-D3D12TargetedShaderFormats=PCD3D_SM5
9
++D3D12TargetedShaderFormats=PCD3D_SM6
10
+-D3D11TargetedShaderFormats=PCD3D_SM5
11
++D3D11TargetedShaderFormats=PCD3D_SM5
12
+Compiler=Default
13
+AudioSampleRate=48000
14
+AudioCallbackBufferFrameSize=1024
15
+AudioNumBuffersToEnqueue=1
16
+AudioMaxChannels=0
17
+AudioNumSourceWorkers=4
18
+SpatializationPlugin=
19
+SourceDataOverridePlugin=
20
+ReverbPlugin=
21
+OcclusionPlugin=
22
+CompressionOverrides=(bOverrideCompressionTimes=False,DurationThreshold=5.000000,MaxNumRandomBranches=0,SoundCueQualityIndex=0)
23
+CacheSizeKB=65536
24
+MaxChunkSizeOverrideKB=0
25
+bResampleForDevice=False
26
+MaxSampleRate=48000.000000
27
+HighSampleRate=32000.000000
28
+MedSampleRate=24000.000000
29
+LowSampleRate=12000.000000
30
+MinSampleRate=8000.000000
31
+CompressionQualityModifier=1.000000
32
+AutoStreamingThreshold=0.000000
33
+SoundCueCookQualityIndex=-1
34
+
35
+
36
+[/Script/HardwareTargeting.HardwareTargetingSettings]
37
+TargetedHardwareClass=Desktop
38
+AppliedTargetedHardwareClass=Desktop
39
+DefaultGraphicsPerformance=Maximum
40
+AppliedDefaultGraphicsPerformance=Maximum
41
+
42
+[/Script/Engine.RendererSettings]
43
+r.GenerateMeshDistanceFields=True
44
+r.DynamicGlobalIlluminationMethod=1
45
+r.ReflectionMethod=1
46
+r.Shadow.Virtual.Enable=1
47
+r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
48
+
49
+[/Script/WorldPartitionEditor.WorldPartitionEditorSettings]
50
+CommandletClass=Class'/Script/UnrealEd.WorldPartitionConvertCommandlet'
51
+
52
+[/Script/Engine.Engine]
53
++ActiveGameNameRedirects=(OldGameName="TP_BlankBP",NewGameName="/Script/Cooperate")
54
++ActiveGameNameRedirects=(OldGameName="/Script/TP_BlankBP",NewGameName="/Script/Cooperate")
55
+
56
+[/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings]
57
+bEnablePlugin=True
58
+bAllowNetworkConnection=True
59
+SecurityToken=18A123F8404E57ECCB47EDBC15327DC2
60
+bIncludeInShipping=False
61
+bAllowExternalStartInShipping=False
62
+bCompileAFSProject=False
63
+bUseCompression=False
64
+bLogFiles=False
65
+bReportStats=False
66
+ConnectionType=USBOnly
67
+bUseManualIPAddress=False
68
+ManualIPAddress=
69
+

+ 4 - 0
Config/DefaultGame.ini

@@ -0,0 +1,4 @@
1
+
2
+
3
+[/Script/EngineSettings.GeneralProjectSettings]
4
+ProjectID=FAB01A164EAB3880B48273A30AC2BE64

+ 85 - 0
Config/DefaultInput.ini

@@ -0,0 +1,85 @@
1
+[/Script/Engine.InputSettings]
2
+-AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
3
+-AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
4
+-AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
5
+-AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f))
6
+-AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
7
+-AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
8
+-AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f))
9
++AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
10
++AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
11
++AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
12
++AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
13
++AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
14
++AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
15
++AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
16
++AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
17
++AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
18
++AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
19
++AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
20
++AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
21
++AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
22
++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
23
++AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
24
++AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
25
++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
26
++AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
27
++AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
28
++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
29
++AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
30
++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
31
++AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
32
++AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
33
++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
34
++AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
35
++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
36
++AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
37
++AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
38
++AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
39
++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
40
++AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
41
++AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
42
++AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
43
++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
44
++AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
45
++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
46
++AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
47
++AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
48
++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
49
++AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
50
++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
51
++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
52
++AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
53
++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
54
++AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
55
++AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
56
++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
57
++AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
58
++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
59
++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
60
++AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
61
+bAltEnterTogglesFullscreen=True
62
+bF11TogglesFullscreen=True
63
+bUseMouseForTouch=False
64
+bEnableMouseSmoothing=True
65
+bEnableFOVScaling=True
66
+bCaptureMouseOnLaunch=True
67
+bEnableLegacyInputScales=True
68
+bEnableMotionControls=True
69
+bFilterInputByPlatformUser=False
70
+bShouldFlushPressedKeysOnViewportFocusLost=True
71
+bAlwaysShowTouchInterface=False
72
+bShowConsoleOnFourFingerTap=True
73
+bEnableGestureRecognizer=False
74
+bUseAutocorrect=False
75
+DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
76
+DefaultViewportMouseLockMode=LockOnCapture
77
+FOVScale=0.011110
78
+DoubleClickTime=0.200000
79
+DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput
80
+DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent
81
+DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
82
+-ConsoleKeys=Tilde
83
++ConsoleKeys=Tilde
84
++ConsoleKeys=Caret
85
+

BIN
Content/Maps/Map.umap


+ 15 - 0
Cooperate.uproject

@@ -0,0 +1,15 @@
1
+{
2
+	"FileVersion": 3,
3
+	"EngineAssociation": "5.1",
4
+	"Category": "",
5
+	"Description": "",
6
+	"Plugins": [
7
+		{
8
+			"Name": "ModelingToolsEditorMode",
9
+			"Enabled": true,
10
+			"TargetAllowList": [
11
+				"Editor"
12
+			]
13
+		}
14
+	]
15
+}

BIN
Intermediate/CachedAssetRegistry.bin


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/Crypto.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/Dataflow.ini


Різницю між файлами не показано, бо вона завелика
+ 2729 - 0
Intermediate/Config/CoalescedSourceConfigs/Engine.ini


+ 3 - 0
Intermediate/Config/CoalescedSourceConfigs/GameUserSettings.ini

@@ -0,0 +1,3 @@
1
+[Internationalization]
2
+ShouldUseLocalizedNumericInput=True
3
+

+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/InternationalizationExport.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/LocalizationServiceSettings.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/ObjectMixer.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/ObjectMixerSerializedData.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/TranslationPickerSettings.ini


+ 0 - 0
Intermediate/Config/CoalescedSourceConfigs/UnrealInsightsSettings.ini


BIN
Intermediate/ReimportCache/3688439234.bin


+ 489 - 0
Intermediate/ShaderAutogen/PCD3D_ES3_1/AutogenShaderHeaders.ush

@@ -0,0 +1,489 @@
1
+// Copyright Epic Games, Inc. All Rights Reserved.
2
+
3
+#pragma once
4
+
5
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
6
+float SampleDeviceZFromSceneTexturesTempCopy(float2 UV)
7
+{
8
+	return SceneDepthTexture.SampleLevel(SceneDepthTextureSampler, UV, 0).r;
9
+}
10
+#endif
11
+
12
+#ifndef GBUFFER_LAYOUT
13
+#define GBUFFER_LAYOUT 0
14
+#endif
15
+
16
+#if GBUFFER_LAYOUT == 0
17
+
18
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
19
+{
20
+	float4 MrtFloat1 = 0.0f;
21
+	float4 MrtFloat2 = 0.0f;
22
+	uint4 MrtUint2 = 0;
23
+	float4 MrtFloat3 = 0.0f;
24
+	float4 MrtFloat4 = 0.0f;
25
+	float4 MrtFloat5 = 0.0f;
26
+
27
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
28
+
29
+	MrtFloat1.x = WorldNormal_Compressed.x;
30
+	MrtFloat1.y = WorldNormal_Compressed.y;
31
+	MrtFloat1.z = WorldNormal_Compressed.z;
32
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
33
+	MrtFloat2.x = GBuffer.Metallic.x;
34
+	MrtFloat2.y = GBuffer.Specular.x;
35
+	MrtFloat2.z = GBuffer.Roughness.x;
36
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
37
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
38
+	MrtFloat3.x = GBuffer.BaseColor.x;
39
+	MrtFloat3.y = GBuffer.BaseColor.y;
40
+	MrtFloat3.z = GBuffer.BaseColor.z;
41
+	MrtFloat3.w = GBuffer.GenericAO.x;
42
+	MrtFloat5.x = GBuffer.PrecomputedShadowFactors.x;
43
+	MrtFloat5.y = GBuffer.PrecomputedShadowFactors.y;
44
+	MrtFloat5.z = GBuffer.PrecomputedShadowFactors.z;
45
+	MrtFloat5.w = GBuffer.PrecomputedShadowFactors.w;
46
+	MrtFloat4.x = GBuffer.CustomData.x;
47
+	MrtFloat4.y = GBuffer.CustomData.y;
48
+	MrtFloat4.z = GBuffer.CustomData.z;
49
+	MrtFloat4.w = GBuffer.CustomData.w;
50
+
51
+	Out.MRT[1] = MrtFloat1;
52
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
53
+	Out.MRT[3] = MrtFloat3;
54
+	Out.MRT[4] = MrtFloat4;
55
+	Out.MRT[5] = MrtFloat5;
56
+	Out.MRT[6] = float4(0.0f, 0.0f, 0.0f, 0.0f);
57
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
58
+}
59
+
60
+
61
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
62
+	float4 InMRT2,
63
+	float4 InMRT3,
64
+	float4 InMRT4,
65
+	float4 InMRT5,
66
+		 
67
+	float CustomNativeDepth,
68
+	float4 AnisotropicData,
69
+	uint CustomStencil,
70
+	float SceneDepth,
71
+	bool bGetNormalizedNormal,
72
+	bool bChecker)
73
+{
74
+	FGBufferData Ret = (FGBufferData)0;
75
+	float3 WorldNormal_Compressed = 0.0f;
76
+	WorldNormal_Compressed.x = InMRT1.x;
77
+	WorldNormal_Compressed.y = InMRT1.y;
78
+	WorldNormal_Compressed.z = InMRT1.z;
79
+	Ret.PerObjectGBufferData.x = InMRT1.w;
80
+	Ret.Metallic.x = InMRT2.x;
81
+	Ret.Specular.x = InMRT2.y;
82
+	Ret.Roughness.x = InMRT2.z;
83
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
84
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
85
+	Ret.BaseColor.x = InMRT3.x;
86
+	Ret.BaseColor.y = InMRT3.y;
87
+	Ret.BaseColor.z = InMRT3.z;
88
+	Ret.GenericAO.x = InMRT3.w;
89
+	Ret.PrecomputedShadowFactors.x = InMRT5.x;
90
+	Ret.PrecomputedShadowFactors.y = InMRT5.y;
91
+	Ret.PrecomputedShadowFactors.z = InMRT5.z;
92
+	Ret.PrecomputedShadowFactors.w = InMRT5.w;
93
+	Ret.CustomData.x = InMRT4.x;
94
+	Ret.CustomData.y = InMRT4.y;
95
+	Ret.CustomData.z = InMRT4.z;
96
+	Ret.CustomData.w = InMRT4.w;
97
+	
98
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
99
+	Ret.WorldTangent = AnisotropicData.xyz;
100
+	Ret.Anisotropy = AnisotropicData.w;
101
+
102
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
103
+
104
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
105
+	Ret.CustomStencil = CustomStencil;
106
+	Ret.Depth = SceneDepth;
107
+	
108
+
109
+	return Ret;
110
+}
111
+
112
+
113
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
114
+
115
+// @param PixelPos relative to left top of the rendertarget (not viewport)
116
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
117
+{
118
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
119
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
120
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
121
+	float SceneDepth = CalcSceneDepth(UV);
122
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
123
+
124
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
125
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
126
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
127
+	float4 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
128
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
129
+
130
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
131
+		InMRT2,
132
+		InMRT3,
133
+		InMRT4,
134
+		InMRT5,
135
+		 
136
+		CustomNativeDepth,
137
+		AnisotropicData,
138
+		CustomStencil,
139
+		SceneDepth,
140
+		bGetNormalizedNormal,
141
+		CheckerFromSceneColorUV(UV));
142
+
143
+	return Ret;
144
+}
145
+
146
+
147
+// @param PixelPos relative to left top of the rendertarget (not viewport)
148
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
149
+{
150
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
151
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
152
+	float SceneDepth = CalcSceneDepth(PixelPos);
153
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
154
+
155
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
156
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
157
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
158
+	float4 InMRT4 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
159
+	float4 InMRT5 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
160
+
161
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
162
+		InMRT2,
163
+		InMRT3,
164
+		InMRT4,
165
+		InMRT5,
166
+		 
167
+		CustomNativeDepth,
168
+		AnisotropicData,
169
+		CustomStencil,
170
+		SceneDepth,
171
+		bGetNormalizedNormal,
172
+		CheckerFromPixelPos(PixelPos));
173
+
174
+	return Ret;
175
+}
176
+
177
+
178
+// @param PixelPos relative to left top of the rendertarget (not viewport)
179
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
180
+{
181
+	uint CustomStencil = 0;
182
+	float CustomNativeDepth = 0;
183
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
184
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
185
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
186
+
187
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
188
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
189
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
190
+	float4 InMRT4 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
191
+	float4 InMRT5 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
192
+
193
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
194
+		InMRT2,
195
+		InMRT3,
196
+		InMRT4,
197
+		InMRT5,
198
+		 
199
+		CustomNativeDepth,
200
+		AnisotropicData,
201
+		CustomStencil,
202
+		SceneDepth,
203
+		bGetNormalizedNormal,
204
+		CheckerFromSceneColorUV(UV));
205
+
206
+	return Ret;
207
+}
208
+
209
+
210
+// @param PixelPos relative to left top of the rendertarget (not viewport)
211
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
212
+{
213
+	uint CustomStencil = 0;
214
+	float CustomNativeDepth = 0;
215
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
216
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
217
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
218
+
219
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
220
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
221
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
222
+	float4 InMRT4 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
223
+	float4 InMRT5 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
224
+
225
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
226
+		InMRT2,
227
+		InMRT3,
228
+		InMRT4,
229
+		InMRT5,
230
+		 
231
+		CustomNativeDepth,
232
+		AnisotropicData,
233
+		CustomStencil,
234
+		SceneDepth,
235
+		bGetNormalizedNormal,
236
+		CheckerFromPixelPos(PixelCoord));
237
+
238
+	return Ret;
239
+}
240
+
241
+
242
+#endif
243
+
244
+#endif
245
+
246
+#if GBUFFER_LAYOUT == 1
247
+
248
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
249
+{
250
+	float4 MrtFloat1 = 0.0f;
251
+	float4 MrtFloat2 = 0.0f;
252
+	uint4 MrtUint2 = 0;
253
+	float4 MrtFloat3 = 0.0f;
254
+	float2 MrtFloat4 = 0.0f;
255
+	float4 MrtFloat5 = 0.0f;
256
+	float4 MrtFloat6 = 0.0f;
257
+
258
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
259
+
260
+	MrtFloat1.x = WorldNormal_Compressed.x;
261
+	MrtFloat1.y = WorldNormal_Compressed.y;
262
+	MrtFloat1.z = WorldNormal_Compressed.z;
263
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
264
+	MrtFloat2.x = GBuffer.Metallic.x;
265
+	MrtFloat2.y = GBuffer.Specular.x;
266
+	MrtFloat2.z = GBuffer.Roughness.x;
267
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
268
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
269
+	MrtFloat3.x = GBuffer.BaseColor.x;
270
+	MrtFloat3.y = GBuffer.BaseColor.y;
271
+	MrtFloat3.z = GBuffer.BaseColor.z;
272
+	MrtFloat3.w = GBuffer.GenericAO.x;
273
+	MrtFloat4.x = GBuffer.Velocity.x;
274
+	MrtFloat4.y = GBuffer.Velocity.y;
275
+	MrtFloat6.x = GBuffer.PrecomputedShadowFactors.x;
276
+	MrtFloat6.y = GBuffer.PrecomputedShadowFactors.y;
277
+	MrtFloat6.z = GBuffer.PrecomputedShadowFactors.z;
278
+	MrtFloat6.w = GBuffer.PrecomputedShadowFactors.w;
279
+	MrtFloat5.x = GBuffer.CustomData.x;
280
+	MrtFloat5.y = GBuffer.CustomData.y;
281
+	MrtFloat5.z = GBuffer.CustomData.z;
282
+	MrtFloat5.w = GBuffer.CustomData.w;
283
+
284
+	Out.MRT[1] = MrtFloat1;
285
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
286
+	Out.MRT[3] = MrtFloat3;
287
+	Out.MRT[4] = float4(MrtFloat4.x, MrtFloat4.y, 0.0f, 0.0f);
288
+	Out.MRT[5] = MrtFloat5;
289
+	Out.MRT[6] = MrtFloat6;
290
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
291
+}
292
+
293
+
294
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
295
+	float4 InMRT2,
296
+	float4 InMRT3,
297
+	float2 InMRT4,
298
+	float4 InMRT5,
299
+	float4 InMRT6,
300
+		 
301
+	float CustomNativeDepth,
302
+	float4 AnisotropicData,
303
+	uint CustomStencil,
304
+	float SceneDepth,
305
+	bool bGetNormalizedNormal,
306
+	bool bChecker)
307
+{
308
+	FGBufferData Ret = (FGBufferData)0;
309
+	float3 WorldNormal_Compressed = 0.0f;
310
+	WorldNormal_Compressed.x = InMRT1.x;
311
+	WorldNormal_Compressed.y = InMRT1.y;
312
+	WorldNormal_Compressed.z = InMRT1.z;
313
+	Ret.PerObjectGBufferData.x = InMRT1.w;
314
+	Ret.Metallic.x = InMRT2.x;
315
+	Ret.Specular.x = InMRT2.y;
316
+	Ret.Roughness.x = InMRT2.z;
317
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
318
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
319
+	Ret.BaseColor.x = InMRT3.x;
320
+	Ret.BaseColor.y = InMRT3.y;
321
+	Ret.BaseColor.z = InMRT3.z;
322
+	Ret.GenericAO.x = InMRT3.w;
323
+	Ret.Velocity.x = InMRT4.x;
324
+	Ret.Velocity.y = InMRT4.y;
325
+	Ret.PrecomputedShadowFactors.x = InMRT6.x;
326
+	Ret.PrecomputedShadowFactors.y = InMRT6.y;
327
+	Ret.PrecomputedShadowFactors.z = InMRT6.z;
328
+	Ret.PrecomputedShadowFactors.w = InMRT6.w;
329
+	Ret.CustomData.x = InMRT5.x;
330
+	Ret.CustomData.y = InMRT5.y;
331
+	Ret.CustomData.z = InMRT5.z;
332
+	Ret.CustomData.w = InMRT5.w;
333
+	
334
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
335
+	Ret.WorldTangent = AnisotropicData.xyz;
336
+	Ret.Anisotropy = AnisotropicData.w;
337
+
338
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
339
+
340
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
341
+	Ret.CustomStencil = CustomStencil;
342
+	Ret.Depth = SceneDepth;
343
+	
344
+
345
+	return Ret;
346
+}
347
+
348
+
349
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
350
+
351
+// @param PixelPos relative to left top of the rendertarget (not viewport)
352
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
353
+{
354
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
355
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
356
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
357
+	float SceneDepth = CalcSceneDepth(UV);
358
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
359
+
360
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
361
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
362
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
363
+	float2 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferVelocityTexture, SceneTexturesStruct_GBufferVelocityTextureSampler, UV, 0).xy;
364
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
365
+	float4 InMRT6 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
366
+
367
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
368
+		InMRT2,
369
+		InMRT3,
370
+		InMRT4,
371
+		InMRT5,
372
+		InMRT6,
373
+		 
374
+		CustomNativeDepth,
375
+		AnisotropicData,
376
+		CustomStencil,
377
+		SceneDepth,
378
+		bGetNormalizedNormal,
379
+		CheckerFromSceneColorUV(UV));
380
+
381
+	return Ret;
382
+}
383
+
384
+
385
+// @param PixelPos relative to left top of the rendertarget (not viewport)
386
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
387
+{
388
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
389
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
390
+	float SceneDepth = CalcSceneDepth(PixelPos);
391
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
392
+
393
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
394
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
395
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
396
+	float2 InMRT4 = SceneTexturesStruct.GBufferVelocityTexture.Load(int3(PixelPos, 0)).xy;
397
+	float4 InMRT5 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
398
+	float4 InMRT6 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
399
+
400
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
401
+		InMRT2,
402
+		InMRT3,
403
+		InMRT4,
404
+		InMRT5,
405
+		InMRT6,
406
+		 
407
+		CustomNativeDepth,
408
+		AnisotropicData,
409
+		CustomStencil,
410
+		SceneDepth,
411
+		bGetNormalizedNormal,
412
+		CheckerFromPixelPos(PixelPos));
413
+
414
+	return Ret;
415
+}
416
+
417
+
418
+// @param PixelPos relative to left top of the rendertarget (not viewport)
419
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
420
+{
421
+	uint CustomStencil = 0;
422
+	float CustomNativeDepth = 0;
423
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
424
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
425
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
426
+
427
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
428
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
429
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
430
+	float2 InMRT4 = GBufferVelocityTexture.SampleLevel(GBufferVelocityTextureSampler, UV, 0).xy;
431
+	float4 InMRT5 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
432
+	float4 InMRT6 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
433
+
434
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
435
+		InMRT2,
436
+		InMRT3,
437
+		InMRT4,
438
+		InMRT5,
439
+		InMRT6,
440
+		 
441
+		CustomNativeDepth,
442
+		AnisotropicData,
443
+		CustomStencil,
444
+		SceneDepth,
445
+		bGetNormalizedNormal,
446
+		CheckerFromSceneColorUV(UV));
447
+
448
+	return Ret;
449
+}
450
+
451
+
452
+// @param PixelPos relative to left top of the rendertarget (not viewport)
453
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
454
+{
455
+	uint CustomStencil = 0;
456
+	float CustomNativeDepth = 0;
457
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
458
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
459
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
460
+
461
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
462
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
463
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
464
+	float2 InMRT4 = GBufferVelocityTexture.Load(int3(PixelCoord, 0)).xy;
465
+	float4 InMRT5 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
466
+	float4 InMRT6 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
467
+
468
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
469
+		InMRT2,
470
+		InMRT3,
471
+		InMRT4,
472
+		InMRT5,
473
+		InMRT6,
474
+		 
475
+		CustomNativeDepth,
476
+		AnisotropicData,
477
+		CustomStencil,
478
+		SceneDepth,
479
+		bGetNormalizedNormal,
480
+		CheckerFromPixelPos(PixelCoord));
481
+
482
+	return Ret;
483
+}
484
+
485
+
486
+#endif
487
+
488
+#endif
489
+

+ 511 - 0
Intermediate/ShaderAutogen/PCD3D_SM5/AutogenShaderHeaders.ush

@@ -0,0 +1,511 @@
1
+// Copyright Epic Games, Inc. All Rights Reserved.
2
+
3
+#pragma once
4
+
5
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
6
+float SampleDeviceZFromSceneTexturesTempCopy(float2 UV)
7
+{
8
+	return SceneDepthTexture.SampleLevel(SceneDepthTextureSampler, UV, 0).r;
9
+}
10
+#endif
11
+
12
+#ifndef GBUFFER_LAYOUT
13
+#define GBUFFER_LAYOUT 0
14
+#endif
15
+
16
+#if GBUFFER_LAYOUT == 0
17
+
18
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
19
+{
20
+	float4 MrtFloat1 = 0.0f;
21
+	float4 MrtFloat2 = 0.0f;
22
+	uint4 MrtUint2 = 0;
23
+	float4 MrtFloat3 = 0.0f;
24
+	float4 MrtFloat4 = 0.0f;
25
+	float4 MrtFloat5 = 0.0f;
26
+	float4 MrtFloat6 = 0.0f;
27
+
28
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
29
+
30
+	MrtFloat1.x = WorldNormal_Compressed.x;
31
+	MrtFloat1.y = WorldNormal_Compressed.y;
32
+	MrtFloat1.z = WorldNormal_Compressed.z;
33
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
34
+	MrtFloat2.x = GBuffer.Metallic.x;
35
+	MrtFloat2.y = GBuffer.Specular.x;
36
+	MrtFloat2.z = GBuffer.Roughness.x;
37
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
38
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
39
+	MrtFloat3.x = GBuffer.BaseColor.x;
40
+	MrtFloat3.y = GBuffer.BaseColor.y;
41
+	MrtFloat3.z = GBuffer.BaseColor.z;
42
+	MrtFloat3.w = GBuffer.GenericAO.x;
43
+	MrtFloat4.x = GBuffer.Velocity.x;
44
+	MrtFloat4.y = GBuffer.Velocity.y;
45
+	MrtFloat4.z = GBuffer.Velocity.z;
46
+	MrtFloat4.w = GBuffer.Velocity.w;
47
+	MrtFloat6.x = GBuffer.PrecomputedShadowFactors.x;
48
+	MrtFloat6.y = GBuffer.PrecomputedShadowFactors.y;
49
+	MrtFloat6.z = GBuffer.PrecomputedShadowFactors.z;
50
+	MrtFloat6.w = GBuffer.PrecomputedShadowFactors.w;
51
+	MrtFloat5.x = GBuffer.CustomData.x;
52
+	MrtFloat5.y = GBuffer.CustomData.y;
53
+	MrtFloat5.z = GBuffer.CustomData.z;
54
+	MrtFloat5.w = GBuffer.CustomData.w;
55
+
56
+	Out.MRT[1] = MrtFloat1;
57
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
58
+	Out.MRT[3] = MrtFloat3;
59
+	Out.MRT[4] = MrtFloat4;
60
+	Out.MRT[5] = MrtFloat5;
61
+	Out.MRT[6] = MrtFloat6;
62
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
63
+}
64
+
65
+
66
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
67
+	float4 InMRT2,
68
+	float4 InMRT3,
69
+	float4 InMRT4,
70
+	float4 InMRT5,
71
+	float4 InMRT6,
72
+		 
73
+	float CustomNativeDepth,
74
+	float4 AnisotropicData,
75
+	uint CustomStencil,
76
+	float SceneDepth,
77
+	bool bGetNormalizedNormal,
78
+	bool bChecker)
79
+{
80
+	FGBufferData Ret = (FGBufferData)0;
81
+	float3 WorldNormal_Compressed = 0.0f;
82
+	WorldNormal_Compressed.x = InMRT1.x;
83
+	WorldNormal_Compressed.y = InMRT1.y;
84
+	WorldNormal_Compressed.z = InMRT1.z;
85
+	Ret.PerObjectGBufferData.x = InMRT1.w;
86
+	Ret.Metallic.x = InMRT2.x;
87
+	Ret.Specular.x = InMRT2.y;
88
+	Ret.Roughness.x = InMRT2.z;
89
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
90
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
91
+	Ret.BaseColor.x = InMRT3.x;
92
+	Ret.BaseColor.y = InMRT3.y;
93
+	Ret.BaseColor.z = InMRT3.z;
94
+	Ret.GenericAO.x = InMRT3.w;
95
+	Ret.Velocity.x = InMRT4.x;
96
+	Ret.Velocity.y = InMRT4.y;
97
+	Ret.Velocity.z = InMRT4.z;
98
+	Ret.Velocity.w = InMRT4.w;
99
+	Ret.PrecomputedShadowFactors.x = InMRT6.x;
100
+	Ret.PrecomputedShadowFactors.y = InMRT6.y;
101
+	Ret.PrecomputedShadowFactors.z = InMRT6.z;
102
+	Ret.PrecomputedShadowFactors.w = InMRT6.w;
103
+	Ret.CustomData.x = InMRT5.x;
104
+	Ret.CustomData.y = InMRT5.y;
105
+	Ret.CustomData.z = InMRT5.z;
106
+	Ret.CustomData.w = InMRT5.w;
107
+	
108
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
109
+	Ret.WorldTangent = AnisotropicData.xyz;
110
+	Ret.Anisotropy = AnisotropicData.w;
111
+
112
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
113
+
114
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
115
+	Ret.CustomStencil = CustomStencil;
116
+	Ret.Depth = SceneDepth;
117
+	
118
+
119
+	return Ret;
120
+}
121
+
122
+
123
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
124
+
125
+// @param PixelPos relative to left top of the rendertarget (not viewport)
126
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
127
+{
128
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
129
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
130
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
131
+	float SceneDepth = CalcSceneDepth(UV);
132
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
133
+
134
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
135
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
136
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
137
+	float4 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferVelocityTexture, SceneTexturesStruct_GBufferVelocityTextureSampler, UV, 0).xyzw;
138
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
139
+	float4 InMRT6 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
140
+
141
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
142
+		InMRT2,
143
+		InMRT3,
144
+		InMRT4,
145
+		InMRT5,
146
+		InMRT6,
147
+		 
148
+		CustomNativeDepth,
149
+		AnisotropicData,
150
+		CustomStencil,
151
+		SceneDepth,
152
+		bGetNormalizedNormal,
153
+		CheckerFromSceneColorUV(UV));
154
+
155
+	return Ret;
156
+}
157
+
158
+
159
+// @param PixelPos relative to left top of the rendertarget (not viewport)
160
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
161
+{
162
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
163
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
164
+	float SceneDepth = CalcSceneDepth(PixelPos);
165
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
166
+
167
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
168
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
169
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
170
+	float4 InMRT4 = SceneTexturesStruct.GBufferVelocityTexture.Load(int3(PixelPos, 0)).xyzw;
171
+	float4 InMRT5 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
172
+	float4 InMRT6 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
173
+
174
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
175
+		InMRT2,
176
+		InMRT3,
177
+		InMRT4,
178
+		InMRT5,
179
+		InMRT6,
180
+		 
181
+		CustomNativeDepth,
182
+		AnisotropicData,
183
+		CustomStencil,
184
+		SceneDepth,
185
+		bGetNormalizedNormal,
186
+		CheckerFromPixelPos(PixelPos));
187
+
188
+	return Ret;
189
+}
190
+
191
+
192
+// @param PixelPos relative to left top of the rendertarget (not viewport)
193
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
194
+{
195
+	uint CustomStencil = 0;
196
+	float CustomNativeDepth = 0;
197
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
198
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
199
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
200
+
201
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
202
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
203
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
204
+	float4 InMRT4 = GBufferVelocityTexture.SampleLevel(GBufferVelocityTextureSampler, UV, 0).xyzw;
205
+	float4 InMRT5 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
206
+	float4 InMRT6 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
207
+
208
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
209
+		InMRT2,
210
+		InMRT3,
211
+		InMRT4,
212
+		InMRT5,
213
+		InMRT6,
214
+		 
215
+		CustomNativeDepth,
216
+		AnisotropicData,
217
+		CustomStencil,
218
+		SceneDepth,
219
+		bGetNormalizedNormal,
220
+		CheckerFromSceneColorUV(UV));
221
+
222
+	return Ret;
223
+}
224
+
225
+
226
+// @param PixelPos relative to left top of the rendertarget (not viewport)
227
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
228
+{
229
+	uint CustomStencil = 0;
230
+	float CustomNativeDepth = 0;
231
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
232
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
233
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
234
+
235
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
236
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
237
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
238
+	float4 InMRT4 = GBufferVelocityTexture.Load(int3(PixelCoord, 0)).xyzw;
239
+	float4 InMRT5 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
240
+	float4 InMRT6 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
241
+
242
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
243
+		InMRT2,
244
+		InMRT3,
245
+		InMRT4,
246
+		InMRT5,
247
+		InMRT6,
248
+		 
249
+		CustomNativeDepth,
250
+		AnisotropicData,
251
+		CustomStencil,
252
+		SceneDepth,
253
+		bGetNormalizedNormal,
254
+		CheckerFromPixelPos(PixelCoord));
255
+
256
+	return Ret;
257
+}
258
+
259
+
260
+#endif
261
+
262
+#endif
263
+
264
+#if GBUFFER_LAYOUT == 1
265
+
266
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
267
+{
268
+	float4 MrtFloat1 = 0.0f;
269
+	float4 MrtFloat2 = 0.0f;
270
+	uint4 MrtUint2 = 0;
271
+	float4 MrtFloat3 = 0.0f;
272
+	float4 MrtFloat4 = 0.0f;
273
+	float4 MrtFloat5 = 0.0f;
274
+	float4 MrtFloat6 = 0.0f;
275
+
276
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
277
+
278
+	MrtFloat1.x = WorldNormal_Compressed.x;
279
+	MrtFloat1.y = WorldNormal_Compressed.y;
280
+	MrtFloat1.z = WorldNormal_Compressed.z;
281
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
282
+	MrtFloat2.x = GBuffer.Metallic.x;
283
+	MrtFloat2.y = GBuffer.Specular.x;
284
+	MrtFloat2.z = GBuffer.Roughness.x;
285
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
286
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
287
+	MrtFloat3.x = GBuffer.BaseColor.x;
288
+	MrtFloat3.y = GBuffer.BaseColor.y;
289
+	MrtFloat3.z = GBuffer.BaseColor.z;
290
+	MrtFloat3.w = GBuffer.GenericAO.x;
291
+	MrtFloat4.x = GBuffer.Velocity.x;
292
+	MrtFloat4.y = GBuffer.Velocity.y;
293
+	MrtFloat4.z = GBuffer.Velocity.z;
294
+	MrtFloat4.w = GBuffer.Velocity.w;
295
+	MrtFloat6.x = GBuffer.PrecomputedShadowFactors.x;
296
+	MrtFloat6.y = GBuffer.PrecomputedShadowFactors.y;
297
+	MrtFloat6.z = GBuffer.PrecomputedShadowFactors.z;
298
+	MrtFloat6.w = GBuffer.PrecomputedShadowFactors.w;
299
+	MrtFloat5.x = GBuffer.CustomData.x;
300
+	MrtFloat5.y = GBuffer.CustomData.y;
301
+	MrtFloat5.z = GBuffer.CustomData.z;
302
+	MrtFloat5.w = GBuffer.CustomData.w;
303
+
304
+	Out.MRT[1] = MrtFloat1;
305
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
306
+	Out.MRT[3] = MrtFloat3;
307
+	Out.MRT[4] = MrtFloat4;
308
+	Out.MRT[5] = MrtFloat5;
309
+	Out.MRT[6] = MrtFloat6;
310
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
311
+}
312
+
313
+
314
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
315
+	float4 InMRT2,
316
+	float4 InMRT3,
317
+	float4 InMRT4,
318
+	float4 InMRT5,
319
+	float4 InMRT6,
320
+		 
321
+	float CustomNativeDepth,
322
+	float4 AnisotropicData,
323
+	uint CustomStencil,
324
+	float SceneDepth,
325
+	bool bGetNormalizedNormal,
326
+	bool bChecker)
327
+{
328
+	FGBufferData Ret = (FGBufferData)0;
329
+	float3 WorldNormal_Compressed = 0.0f;
330
+	WorldNormal_Compressed.x = InMRT1.x;
331
+	WorldNormal_Compressed.y = InMRT1.y;
332
+	WorldNormal_Compressed.z = InMRT1.z;
333
+	Ret.PerObjectGBufferData.x = InMRT1.w;
334
+	Ret.Metallic.x = InMRT2.x;
335
+	Ret.Specular.x = InMRT2.y;
336
+	Ret.Roughness.x = InMRT2.z;
337
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
338
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
339
+	Ret.BaseColor.x = InMRT3.x;
340
+	Ret.BaseColor.y = InMRT3.y;
341
+	Ret.BaseColor.z = InMRT3.z;
342
+	Ret.GenericAO.x = InMRT3.w;
343
+	Ret.Velocity.x = InMRT4.x;
344
+	Ret.Velocity.y = InMRT4.y;
345
+	Ret.Velocity.z = InMRT4.z;
346
+	Ret.Velocity.w = InMRT4.w;
347
+	Ret.PrecomputedShadowFactors.x = InMRT6.x;
348
+	Ret.PrecomputedShadowFactors.y = InMRT6.y;
349
+	Ret.PrecomputedShadowFactors.z = InMRT6.z;
350
+	Ret.PrecomputedShadowFactors.w = InMRT6.w;
351
+	Ret.CustomData.x = InMRT5.x;
352
+	Ret.CustomData.y = InMRT5.y;
353
+	Ret.CustomData.z = InMRT5.z;
354
+	Ret.CustomData.w = InMRT5.w;
355
+	
356
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
357
+	Ret.WorldTangent = AnisotropicData.xyz;
358
+	Ret.Anisotropy = AnisotropicData.w;
359
+
360
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
361
+
362
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
363
+	Ret.CustomStencil = CustomStencil;
364
+	Ret.Depth = SceneDepth;
365
+	
366
+
367
+	return Ret;
368
+}
369
+
370
+
371
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
372
+
373
+// @param PixelPos relative to left top of the rendertarget (not viewport)
374
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
375
+{
376
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
377
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
378
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
379
+	float SceneDepth = CalcSceneDepth(UV);
380
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
381
+
382
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
383
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
384
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
385
+	float4 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferVelocityTexture, SceneTexturesStruct_GBufferVelocityTextureSampler, UV, 0).xyzw;
386
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
387
+	float4 InMRT6 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
388
+
389
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
390
+		InMRT2,
391
+		InMRT3,
392
+		InMRT4,
393
+		InMRT5,
394
+		InMRT6,
395
+		 
396
+		CustomNativeDepth,
397
+		AnisotropicData,
398
+		CustomStencil,
399
+		SceneDepth,
400
+		bGetNormalizedNormal,
401
+		CheckerFromSceneColorUV(UV));
402
+
403
+	return Ret;
404
+}
405
+
406
+
407
+// @param PixelPos relative to left top of the rendertarget (not viewport)
408
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
409
+{
410
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
411
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
412
+	float SceneDepth = CalcSceneDepth(PixelPos);
413
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
414
+
415
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
416
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
417
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
418
+	float4 InMRT4 = SceneTexturesStruct.GBufferVelocityTexture.Load(int3(PixelPos, 0)).xyzw;
419
+	float4 InMRT5 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
420
+	float4 InMRT6 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
421
+
422
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
423
+		InMRT2,
424
+		InMRT3,
425
+		InMRT4,
426
+		InMRT5,
427
+		InMRT6,
428
+		 
429
+		CustomNativeDepth,
430
+		AnisotropicData,
431
+		CustomStencil,
432
+		SceneDepth,
433
+		bGetNormalizedNormal,
434
+		CheckerFromPixelPos(PixelPos));
435
+
436
+	return Ret;
437
+}
438
+
439
+
440
+// @param PixelPos relative to left top of the rendertarget (not viewport)
441
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
442
+{
443
+	uint CustomStencil = 0;
444
+	float CustomNativeDepth = 0;
445
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
446
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
447
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
448
+
449
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
450
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
451
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
452
+	float4 InMRT4 = GBufferVelocityTexture.SampleLevel(GBufferVelocityTextureSampler, UV, 0).xyzw;
453
+	float4 InMRT5 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
454
+	float4 InMRT6 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
455
+
456
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
457
+		InMRT2,
458
+		InMRT3,
459
+		InMRT4,
460
+		InMRT5,
461
+		InMRT6,
462
+		 
463
+		CustomNativeDepth,
464
+		AnisotropicData,
465
+		CustomStencil,
466
+		SceneDepth,
467
+		bGetNormalizedNormal,
468
+		CheckerFromSceneColorUV(UV));
469
+
470
+	return Ret;
471
+}
472
+
473
+
474
+// @param PixelPos relative to left top of the rendertarget (not viewport)
475
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
476
+{
477
+	uint CustomStencil = 0;
478
+	float CustomNativeDepth = 0;
479
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
480
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
481
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
482
+
483
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
484
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
485
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
486
+	float4 InMRT4 = GBufferVelocityTexture.Load(int3(PixelCoord, 0)).xyzw;
487
+	float4 InMRT5 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
488
+	float4 InMRT6 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
489
+
490
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
491
+		InMRT2,
492
+		InMRT3,
493
+		InMRT4,
494
+		InMRT5,
495
+		InMRT6,
496
+		 
497
+		CustomNativeDepth,
498
+		AnisotropicData,
499
+		CustomStencil,
500
+		SceneDepth,
501
+		bGetNormalizedNormal,
502
+		CheckerFromPixelPos(PixelCoord));
503
+
504
+	return Ret;
505
+}
506
+
507
+
508
+#endif
509
+
510
+#endif
511
+

+ 511 - 0
Intermediate/ShaderAutogen/PCD3D_SM6/AutogenShaderHeaders.ush

@@ -0,0 +1,511 @@
1
+// Copyright Epic Games, Inc. All Rights Reserved.
2
+
3
+#pragma once
4
+
5
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
6
+float SampleDeviceZFromSceneTexturesTempCopy(float2 UV)
7
+{
8
+	return SceneDepthTexture.SampleLevel(SceneDepthTextureSampler, UV, 0).r;
9
+}
10
+#endif
11
+
12
+#ifndef GBUFFER_LAYOUT
13
+#define GBUFFER_LAYOUT 0
14
+#endif
15
+
16
+#if GBUFFER_LAYOUT == 0
17
+
18
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
19
+{
20
+	float4 MrtFloat1 = 0.0f;
21
+	float4 MrtFloat2 = 0.0f;
22
+	uint4 MrtUint2 = 0;
23
+	float4 MrtFloat3 = 0.0f;
24
+	float4 MrtFloat4 = 0.0f;
25
+	float4 MrtFloat5 = 0.0f;
26
+	float4 MrtFloat6 = 0.0f;
27
+
28
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
29
+
30
+	MrtFloat1.x = WorldNormal_Compressed.x;
31
+	MrtFloat1.y = WorldNormal_Compressed.y;
32
+	MrtFloat1.z = WorldNormal_Compressed.z;
33
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
34
+	MrtFloat2.x = GBuffer.Metallic.x;
35
+	MrtFloat2.y = GBuffer.Specular.x;
36
+	MrtFloat2.z = GBuffer.Roughness.x;
37
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
38
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
39
+	MrtFloat3.x = GBuffer.BaseColor.x;
40
+	MrtFloat3.y = GBuffer.BaseColor.y;
41
+	MrtFloat3.z = GBuffer.BaseColor.z;
42
+	MrtFloat3.w = GBuffer.GenericAO.x;
43
+	MrtFloat4.x = GBuffer.Velocity.x;
44
+	MrtFloat4.y = GBuffer.Velocity.y;
45
+	MrtFloat4.z = GBuffer.Velocity.z;
46
+	MrtFloat4.w = GBuffer.Velocity.w;
47
+	MrtFloat6.x = GBuffer.PrecomputedShadowFactors.x;
48
+	MrtFloat6.y = GBuffer.PrecomputedShadowFactors.y;
49
+	MrtFloat6.z = GBuffer.PrecomputedShadowFactors.z;
50
+	MrtFloat6.w = GBuffer.PrecomputedShadowFactors.w;
51
+	MrtFloat5.x = GBuffer.CustomData.x;
52
+	MrtFloat5.y = GBuffer.CustomData.y;
53
+	MrtFloat5.z = GBuffer.CustomData.z;
54
+	MrtFloat5.w = GBuffer.CustomData.w;
55
+
56
+	Out.MRT[1] = MrtFloat1;
57
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
58
+	Out.MRT[3] = MrtFloat3;
59
+	Out.MRT[4] = MrtFloat4;
60
+	Out.MRT[5] = MrtFloat5;
61
+	Out.MRT[6] = MrtFloat6;
62
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
63
+}
64
+
65
+
66
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
67
+	float4 InMRT2,
68
+	float4 InMRT3,
69
+	float4 InMRT4,
70
+	float4 InMRT5,
71
+	float4 InMRT6,
72
+		 
73
+	float CustomNativeDepth,
74
+	float4 AnisotropicData,
75
+	uint CustomStencil,
76
+	float SceneDepth,
77
+	bool bGetNormalizedNormal,
78
+	bool bChecker)
79
+{
80
+	FGBufferData Ret = (FGBufferData)0;
81
+	float3 WorldNormal_Compressed = 0.0f;
82
+	WorldNormal_Compressed.x = InMRT1.x;
83
+	WorldNormal_Compressed.y = InMRT1.y;
84
+	WorldNormal_Compressed.z = InMRT1.z;
85
+	Ret.PerObjectGBufferData.x = InMRT1.w;
86
+	Ret.Metallic.x = InMRT2.x;
87
+	Ret.Specular.x = InMRT2.y;
88
+	Ret.Roughness.x = InMRT2.z;
89
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
90
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
91
+	Ret.BaseColor.x = InMRT3.x;
92
+	Ret.BaseColor.y = InMRT3.y;
93
+	Ret.BaseColor.z = InMRT3.z;
94
+	Ret.GenericAO.x = InMRT3.w;
95
+	Ret.Velocity.x = InMRT4.x;
96
+	Ret.Velocity.y = InMRT4.y;
97
+	Ret.Velocity.z = InMRT4.z;
98
+	Ret.Velocity.w = InMRT4.w;
99
+	Ret.PrecomputedShadowFactors.x = InMRT6.x;
100
+	Ret.PrecomputedShadowFactors.y = InMRT6.y;
101
+	Ret.PrecomputedShadowFactors.z = InMRT6.z;
102
+	Ret.PrecomputedShadowFactors.w = InMRT6.w;
103
+	Ret.CustomData.x = InMRT5.x;
104
+	Ret.CustomData.y = InMRT5.y;
105
+	Ret.CustomData.z = InMRT5.z;
106
+	Ret.CustomData.w = InMRT5.w;
107
+	
108
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
109
+	Ret.WorldTangent = AnisotropicData.xyz;
110
+	Ret.Anisotropy = AnisotropicData.w;
111
+
112
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
113
+
114
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
115
+	Ret.CustomStencil = CustomStencil;
116
+	Ret.Depth = SceneDepth;
117
+	
118
+
119
+	return Ret;
120
+}
121
+
122
+
123
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
124
+
125
+// @param PixelPos relative to left top of the rendertarget (not viewport)
126
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
127
+{
128
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
129
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
130
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
131
+	float SceneDepth = CalcSceneDepth(UV);
132
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
133
+
134
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
135
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
136
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
137
+	float4 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferVelocityTexture, SceneTexturesStruct_GBufferVelocityTextureSampler, UV, 0).xyzw;
138
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
139
+	float4 InMRT6 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
140
+
141
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
142
+		InMRT2,
143
+		InMRT3,
144
+		InMRT4,
145
+		InMRT5,
146
+		InMRT6,
147
+		 
148
+		CustomNativeDepth,
149
+		AnisotropicData,
150
+		CustomStencil,
151
+		SceneDepth,
152
+		bGetNormalizedNormal,
153
+		CheckerFromSceneColorUV(UV));
154
+
155
+	return Ret;
156
+}
157
+
158
+
159
+// @param PixelPos relative to left top of the rendertarget (not viewport)
160
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
161
+{
162
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
163
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
164
+	float SceneDepth = CalcSceneDepth(PixelPos);
165
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
166
+
167
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
168
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
169
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
170
+	float4 InMRT4 = SceneTexturesStruct.GBufferVelocityTexture.Load(int3(PixelPos, 0)).xyzw;
171
+	float4 InMRT5 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
172
+	float4 InMRT6 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
173
+
174
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
175
+		InMRT2,
176
+		InMRT3,
177
+		InMRT4,
178
+		InMRT5,
179
+		InMRT6,
180
+		 
181
+		CustomNativeDepth,
182
+		AnisotropicData,
183
+		CustomStencil,
184
+		SceneDepth,
185
+		bGetNormalizedNormal,
186
+		CheckerFromPixelPos(PixelPos));
187
+
188
+	return Ret;
189
+}
190
+
191
+
192
+// @param PixelPos relative to left top of the rendertarget (not viewport)
193
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
194
+{
195
+	uint CustomStencil = 0;
196
+	float CustomNativeDepth = 0;
197
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
198
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
199
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
200
+
201
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
202
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
203
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
204
+	float4 InMRT4 = GBufferVelocityTexture.SampleLevel(GBufferVelocityTextureSampler, UV, 0).xyzw;
205
+	float4 InMRT5 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
206
+	float4 InMRT6 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
207
+
208
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
209
+		InMRT2,
210
+		InMRT3,
211
+		InMRT4,
212
+		InMRT5,
213
+		InMRT6,
214
+		 
215
+		CustomNativeDepth,
216
+		AnisotropicData,
217
+		CustomStencil,
218
+		SceneDepth,
219
+		bGetNormalizedNormal,
220
+		CheckerFromSceneColorUV(UV));
221
+
222
+	return Ret;
223
+}
224
+
225
+
226
+// @param PixelPos relative to left top of the rendertarget (not viewport)
227
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
228
+{
229
+	uint CustomStencil = 0;
230
+	float CustomNativeDepth = 0;
231
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
232
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
233
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
234
+
235
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
236
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
237
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
238
+	float4 InMRT4 = GBufferVelocityTexture.Load(int3(PixelCoord, 0)).xyzw;
239
+	float4 InMRT5 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
240
+	float4 InMRT6 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
241
+
242
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
243
+		InMRT2,
244
+		InMRT3,
245
+		InMRT4,
246
+		InMRT5,
247
+		InMRT6,
248
+		 
249
+		CustomNativeDepth,
250
+		AnisotropicData,
251
+		CustomStencil,
252
+		SceneDepth,
253
+		bGetNormalizedNormal,
254
+		CheckerFromPixelPos(PixelCoord));
255
+
256
+	return Ret;
257
+}
258
+
259
+
260
+#endif
261
+
262
+#endif
263
+
264
+#if GBUFFER_LAYOUT == 1
265
+
266
+void EncodeGBufferToMRT(inout FPixelShaderOut Out, FGBufferData GBuffer, float QuantizationBias)
267
+{
268
+	float4 MrtFloat1 = 0.0f;
269
+	float4 MrtFloat2 = 0.0f;
270
+	uint4 MrtUint2 = 0;
271
+	float4 MrtFloat3 = 0.0f;
272
+	float4 MrtFloat4 = 0.0f;
273
+	float4 MrtFloat5 = 0.0f;
274
+	float4 MrtFloat6 = 0.0f;
275
+
276
+	float3 WorldNormal_Compressed = EncodeNormalHelper(GBuffer.WorldNormal, 0.0f);
277
+
278
+	MrtFloat1.x = WorldNormal_Compressed.x;
279
+	MrtFloat1.y = WorldNormal_Compressed.y;
280
+	MrtFloat1.z = WorldNormal_Compressed.z;
281
+	MrtFloat1.w = GBuffer.PerObjectGBufferData.x;
282
+	MrtFloat2.x = GBuffer.Metallic.x;
283
+	MrtFloat2.y = GBuffer.Specular.x;
284
+	MrtFloat2.z = GBuffer.Roughness.x;
285
+	MrtUint2.w |= ((((GBuffer.ShadingModelID.x) >> 0) & 0x0f) << 0);
286
+	MrtUint2.w |= ((((GBuffer.SelectiveOutputMask.x) >> 0) & 0x0f) << 4);
287
+	MrtFloat3.x = GBuffer.BaseColor.x;
288
+	MrtFloat3.y = GBuffer.BaseColor.y;
289
+	MrtFloat3.z = GBuffer.BaseColor.z;
290
+	MrtFloat3.w = GBuffer.GenericAO.x;
291
+	MrtFloat4.x = GBuffer.Velocity.x;
292
+	MrtFloat4.y = GBuffer.Velocity.y;
293
+	MrtFloat4.z = GBuffer.Velocity.z;
294
+	MrtFloat4.w = GBuffer.Velocity.w;
295
+	MrtFloat6.x = GBuffer.PrecomputedShadowFactors.x;
296
+	MrtFloat6.y = GBuffer.PrecomputedShadowFactors.y;
297
+	MrtFloat6.z = GBuffer.PrecomputedShadowFactors.z;
298
+	MrtFloat6.w = GBuffer.PrecomputedShadowFactors.w;
299
+	MrtFloat5.x = GBuffer.CustomData.x;
300
+	MrtFloat5.y = GBuffer.CustomData.y;
301
+	MrtFloat5.z = GBuffer.CustomData.z;
302
+	MrtFloat5.w = GBuffer.CustomData.w;
303
+
304
+	Out.MRT[1] = MrtFloat1;
305
+	Out.MRT[2] = float4(MrtFloat2.x, MrtFloat2.y, MrtFloat2.z, (float(MrtUint2.w) + .5f) / 255.0f);
306
+	Out.MRT[3] = MrtFloat3;
307
+	Out.MRT[4] = MrtFloat4;
308
+	Out.MRT[5] = MrtFloat5;
309
+	Out.MRT[6] = MrtFloat6;
310
+	Out.MRT[7] = float4(0.0f, 0.0f, 0.0f, 0.0f);
311
+}
312
+
313
+
314
+FGBufferData  DecodeGBufferDataDirect(float4 InMRT1,
315
+	float4 InMRT2,
316
+	float4 InMRT3,
317
+	float4 InMRT4,
318
+	float4 InMRT5,
319
+	float4 InMRT6,
320
+		 
321
+	float CustomNativeDepth,
322
+	float4 AnisotropicData,
323
+	uint CustomStencil,
324
+	float SceneDepth,
325
+	bool bGetNormalizedNormal,
326
+	bool bChecker)
327
+{
328
+	FGBufferData Ret = (FGBufferData)0;
329
+	float3 WorldNormal_Compressed = 0.0f;
330
+	WorldNormal_Compressed.x = InMRT1.x;
331
+	WorldNormal_Compressed.y = InMRT1.y;
332
+	WorldNormal_Compressed.z = InMRT1.z;
333
+	Ret.PerObjectGBufferData.x = InMRT1.w;
334
+	Ret.Metallic.x = InMRT2.x;
335
+	Ret.Specular.x = InMRT2.y;
336
+	Ret.Roughness.x = InMRT2.z;
337
+	Ret.ShadingModelID.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 0) & 0x0f) << 0);
338
+	Ret.SelectiveOutputMask.x = (((uint((float(InMRT2.w) * 255.0f) + .5f) >> 4) & 0x0f) << 0);
339
+	Ret.BaseColor.x = InMRT3.x;
340
+	Ret.BaseColor.y = InMRT3.y;
341
+	Ret.BaseColor.z = InMRT3.z;
342
+	Ret.GenericAO.x = InMRT3.w;
343
+	Ret.Velocity.x = InMRT4.x;
344
+	Ret.Velocity.y = InMRT4.y;
345
+	Ret.Velocity.z = InMRT4.z;
346
+	Ret.Velocity.w = InMRT4.w;
347
+	Ret.PrecomputedShadowFactors.x = InMRT6.x;
348
+	Ret.PrecomputedShadowFactors.y = InMRT6.y;
349
+	Ret.PrecomputedShadowFactors.z = InMRT6.z;
350
+	Ret.PrecomputedShadowFactors.w = InMRT6.w;
351
+	Ret.CustomData.x = InMRT5.x;
352
+	Ret.CustomData.y = InMRT5.y;
353
+	Ret.CustomData.z = InMRT5.z;
354
+	Ret.CustomData.w = InMRT5.w;
355
+	
356
+	Ret.WorldNormal = DecodeNormalHelper(WorldNormal_Compressed);
357
+	Ret.WorldTangent = AnisotropicData.xyz;
358
+	Ret.Anisotropy = AnisotropicData.w;
359
+
360
+	GBufferPostDecode(Ret,bChecker,bGetNormalizedNormal);
361
+
362
+	Ret.CustomDepth = ConvertFromDeviceZ(CustomNativeDepth);
363
+	Ret.CustomStencil = CustomStencil;
364
+	Ret.Depth = SceneDepth;
365
+	
366
+
367
+	return Ret;
368
+}
369
+
370
+
371
+#if FEATURE_LEVEL >= FEATURE_LEVEL_SM5
372
+
373
+// @param PixelPos relative to left top of the rendertarget (not viewport)
374
+FGBufferData DecodeGBufferDataUV(float2 UV, bool bGetNormalizedNormal = true)
375
+{
376
+	float CustomNativeDepth = Texture2DSampleLevel(SceneTexturesStruct.CustomDepthTexture, SceneTexturesStruct_CustomDepthTextureSampler, UV, 0).r;
377
+	int2 IntUV = (int2)trunc(UV * View.BufferSizeAndInvSize.xy * View.BufferToSceneTextureScale.xy);
378
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(IntUV, 0)) STENCIL_COMPONENT_SWIZZLE;
379
+	float SceneDepth = CalcSceneDepth(UV);
380
+	float4 AnisotropicData = Texture2DSampleLevel(SceneTexturesStruct.GBufferFTexture, SceneTexturesStruct_GBufferFTextureSampler, UV, 0).xyzw;
381
+
382
+	float4 InMRT1 = Texture2DSampleLevel(SceneTexturesStruct.GBufferATexture, SceneTexturesStruct_GBufferATextureSampler, UV, 0).xyzw;
383
+	float4 InMRT2 = Texture2DSampleLevel(SceneTexturesStruct.GBufferBTexture, SceneTexturesStruct_GBufferBTextureSampler, UV, 0).xyzw;
384
+	float4 InMRT3 = Texture2DSampleLevel(SceneTexturesStruct.GBufferCTexture, SceneTexturesStruct_GBufferCTextureSampler, UV, 0).xyzw;
385
+	float4 InMRT4 = Texture2DSampleLevel(SceneTexturesStruct.GBufferVelocityTexture, SceneTexturesStruct_GBufferVelocityTextureSampler, UV, 0).xyzw;
386
+	float4 InMRT5 = Texture2DSampleLevel(SceneTexturesStruct.GBufferDTexture, SceneTexturesStruct_GBufferDTextureSampler, UV, 0).xyzw;
387
+	float4 InMRT6 = Texture2DSampleLevel(SceneTexturesStruct.GBufferETexture, SceneTexturesStruct_GBufferETextureSampler, UV, 0).xyzw;
388
+
389
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
390
+		InMRT2,
391
+		InMRT3,
392
+		InMRT4,
393
+		InMRT5,
394
+		InMRT6,
395
+		 
396
+		CustomNativeDepth,
397
+		AnisotropicData,
398
+		CustomStencil,
399
+		SceneDepth,
400
+		bGetNormalizedNormal,
401
+		CheckerFromSceneColorUV(UV));
402
+
403
+	return Ret;
404
+}
405
+
406
+
407
+// @param PixelPos relative to left top of the rendertarget (not viewport)
408
+FGBufferData DecodeGBufferDataUint(uint2 PixelPos, bool bGetNormalizedNormal = true)
409
+{
410
+	float CustomNativeDepth = SceneTexturesStruct.CustomDepthTexture.Load(int3(PixelPos, 0)).r;
411
+	uint CustomStencil = SceneTexturesStruct.CustomStencilTexture.Load(int3(PixelPos, 0)) STENCIL_COMPONENT_SWIZZLE;
412
+	float SceneDepth = CalcSceneDepth(PixelPos);
413
+	float4 AnisotropicData = SceneTexturesStruct.GBufferFTexture.Load(int3(PixelPos, 0)).xyzw;
414
+
415
+	float4 InMRT1 = SceneTexturesStruct.GBufferATexture.Load(int3(PixelPos, 0)).xyzw;
416
+	float4 InMRT2 = SceneTexturesStruct.GBufferBTexture.Load(int3(PixelPos, 0)).xyzw;
417
+	float4 InMRT3 = SceneTexturesStruct.GBufferCTexture.Load(int3(PixelPos, 0)).xyzw;
418
+	float4 InMRT4 = SceneTexturesStruct.GBufferVelocityTexture.Load(int3(PixelPos, 0)).xyzw;
419
+	float4 InMRT5 = SceneTexturesStruct.GBufferDTexture.Load(int3(PixelPos, 0)).xyzw;
420
+	float4 InMRT6 = SceneTexturesStruct.GBufferETexture.Load(int3(PixelPos, 0)).xyzw;
421
+
422
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
423
+		InMRT2,
424
+		InMRT3,
425
+		InMRT4,
426
+		InMRT5,
427
+		InMRT6,
428
+		 
429
+		CustomNativeDepth,
430
+		AnisotropicData,
431
+		CustomStencil,
432
+		SceneDepth,
433
+		bGetNormalizedNormal,
434
+		CheckerFromPixelPos(PixelPos));
435
+
436
+	return Ret;
437
+}
438
+
439
+
440
+// @param PixelPos relative to left top of the rendertarget (not viewport)
441
+FGBufferData DecodeGBufferDataSceneTextures(float2 UV, bool bGetNormalizedNormal = true)
442
+{
443
+	uint CustomStencil = 0;
444
+	float CustomNativeDepth = 0;
445
+	float DeviceZ = SampleDeviceZFromSceneTexturesTempCopy(UV);
446
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
447
+	float4 AnisotropicData = GBufferFTexture.SampleLevel(GBufferFTextureSampler, UV, 0).xyzw;
448
+
449
+	float4 InMRT1 = GBufferATexture.SampleLevel(GBufferATextureSampler, UV, 0).xyzw;
450
+	float4 InMRT2 = GBufferBTexture.SampleLevel(GBufferBTextureSampler, UV, 0).xyzw;
451
+	float4 InMRT3 = GBufferCTexture.SampleLevel(GBufferCTextureSampler, UV, 0).xyzw;
452
+	float4 InMRT4 = GBufferVelocityTexture.SampleLevel(GBufferVelocityTextureSampler, UV, 0).xyzw;
453
+	float4 InMRT5 = GBufferDTexture.SampleLevel(GBufferDTextureSampler, UV, 0).xyzw;
454
+	float4 InMRT6 = GBufferETexture.SampleLevel(GBufferETextureSampler, UV, 0).xyzw;
455
+
456
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
457
+		InMRT2,
458
+		InMRT3,
459
+		InMRT4,
460
+		InMRT5,
461
+		InMRT6,
462
+		 
463
+		CustomNativeDepth,
464
+		AnisotropicData,
465
+		CustomStencil,
466
+		SceneDepth,
467
+		bGetNormalizedNormal,
468
+		CheckerFromSceneColorUV(UV));
469
+
470
+	return Ret;
471
+}
472
+
473
+
474
+// @param PixelPos relative to left top of the rendertarget (not viewport)
475
+FGBufferData DecodeGBufferDataSceneTexturesLoad(uint2 PixelCoord, bool bGetNormalizedNormal = true)
476
+{
477
+	uint CustomStencil = 0;
478
+	float CustomNativeDepth = 0;
479
+	float DeviceZ = SceneDepthTexture.Load(int3(PixelCoord, 0)).r;
480
+	float SceneDepth = ConvertFromDeviceZ(DeviceZ);
481
+	float4 AnisotropicData = GBufferFTexture.Load(int3(PixelCoord, 0)).xyzw;
482
+
483
+	float4 InMRT1 = GBufferATexture.Load(int3(PixelCoord, 0)).xyzw;
484
+	float4 InMRT2 = GBufferBTexture.Load(int3(PixelCoord, 0)).xyzw;
485
+	float4 InMRT3 = GBufferCTexture.Load(int3(PixelCoord, 0)).xyzw;
486
+	float4 InMRT4 = GBufferVelocityTexture.Load(int3(PixelCoord, 0)).xyzw;
487
+	float4 InMRT5 = GBufferDTexture.Load(int3(PixelCoord, 0)).xyzw;
488
+	float4 InMRT6 = GBufferETexture.Load(int3(PixelCoord, 0)).xyzw;
489
+
490
+	FGBufferData Ret = DecodeGBufferDataDirect(InMRT1,
491
+		InMRT2,
492
+		InMRT3,
493
+		InMRT4,
494
+		InMRT5,
495
+		InMRT6,
496
+		 
497
+		CustomNativeDepth,
498
+		AnisotropicData,
499
+		CustomStencil,
500
+		SceneDepth,
501
+		bGetNormalizedNormal,
502
+		CheckerFromPixelPos(PixelCoord));
503
+
504
+	return Ret;
505
+}
506
+
507
+
508
+#endif
509
+
510
+#endif
511
+

BIN
Saved/AutoScreenshot.png


BIN
Saved/Autosaves/PackageRestoreData.json


+ 5 - 0
Saved/Config/CrashReportClient/UECC-Windows-AF982C714DB45882F05D3DA247E6F065/CrashReportClient.ini

@@ -0,0 +1,5 @@
1
+[CrashReportClient]
2
+bHideLogFilesOption=false
3
+bIsAllowedToCloseWithoutSending=true
4
+CrashConfigPurgeDays=2
5
+

+ 1 - 0
Saved/Config/WindowsEditor/Compat.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/ControlRig.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/DatasmithContent.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/DeviceProfiles.ini

@@ -0,0 +1 @@
1
+

+ 3 - 0
Saved/Config/WindowsEditor/Editor.ini

@@ -0,0 +1,3 @@
1
+[/Script/UnrealEd.UnrealEdOptions]
2
+UsingXGE=False
3
+

Різницю між файлами не показано, бо вона завелика
+ 1227 - 0
Saved/Config/WindowsEditor/EditorPerProjectUserSettings.ini


+ 1 - 0
Saved/Config/WindowsEditor/EditorScriptingUtilities.ini

@@ -0,0 +1 @@
1
+

+ 70 - 0
Saved/Config/WindowsEditor/Engine.ini

@@ -0,0 +1,70 @@
1
+[Core.System]
2
+Paths=../../../Engine/Content
3
+Paths=%GAMEDIR%Content
4
+Paths=../../../Engine/Plugins/Bridge/Content
5
+Paths=../../../Engine/Plugins/2D/Paper2D/Content
6
+Paths=../../../Engine/Plugins/Animation/ControlRig/Content
7
+Paths=../../../Engine/Plugins/Animation/ControlRigSpline/Content
8
+Paths=../../../Engine/Plugins/Animation/IKRig/Content
9
+Paths=../../../Engine/Plugins/FX/Niagara/Content
10
+Paths=../../../Engine/Plugins/Developer/AnimationSharing/Content
11
+Paths=../../../Engine/Plugins/Interchange/Runtime/Content
12
+Paths=../../../Engine/Plugins/VirtualProduction/Takes/Content
13
+Paths=../../../Engine/Plugins/Enterprise/DatasmithContent/Content
14
+Paths=../../../Engine/Plugins/Enterprise/GLTFExporter/Content
15
+Paths=../../../Engine/Plugins/MovieScene/SequencerScripting/Content
16
+Paths=../../../Engine/Plugins/Media/MediaCompositing/Content
17
+Paths=../../../Engine/Plugins/Media/MediaPlate/Content
18
+Paths=../../../Engine/Plugins/Editor/BlueprintHeaderView/Content
19
+Paths=../../../Engine/Plugins/Editor/GeometryMode/Content
20
+Paths=../../../Engine/Plugins/Editor/GLTFImporter/Content
21
+Paths=../../../Engine/Plugins/Editor/ModelingToolsEditorMode/Content
22
+Paths=../../../Engine/Plugins/Editor/SpeedTreeImporter/Content
23
+Paths=../../../Engine/Plugins/Experimental/ChaosCaching/Content
24
+Paths=../../../Engine/Plugins/Experimental/ChaosSolverPlugin/Content
25
+Paths=../../../Engine/Plugins/Experimental/ChaosClothEditor/Content
26
+Paths=../../../Engine/Plugins/Experimental/ChaosNiagara/Content
27
+Paths=../../../Engine/Plugins/Experimental/Dataflow/Content
28
+Paths=../../../Engine/Plugins/Experimental/FullBodyIK/Content
29
+Paths=../../../Engine/Plugins/Experimental/GeometryFlow/Content
30
+Paths=../../../Engine/Plugins/Experimental/GeometryCollectionPlugin/Content
31
+Paths=../../../Engine/Plugins/Experimental/MeshLODToolset/Content
32
+Paths=../../../Engine/Plugins/Experimental/MeshModelingToolsetExp/Content
33
+Paths=../../../Engine/Plugins/Experimental/PythonScriptPlugin/Content
34
+Paths=../../../Engine/Plugins/Experimental/UVEditor/Content
35
+Paths=../../../Engine/Plugins/Runtime/AudioWidgets/Content
36
+Paths=../../../Engine/Plugins/Runtime/AudioSynesthesia/Content
37
+Paths=../../../Engine/Plugins/Runtime/GeometryProcessing/Content
38
+Paths=../../../Engine/Plugins/Runtime/MeshModelingToolset/Content
39
+Paths=../../../Engine/Plugins/Runtime/Metasound/Content
40
+Paths=../../../Engine/Plugins/Runtime/ResonanceAudio/Content
41
+Paths=../../../Engine/Plugins/Runtime/WaveTable/Content
42
+Paths=../../../Engine/Plugins/Runtime/Synthesis/Content
43
+Paths=../../../Engine/Plugins/Editor/ObjectMixer/ObjectMixer/Content
44
+Paths=../../../Engine/Plugins/Editor/ObjectMixer/LightMixer/Content
45
+
46
+[/Script/UdpMessaging.UdpMessagingSettings]
47
+EnabledByDefault=False
48
+EnableTransport=True
49
+bAutoRepair=True
50
+MaxSendRate=1.000000
51
+AutoRepairAttemptLimit=10
52
+WorkQueueSize=1024
53
+bStopServiceWhenAppDeactivates=True
54
+UnicastEndpoint=0.0.0.0:0
55
+MulticastEndpoint=230.0.0.1:6666
56
+MessageFormat=CborPlatformEndianness
57
+MulticastTimeToLive=1
58
+EnableTunnel=False
59
+TunnelUnicastEndpoint=
60
+TunnelMulticastEndpoint=
61
+
62
+[/Script/AndroidPlatformEditor.AndroidSDKSettings]
63
+SDKPath=(Path="")
64
+NDKPath=(Path="")
65
+JavaPath=(Path="")
66
+
67
+[/Script/UnrealEd.UnrealEdEngine]
68
+TemplateMapInfos=(ThumbnailTexture=None,Thumbnail="/Engine/Maps/Templates/Thumbnails/OpenWorld.OpenWorld",Map="/Engine/Maps/Templates/OpenWorld",DisplayName="Open World",Category="OpenWorld")
69
+TemplateMapInfos=(ThumbnailTexture=None,Thumbnail="/Engine/Maps/Templates/Thumbnails/Basic.Basic",Map="/Engine/Maps/Templates/Template_Default",DisplayName="Basic",Category="")
70
+

+ 1 - 0
Saved/Config/WindowsEditor/EnhancedInput.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/FullBodyIK.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/GLTFExporter.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Game.ini

@@ -0,0 +1 @@
1
+

+ 29 - 0
Saved/Config/WindowsEditor/GameUserSettings.ini

@@ -0,0 +1,29 @@
1
+[/Script/Engine.GameUserSettings]
2
+bUseVSync=False
3
+bUseDynamicResolution=False
4
+ResolutionSizeX=1920
5
+ResolutionSizeY=1080
6
+LastUserConfirmedResolutionSizeX=1920
7
+LastUserConfirmedResolutionSizeY=1080
8
+WindowPosX=-1
9
+WindowPosY=-1
10
+FullscreenMode=1
11
+LastConfirmedFullscreenMode=1
12
+PreferredFullscreenMode=1
13
+Version=5
14
+AudioQualityLevel=0
15
+LastConfirmedAudioQualityLevel=0
16
+FrameRateLimit=0.000000
17
+DesiredScreenWidth=1280
18
+bUseDesiredScreenHeight=False
19
+DesiredScreenHeight=720
20
+LastUserConfirmedDesiredScreenWidth=1280
21
+LastUserConfirmedDesiredScreenHeight=720
22
+LastRecommendedScreenWidth=-1.000000
23
+LastRecommendedScreenHeight=-1.000000
24
+LastCPUBenchmarkResult=-1.000000
25
+LastGPUBenchmarkResult=-1.000000
26
+LastGPUBenchmarkMultiplier=1.000000
27
+bUseHDRDisplayOutput=False
28
+HDRDisplayOutputNits=1000
29
+

+ 1 - 0
Saved/Config/WindowsEditor/Hardware.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Input.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Interchange.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Lightmass.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Metasound.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Niagara.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Paper2D.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/RuntimeOptions.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Scalability.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/Synthesis.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/TraceDataFilters.ini

@@ -0,0 +1 @@
1
+

+ 1 - 0
Saved/Config/WindowsEditor/VariantManagerContent.ini

@@ -0,0 +1 @@
1
+

BIN
Saved/Config/WorldState/3574860746.json


Різницю між файлами не показано, бо вона завелика
+ 1749 - 0
Saved/Logs/Cooperate.log


BIN
Saved/SourceControl/UncontrolledChangelists.json