DI-Guy SDK Documentation  13.8
diguyGraphicsVertexFormats.h
Go to the documentation of this file.
1 /****************************************************************************
2  * Copyright (c) 2024 MAK Technologies, Inc.
3  * All rights reserved.
4  ****************************************************************************/
5 
6 /*********************************************************************/
13 #ifndef __diguyGraphicsVertexFormats_H
14 #define __diguyGraphicsVertexFormats_H
15 
16 #ifdef SWIG
17 %module diguyGraphicsVertexFormats
18 #else
19 #define CPLUSPLUS_ONLY
20 #include <diguy_constants.h>
21 #include <declspec_diguy.h>
22 #endif
23 
24 
25 /****************************************************************************/
26 /*l
27  *b Description:
28  **
29  ** This enumeration lists types of vertex data formats DI-Guy may use.
30  ** In general the same vertex format meshes will use cannot be
31  ** the same for all meshes, as static meshes don't use indices and
32  ** weights, but dynamic meshes (e.g., skinned meshes) do.
33  **
34  ** The data member use_array_format_for_vertex_buffer_data of the
35  ** bdiGraphicsInitGraphicsAPI structure can be used to specify
36  ** whether interleaved or array format is to be used.
37  **
38  ** See diguyGraphicsMesh::get_vertex_format().
39  **
40  *i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2
41  **
42  ** The most basic vertex format DI-Guy supports: One vertex position,
43  ** one normal, and one UV texture coordinate. These values are
44  ** interleaved like so:
45  *>
46  ** vnt vnt vnt vnt ...
47  *<
48  ** Where 'v' represents three floats specifying vertex position, 'n'
49  ** represents three floats specifying normal direction, and 't'
50  ** represents two floats specifying texture indices.
51  **
52  ** This format is commonly used by static meshes. It cannot be used
53  ** by skinned meshes.
54  **
55  *<
56  *i DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4
57  **
58  ** Vertices for skinned meshes require more info; specifically, they
59  ** need the indices of the links/bones that influence them and the
60  ** weights of said influences. DI-Guy supports at most 4 link
61  ** influences per vertex.
62  **
63  ** Indices are stored as floats instead of an int or unsigned int
64  ** because data passed to shaders in attribute variables (at least for
65  ** glsl shaders) needs to be in float form, not int.
66  **
67  ** These values are interleaved like so:
68  *>
69  *- vntiw vntiw vntiw vntiw ...
70  *<
71  ** Where 'i' and 'w' each represent four floats specifying indices
72  ** and weights, respectively.
73  **
74  ** This format is commonly used by skinned meshes. It could be used
75  ** by static meshes, but doing so would waste memory.
76  **
77  ** DIGUY_GRAPHICS_VERTEX_FORMAT_V4_N4_T4
78  **
79  ** padded data for use in SSBOs for blend shapes.
80  *<
81  ** \ingroup diguyGraphicsAPI
82  */
83 typedef enum
84 {
90  // blend shape format
93 
94 /****************************************************************************/
95 /*l
96  *b Description:
97  **
98  ** This enumeration lists the type that indices stored in index buffer
99  ** data might have.
100  **
101  ** Also see diguyGraphicsMesh::get_index_type().
102  **
103  ** Note that indices in index buffer data are different than the indices
104  ** contained in vertex buffer data. Index buffer indices specify which
105  ** *vertices* in vertex buffer data are used to create polygons in a mesh
106  ** (e.g., for the first triangle, use vertices 0, 1, and 2), while indices
107  ** stored in vertex buffer data specify which *links* affect the final
108  ** position of the vertex.
109  **
110  *i DIGUY_GRAPHICS_INDEX_TYPE_UINT
111  **
112  ** Index buffer data is stored as unsigned integers (4 bytes).
113  **
114  *i DIGUY_GRAPHICS_INDEX_TYPE_USHORT
115  **
116  ** Index buffer data is stored as unsigned short integers (2 bytes).
117  **
118  ** Unless the mesh has more then 65k verts the data will be unsigned shorts.
119  **
120  ** \ingroup diguyGraphicsAPI
121  */
122 typedef enum
123 {
127 
129 
130 
131 #endif /* __diguyGraphicsVertexFormats_H */
132 
Definition: diguyGraphicsVertexFormats.h:86
Definition: diguyGraphicsVertexFormats.h:82
Definition: diguyGraphicsVertexFormats.h:88
Definition: diguyGraphicsVertexFormats.h:84
Definition: diguyGraphicsVertexFormats.h:120
Definition: diguyGraphicsVertexFormats.h:83
Definition: diguyGraphicsVertexFormats.h:122
diguyGraphicsIndexType
This enumeration lists the type that indices stored in index buffer data might have.
Definition: diguyGraphicsVertexFormats.h:118
Definition: diguyGraphicsVertexFormats.h:121
Definition: diguyGraphicsVertexFormats.h:85
diguyGraphicsVertexFormat
This enumeration lists types of vertex data formats DI-Guy may use.
Definition: diguyGraphicsVertexFormats.h:80