/
ShellTextureShader.h
52 lines (43 loc) · 1.36 KB
/
ShellTextureShader.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
#include "ShaderPair.h"
class ShellTextureShader : public ShaderPair
{
float windOffset1x = 0;
float windOffset1z = 0;
float windOffset2x = 0;
float windOffset2z = 0;
public:
float windSpeed = 0.0025;
struct CB_VS_PER_OBJECT
{
XMMATRIX matWorldViewProj;
XMMATRIX matWorld;
};
struct CB_VS_WIND_OFFSET
{
XMFLOAT2 offset1;
XMFLOAT2 offset2;
};
struct CB_PS_PER_OBJECT
{
XMFLOAT4 m_vObjectColor;
XMFLOAT4 offsetUV;
};
~ShellTextureShader();
WCHAR *vsFilePath() override;
LPCSTR vsName() override;
WCHAR *psFilePath() override;
LPCSTR psName() override;
WCHAR * noiseTextureFilePath = L"Media\\Grass\\noise.png";
// resources
ID3D11Buffer *cbVSPerObject = NULL;
ID3D11Buffer *cbPSPerObject = NULL;
ID3D11Buffer *cbVSWindOffset = NULL;
ID3D11ShaderResourceView *txNoise = NULL;
ID3D11ShaderResourceView *txWind1 = NULL;
ID3D11ShaderResourceView *txWind2 = NULL;
void onFrameMove(double fTime, float fElapsedTime) override;
void createBuffers(ID3D11Device* pd3dDevice) override;
void setConstantBuffers(ID3D11DeviceContext* pd3dImmediateContext) override;
void updateBuffersPerObject(ID3D11DeviceContext* pd3dImmediateContext, const XMMATRIX& worldMatrix, const XMMATRIX& matWorldViewProjection, XMFLOAT4 color) override;
void updateBuffersPerFrame(ID3D11DeviceContext* pd3dImmediateContext) override;
};