-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathVertexTypes.h
104 lines (88 loc) · 2.3 KB
/
VertexTypes.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
#pragma once
#include <inttypes.h>
#include "bb_lib\vec2.h"
#include "bb_lib\vec3.h"
#include "bb_lib\vec4.h"
#include "bb_lib\mat3.h"
#include "bb_lib\mat4.h"
#include "bb_lib\math_util.h"
namespace happy
{
enum class VertexType
{
VertexPositionColor,
VertexPositionTexcoord,
VertexPositionNormalTexcoord,
VertexPositionNormalTangentBinormalTexcoord,
VertexPositionNormalTangentBinormalTexcoordIndicesWeights,
Particle,
};
typedef uint16_t Index16;
typedef uint32_t Index32;
struct VertexPositionColor
{
bb::vec4 pos;
bb::vec4 color;
static const D3D11_INPUT_ELEMENT_DESC Elements[2];
static const UINT ElementCount = 2;
static const VertexType Type = VertexType::VertexPositionColor;
};
struct VertexPositionTexcoord
{
bb::vec4 pos;
bb::vec2 texcoord;
static const D3D11_INPUT_ELEMENT_DESC Elements[2];
static const UINT ElementCount = 2;
static const VertexType Type = VertexType::VertexPositionTexcoord;
};
struct VertexPositionNormalTexcoord
{
bb::vec4 pos;
bb::vec3 normal;
bb::vec2 texcoord;
static const D3D11_INPUT_ELEMENT_DESC Elements[3];
static const UINT ElementCount = 3;
static const VertexType Type = VertexType::VertexPositionNormalTexcoord;
};
struct VertexPositionNormalTangentBinormalTexcoord
{
bb::vec4 pos;
bb::vec3 normal;
bb::vec3 tangent;
bb::vec3 binormal;
bb::vec2 texcoord;
static const D3D11_INPUT_ELEMENT_DESC Elements[5];
static const UINT ElementCount = 5;
static const VertexType Type = VertexType::VertexPositionNormalTangentBinormalTexcoord;
};
struct VertexPositionNormalTangentBinormalTexcoordIndicesWeights
{
bb::vec4 pos;
bb::vec3 normal;
bb::vec3 tangent;
bb::vec3 binormal;
bb::vec2 texcoord;
Index16 indices[4];
bb::vec4 weights;
static const D3D11_INPUT_ELEMENT_DESC Elements[7];
static const UINT ElementCount = 7;
static const VertexType Type = VertexType::VertexPositionNormalTangentBinormalTexcoordIndicesWeights;
};
struct VertexParticle
{
bb::vec4 attrPos;
bb::vec4 attr0;
bb::vec4 attr1;
bb::vec4 attr2;
bb::vec4 attr3;
bb::vec4 attr4;
bb::vec4 attr5;
bb::vec4 attr6;
bb::vec4 attr7;
bb::vec4 attr8;
bb::vec4 tex;
static const D3D11_INPUT_ELEMENT_DESC Elements[11];
static const UINT ElementCount = 11;
static const VertexType Type = VertexType::Particle;
};
}