-
Notifications
You must be signed in to change notification settings - Fork 1
/
PostProcessing.h
116 lines (82 loc) · 3.17 KB
/
PostProcessing.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once
#include "DXUT.h"
#include "AntTweakBar.h"
#define NUM_TONEMAP_TEXTURES 5
struct SCREEN_VERTEX
{
D3DXVECTOR4 pos;
D3DXVECTOR2 tex;
static const DWORD FVF;
};
class PostProcessing
{
public:
PostProcessing(void);
~PostProcessing(void);
void DrawFullscreenQuad( ID3D10Device* pd3dDevice, ID3D10EffectTechnique* pTech, UINT Width, UINT Height );
HRESULT OnResizedSwapChain(const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc);
HRESULT PostProcessing::OnCreateDevice(ID3D10Effect *eff, ID3D10Device *dev, TwBar *bar);
HRESULT PostProcessing::OnFrameRender(ID3D10RenderTargetView *rtv, const float ClearColor[4]);
HRESULT ClearRenderTargets(const float clearcolor[4]);
HRESULT RenderToTexture();
HRESULT UpdateShaderVariables();
void OnReleasingSwapChain();
void OnDestroyDevice();
private:
ID3D10Effect *g_pEffect;
ID3D10Device* pd3dDevice;
UINT g_uiWidth, g_uiHeight;
bool g_bHDRenabled;
bool g_bDOFenabled;
bool g_bMotionBlurenabled;
float g_fDOF_offset;
ID3D10EffectScalarVariable *g_pDOF_offset;
int g_iDOF_mult;
ID3D10EffectScalarVariable *g_pDOF_mult;
int g_iDOFfadespeed;
ID3D10EffectScalarVariable *g_pDOFfadespeed;
float g_fHDRfadespeed;
ID3D10EffectScalarVariable *g_pHDRfadespeed;
ID3D10EffectShaderResourceVariable* g_tDepth;
ID3D10EffectShaderResourceVariable* g_pt1;
ID3D10EffectShaderResourceVariable* g_pt2;
ID3D10EffectShaderResourceVariable* g_pt3;
ID3D10DepthStencilView* g_pDSV;
ID3D10Texture2D* g_pDepthStencil;
ID3D10ShaderResourceView* g_pDepthStencilRV;
ID3D10InputLayout* g_pQuadLayout;
ID3D10Buffer* g_pScreenQuadVB;
ID3D10Texture2D* g_pHDRTarget0;
ID3D10ShaderResourceView* g_pHDRTarget0RV;
ID3D10RenderTargetView* g_pHDRTarget0RTV;
ID3D10Texture2D* g_pHDRTarget1;
ID3D10ShaderResourceView* g_pHDRTarget1RV;
ID3D10RenderTargetView* g_pHDRTarget1RTV;
ID3D10Texture2D* g_pToneMap[NUM_TONEMAP_TEXTURES];
ID3D10ShaderResourceView* g_pToneMapRV[NUM_TONEMAP_TEXTURES];
ID3D10RenderTargetView* g_pToneMapRTV[NUM_TONEMAP_TEXTURES];
ID3D10Texture2D* g_pToneMapFinal;
ID3D10ShaderResourceView* g_pToneMapFinalRV;
ID3D10RenderTargetView* g_pToneMapFinalRTV;
ID3D10Texture2D* g_pHDRBrightPass;
ID3D10ShaderResourceView* g_pHDRBrightPassRV;
ID3D10RenderTargetView* g_pHDRBrightPassRTV;
ID3D10Texture2D* g_pHDRBloom;
ID3D10ShaderResourceView* g_pHDRBloomRV;
ID3D10RenderTargetView* g_pHDRBloomRTV;
ID3D10Texture2D* g_pHDRBloom2;
ID3D10ShaderResourceView* g_pHDRBloom2RV;
ID3D10RenderTargetView* g_pHDRBloom2RTV;
ID3D10Texture2D* g_pDOFTex1;
ID3D10ShaderResourceView* g_pDOFTex1RV;
ID3D10RenderTargetView* g_pDOFTex1RTV;
ID3D10Texture2D* g_pDOFTex2;
ID3D10ShaderResourceView* g_pDOFTex2RV;
ID3D10RenderTargetView* g_pDOFTex2RTV;
ID3D10Texture2D* g_pDOFDepth1;
ID3D10ShaderResourceView* g_pDOFDepth1RV;
ID3D10RenderTargetView* g_pDOFDepth1RTV;
ID3D10Texture2D* g_pDOFDepth2;
ID3D10ShaderResourceView* g_pDOFDepth2RV;
ID3D10RenderTargetView* g_pDOFDepth2RTV;
};