-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreenSpaceFxProcessor.h
More file actions
77 lines (54 loc) · 1.9 KB
/
ScreenSpaceFxProcessor.h
File metadata and controls
77 lines (54 loc) · 1.9 KB
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
#pragma once
//#include <d3d10.h>
#include <d3dx10.h>
#include <vector>
#include <unordered_map>
#include <set>
#include <memory>
#include "Viewpoint.h"
#include "FontRenderer.h"
struct Vertex3D
{
Vertex3D(D3DXVECTOR4 vecPos,D3DXVECTOR2 vecNorm) : Pos(vecPos), Tex(vecNorm){}
Vertex3D(D3DXVECTOR4 vecPos) : Pos(vecPos), Tex(D3DXVECTOR2()){}
D3DXVECTOR4 Pos;
D3DXVECTOR2 Tex;
};
class CScreenSpaceFxProcessor
{
public:
CScreenSpaceFxProcessor(void);
~CScreenSpaceFxProcessor(void);
void Init( ID3D10Device * device, ID3D10Texture2D * baseRenderTargetTex,ID3D10RenderTargetView*sourceRenderTargetView, const D3D10_VIEWPORT & srcVptDesc );
void Release();
void Process(ID3D10Device * device,ID3D10ShaderResourceView * envmap, const CViewpoint & viewpoint);
void ProcessEnv(ID3D10Device * device,ID3D10ShaderResourceView * envmap, const CViewpoint & viewpoint);
bool UseFXAA;
bool ShowText;
bool debugShowBloomOnly;
bool debugShowBrightpassOnly;
std::wstring headerText;
std::wstring footerText;
private:
void DrawFsQuad(ID3D10Device * device,ID3D10ShaderResourceView * srcTexView, LPCSTR techName );
void processFxaa(ID3D10Device * device);
void renderText(ID3D10Device * device);
ID3D10RenderTargetView* srcRenderTargetView;
ID3D10RenderTargetView* offscreenRenderTargetView;
ID3D10Texture2D* offscreenTex;
ID3D10ShaderResourceView* offscreenTexView;
ID3D10RenderTargetView* offscreenSmallRenderTargetView[2];
ID3D10Texture2D* offscreenSmallTex[2];
ID3D10ShaderResourceView* offscSmallTexView[2];
ID3D10Effect* fxBloom;
ID3D10Effect* fxFxaa;
ID3D10ShaderResourceView* srcTexView;
ID3D10Buffer * fsQuadBuf;
ID3D10InputLayout* vertex3Layout;
D3D10_VIEWPORT srcViewportDesc;
D3D10_VIEWPORT bloomViewportDesc;
std::unique_ptr<CFontRenderer> fontRenderer;
float fBrightnessTolerance;
int fxBufWidth;
int fxBufHeight;
};