-
Notifications
You must be signed in to change notification settings - Fork 4
/
Renderer.h
86 lines (63 loc) · 1.28 KB
/
Renderer.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
/*
* Renderer Class
*/
#ifndef RENDERER_H
#define RENDERER_H
#include "d3dApp.h"
#include "RenderStates.h"
#include "Controller.h"
#define USE_QUADTREE 0
#if USE_QUADTREE
#include "Ellipsoid.h"
#endif
enum RenderOptions
{
RenderOptionsBasic = 0,
RenderOptionsNormalMap = 1,
RenderOptionsDisplacementMap = 2
};
class Renderer : public D3DApp
{
public:
/*
* Renderer Constructor.
*/
Renderer(HINSTANCE hInstance);
/*
* Renderer Destructor.
*/
~Renderer();
bool Init();
void OnResize();
void UpdateScene(float dt);
void DrawScene();
private:
void BuildGeometryBuffers();
private:
#if USE_QUADTREE
Ellipsoid earth;
#endif
ID3D11Buffer* mVB;
ID3D11Buffer* mIB;
ID3D11ShaderResourceView* mEarthDiffuseMapSRV;
ID3D11ShaderResourceView* mEarthNormalTexSRV;
ID3D11ShaderResourceView* mCloudsDiffuseMapSRV;
ID3D11ShaderResourceView* mCloudsNormalTexSRV;
DirectionalLight mDirLights[3];
Material mEarthMat;
XMFLOAT4X4 mTexTransform;
XMFLOAT4X4 mEarthWorld;
XMFLOAT4X4 mProj;
int mEarthVertexOffset;
UINT mEarthIndexOffset;
UINT mEarthIndexCount;
int mSkyVertexOffset;
UINT mSkyIndexOffset;
UINT mSkyIndexCount;
int mCloudsVertexOffset;
UINT mCloudsIndexOffset;
UINT mCloudsIndexCount;
RenderOptions mRenderOptions;
Controller control;
};
#endif