BRE12
EnvironmentLightPass.h
1 #pragma once
2 
3 #include <memory>
4 #include <wrl.h>
5 
6 #include <EnvironmentLightPass\AmbientOcclusionCmdListRecorder.h>
7 #include <EnvironmentLightPass\BlurCmdListRecorder.h>
8 #include <EnvironmentLightPass\EnvironmentLightCmdListRecorder.h>
9 #include <CommandManager\CommandListPerFrame.h>
10 
11 struct D3D12_CPU_DESCRIPTOR_HANDLE;
12 struct ID3D12Resource;
13 
14 namespace BRE {
15 // Pass responsible to apply ambient lighting and ambient occlusion
17 public:
18  EnvironmentLightPass() = default;
19  ~EnvironmentLightPass() = default;
21  const EnvironmentLightPass& operator=(const EnvironmentLightPass&) = delete;
23  EnvironmentLightPass& operator=(EnvironmentLightPass&&) = delete;
24 
25  void Init(ID3D12Resource& baseColorMetalMaskBuffer,
26  ID3D12Resource& normalSmoothnessBuffer,
27  ID3D12Resource& depthBuffer,
28  ID3D12Resource& diffuseIrradianceCubeMap,
29  ID3D12Resource& specularPreConvolvedCubeMap,
30  const D3D12_CPU_DESCRIPTOR_HANDLE& renderTargetView) noexcept;
31 
32  // Preconditions:
33  // - Init() must be called first
34  void Execute(const FrameCBuffer& frameCBuffer) noexcept;
35 
36 private:
37  bool ValidateData() const noexcept;
38 
39  void ExecuteBeginTask() noexcept;
40  void ExecuteMiddleTask() noexcept;
41  void ExecuteFinalTask() noexcept;
42 
43  CommandListPerFrame mBeginCommandListPerFrame;
44  CommandListPerFrame mMiddleCommandListPerFrame;
45  CommandListPerFrame mFinalCommandListPerFrame;
46 
47  Microsoft::WRL::ComPtr<ID3D12Resource> mAmbientAccessibilityBuffer;
48  D3D12_CPU_DESCRIPTOR_HANDLE mAmbientAccessibilityBufferRenderTargetView{ 0UL };
49 
50  Microsoft::WRL::ComPtr<ID3D12Resource> mBlurBuffer;
51 
52  std::unique_ptr<AmbientOcclusionCmdListRecorder> mAmbientOcclusionRecorder;
53  std::unique_ptr<BlurCmdListRecorder> mBlurRecorder;
54  std::unique_ptr<EnvironmentLightCmdListRecorder> mEnvironmentLightRecorder;
55 };
56 
57 }
58 
Definition: Camera.cpp:8
Definition: CBuffers.h:23
Definition: CommandListPerFrame.h:16
Definition: EnvironmentLightPass.h:16