DI-Guy SDK Documentation  13.1
diguyGraphicsVertexFormats.h File Reference
#include <diguy_constants.h>
#include <declspec_diguy.h>

Go to the source code of this file.

Macros

#define CPLUSPLUS_ONLY
  Link against: libdiguy_graphics_api More...
 

Enumerations

enum  diguyGraphicsVertexFormat {
  DIGUY_GRAPHICS_VERTEX_FORMAT_UNKNOWN = -1, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2 = 0, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS = 1, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4 = 2,
  DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS = 3, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4 = 4, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4 = 5
}
 This enumeration lists types of vertex data formats DI-Guy may use. More...
 
enum  diguyGraphicsIndexType { DIGUY_GRAPHICS_INDEX_TYPE_UNKNOWN = -1, DIGUY_GRAPHICS_INDEX_TYPE_UINT = 0, DIGUY_GRAPHICS_INDEX_TYPE_USHORT = 1, DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD = 2 }
 This enumeration lists the types that indices stored in index buffer data might have. More...
 

Macro Definition Documentation

#define CPLUSPLUS_ONLY

Link against: libdiguy_graphics_api

Enumeration Type Documentation

This enumeration lists types of vertex data formats DI-Guy may use.

In general the same vertex format meshes will use cannot be the same for all meshes, as static meshes don't use indices and weights, but dynamic meshes (e.g., skinned meshes) do.

The data member use_array_format_for_vertex_buffer_data of the bdiGraphicsInitGraphicsAPI structure can be used to specify whether interleaved or array format is to be used.

See diguyGraphicsMesh::get_vertex_format().

DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2

 The most basic vertex format DI-Guy supports:  One vertex position,
 one normal, and one UV texture coordinate.  These values are
 interleaved like so:

     vnt vnt vnt vnt ...

 Where 'v' represents three floats specifying vertex position, 'n'
 represents three floats specifying normal direction, and 't'
 represents two floats specifying texture indices.

 This format is commonly used by static meshes.  It cannot be used
 by skinned meshes.

DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS

 This vertex format puts all vertices first, followed by all normals,
 followed by all texture indices:

  vvvv vvvv ... nnnn nnnn .. tttt tttt ...

 This format is commonly used by static meshes.  It cannot be used
 by skinned meshes.

DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4

 Vertices for skinned meshes require more info; specifically, they
 need the indices of the links/bones that influence them and the
 weights of said influences.  DI-Guy supports at most 4 link
 influences per vertex.

 Indices are stored as floats instead of an int or unsigned int
 because data passed to shaders in attribute variables (at least for
 glsl shaders) needs to be in float form, not int.

 These values are interleaved like so:

  vntiw vntiw vntiw vntiw ...

 Where 'i' and 'w' each represent four floats specifying indices
 and weights, respectively.

 This format is commonly used by skinned meshes.  It could be used
 by static meshes, but doing so would waste memory.

DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS

 Similar to DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4, but values
 are not interleaved:

  vvvv ... nnnn .. tttt ... iiii ... wwww ...

 This format is commonly used by skinned meshes.  It could be used
 by static meshes, but doing so would waste memory.
Enumerator
DIGUY_GRAPHICS_VERTEX_FORMAT_UNKNOWN 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_ARRAYS 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4_ARRAYS 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4 

This enumeration lists the types that indices stored in index buffer data might have.

The data member default_vertex_type of the bdiGraphicsInitGraphicsAPI structure can be used to specify which index type is needed.

Also see diguyGraphicsMesh::get_index_type().

Note that indices in index buffer data are different than the indices contained in vertex buffer data. Index buffer indices specify which vertices in vertex buffer data are used to create polygons in a mesh (e.g., for the first triangle, use vertices 0, 1, and 2), while indices stored in vertex buffer data specify which **inks* affect the final position of the vertex.

DIGUY_GRAPHICS_INDEX_TYPE_UINT

 Index buffer data is stored as unsigned integers (4 bytes).

DIGUY_GRAPHICS_INDEX_TYPE_USHORT

 Index buffer data is stored as unsigned short integers (2 bytes).

DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD

 Index buffer data is stored as Windows WORD type.  This is a 32 bit
 unsigned integer, so it's really the same as
 DIGUY_GRAPHICS_INDEX_TYPE_UINT.
Enumerator
DIGUY_GRAPHICS_INDEX_TYPE_UNKNOWN 
DIGUY_GRAPHICS_INDEX_TYPE_UINT 
DIGUY_GRAPHICS_INDEX_TYPE_USHORT 
DIGUY_GRAPHICS_INDEX_TYPE_D3D_WORD