Cogs.Core
VertexFormats.h
1#pragma once
2
3#include "Base.h"
4
5#include "Rendering/Common.h"
6#include "Rendering/VertexFormat.h"
7
8#include <glm/glm.hpp>
9#include <glm/packing.hpp>
10
11#pragma pack(push)
12#pragma pack(1)
13
14namespace Cogs::Core
15{
16 struct COGSCORE_DLL_API VertexFormats
17 {
18 static void initialize();
19
20 static VertexFormatHandle Pos2f;
21 static VertexFormatHandle Pos3f;
22 static VertexFormatHandle Pos4f;
23 static VertexFormatHandle Norm3f;
24 static VertexFormatHandle Norm4s8;
25 static VertexFormatHandle Norm10;
26 static VertexFormatHandle Tang3f;
27 static VertexFormatHandle Tang4f;
28 static VertexFormatHandle Bitang3f;
29 static VertexFormatHandle Tex2f;
30 static VertexFormatHandle Tex2f1;
31 static VertexFormatHandle Color4f;
32
33 static VertexFormatHandle Pos4fColor4f;
34
35 static VertexFormatHandle Pos3fNorm3f;
36 static VertexFormatHandle Pos3fNorm3fTex2f;
37 static VertexFormatHandle Pos3fNorm8Tex2f;
40 static VertexFormatHandle Pos3fNorm3fTex4f;
41 static VertexFormatHandle Pos3fNorm4fTex4f;
42 static VertexFormatHandle Pos4fNorm4fTex4f;
43
44 static VertexFormatHandle Pos3fNorm3fTan3fTex2f;
45
46 static VertexFormatHandle Pos3fNorm3fColor4fTex2f;
47 static VertexFormatHandle Pos3fNorm3fColor4f;
48
49 static VertexFormatHandle Pos3fTex2f;
50
51 static VertexFormatHandle BoneIndex4i;
52 static VertexFormatHandle BoneWeight4f;
53
54 static VertexFormatHandle InstancePos3f;
55 static VertexFormatHandle InstanceColor4f;
56 };
57
59 {
60 glm::vec3 position;
61
62 static VertexFormatHandle getVertexFormat()
63 {
64 return VertexFormats::Pos3f;
65 }
66 };
67
69 {
70 glm::vec4 position;
71 glm::vec4 color;
72
73 static VertexFormatHandle getVertexFormat()
74 {
75 return VertexFormats::Pos4fColor4f;
76 }
77 };
78
80 {
81 glm::vec3 position;
82 glm::vec3 normal;
83
84 static VertexFormatHandle getVertexFormat()
85 {
86 return VertexFormats::Pos3fNorm3f;
87 }
88 };
89
91 {
92 glm::vec3 position;
93 glm::vec3 normal;
94 glm::vec2 tex;
95
96 static VertexFormatHandle getVertexFormat()
97 {
98 return VertexFormats::Pos3fNorm3fTex2f;
99 }
100 };
101
103 {
104 uint32_t x : 10;
105 uint32_t y : 10;
106 uint32_t z : 10;
107 uint32_t w : 2;
108 };
109
111 {
112 uint64_t position;
113 vec1010102 normal;
114 glm::vec2 tex;
115
116 static VertexFormatHandle getVertexFormat()
117 {
118 return VertexFormats::Pos4hNorm10Tex2f;
119 }
120 };
121
123 {
124 uint64_t position;
125 struct
126 {
127 int8_t x, y, z, w;
128 } normal;
129 glm::vec2 tex;
130
131 static VertexFormatHandle getVertexFormat()
132 {
133 return VertexFormats::Pos4hNorm8Tex2f;
134 }
135 };
136
138 {
139 glm::vec3 position;
140 glm::vec3 normal;
141 glm::vec4 color;
142
143 static VertexFormatHandle getVertexFormat()
144 {
145 return VertexFormats::Pos3fNorm3fColor4f;
146 }
147 };
148
150 {
151 BillboardVertex() {}
152 BillboardVertex(glm::vec3 position, glm::vec2 texCoord) : position(position), texCoord(texCoord) {}
153
154 glm::vec3 position;
155 glm::vec2 texCoord;
156
157 static VertexFormatHandle getVertexFormat()
158 {
159 return VertexFormats::Pos3fTex2f;
160 }
161 };
162
165}
166
167#pragma pack(pop)
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....