/
VerticalBlurShader.h
40 lines (30 loc) · 996 Bytes
/
VerticalBlurShader.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
// Vertical blur shader handler
// Loads vertical blur shaders (vs and ps)
// Passes screen height to shaders, for sample coordinate calculation
#ifndef _VERTICALBLURSHADER_H_
#define _VERTICALBLURSHADER_H_
//#include "../DXFramework/DXF.h"
#include "../DXFramework/BaseShader.h"
using namespace std;
using namespace DirectX;
class VerticalBlurShader : public BaseShader
{
private:
struct ScreenSizeBufferType
{
float screenHeight;
XMFLOAT3 blurWeights;
};
public:
VerticalBlurShader(ID3D11Device* device, HWND hwnd);
~VerticalBlurShader();
void SetShaderParameters(ID3D11DeviceContext* deviceContext, const XMMATRIX &world, const XMMATRIX &view, const XMMATRIX &projection, ID3D11ShaderResourceView* texture, float width, XMFLOAT3 blurWeights);
void Render(ID3D11DeviceContext* deviceContext, int vertexCount);
private:
void InitShader(WCHAR*, WCHAR*);
private:
ID3D11Buffer* m_matrixBuffer;
ID3D11SamplerState* m_sampleState;
ID3D11Buffer* m_ScreenSizeBuffer;
};
#endif