-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSSPR.h
47 lines (35 loc) · 1.14 KB
/
SSPR.h
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
#ifndef SSPR_H
#define SSPR_H
#include <D3DApp.h>
class SSPR
{
public:
UINT mWidth;
UINT mHeight;
D3D11_VIEWPORT mReflectionsMapViewport;
//ID3D11RenderTargetView* mReflectionsMapRTV;
ID3D11UnorderedAccessView* mReflectionsMapUAV;
ID3D11ShaderResourceView* mReflectionsMapSRV;
//ID3D11ComputeShader* mComputeShader;
ID3D11PixelShader* mPixelShader;
ID3D11SamplerState* mSamplerState; // normal-depth map
struct ConstantBuffer
{
XMFLOAT4 FrustumFarCorner[4];
XMFLOAT4X4 proj;
XMFLOAT4X4 view;
XMFLOAT4X4 ViewInverse;
XMFLOAT4X4 reflect;
};
static_assert((sizeof(ConstantBuffer) % 16) == 0, "constant buffer size must be 16-byte aligned");
XMFLOAT4 mFrustumFarCorner[4];
ID3D11Buffer* mConstantBuffer;
GameObject mReflectionsMapQuad;
DebugQuad mDebugQuad;
SSPR();
~SSPR();
void Init(ID3D11Device* device, UINT width, UINT height, float FieldOfViewY, float NearZ, float FarZ);
void OnResize(ID3D11Device* device, UINT width, UINT height, float FieldOfViewY, float NearZ, float FarZ);
void ComputeReflectionsMap(ID3D11DeviceContext* context, const CameraObject& camera, ID3D11ShaderResourceView* NormalDepthSRV);
};
#endif // SSPR_H