-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vertice.h
75 lines (63 loc) · 1.7 KB
/
Vertice.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
#ifndef __VERTICE__
#define __VERTICE__
#include "PreHeader.h"
#include "Utility.h"
namespace VERTICE
{
struct Pos
{
XMFLOAT3 pos; //局部坐标
};
struct PosNormalTex
{
XMFLOAT3 pos; //局部坐标
XMFLOAT3 normal; //法线向量
XMFLOAT2 tex; //纹理坐标
};
struct PosNormalTexTan
{
XMFLOAT3 pos; //局部坐标
XMFLOAT3 normal; //法线向量
XMFLOAT3 tangent; //切线向量
XMFLOAT2 tex; //纹理坐标
};
struct ParticleVertex
{
XMFLOAT3 initialPos;
XMFLOAT3 initialVel;
XMFLOAT2 size;
float age;
unsigned int type;
};
}
struct InputLayoutDesc
{
static const D3D11_INPUT_ELEMENT_DESC Pos[1];
static const D3D11_INPUT_ELEMENT_DESC PosNormalTex[3];
static const D3D11_INPUT_ELEMENT_DESC PosNormalTexTan[4];
static const D3D11_INPUT_ELEMENT_DESC Partical[5];
};
struct InputLayouts
{
static BOOL isInited;
static ID3D11InputLayout *Pos;
static UINT pStride;
static ID3D11InputLayout *PosNormalTex;
static UINT pNTStride;
static ID3D11InputLayout *PosNormalTexTan;
static UINT pNTTStride;
static ID3D11InputLayout *Partical;
static UINT pPStride;
private:
static ID3DX11Effect *verticeEffect;
static ID3DX11EffectTechnique *posTech;
static ID3DX11EffectTechnique *posNormTexTech;
static ID3DX11EffectTechnique *posNormalTexTanTech;
static ID3DX11EffectTechnique *particalTech;
static ID3DBlob *pTechBlob;
static ID3DBlob *pErrorBlob;
public:
static BOOL Init(ID3D11Device* device);
static void Destroy();
};
#endif