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