DI-Guy SDK Documentation  13.7
DI-Guy Graphics API

The portion of the API focused on integrating DI-Guy into your rendering framework. detailed overview at 7.1 - Introduction to the DI-Guy Graphics API. More...

Classes

class  diguyGraphicsInstanceGroup
 A class that represents an instance group. An instance group is a collection of meshes, attached to shapes, that can be drawn with a single draw call using supplemental instance data information. An instance group can contain segmented meshes or skinned mesh. More...
 
class  diguyGraphicsLink
 A class that represents the unique per-character non-shared joint of a character. A diguyCharacter is a hierarchy of links and joints. Think of the links as the bones of the characters while joints are the articulations. Note that the links themselves do not have any geometry directly associated with them; instead geometry is associated with shapes, which in turn are associated with links. More...
 
class  diguyGraphicsMaterial
 A class that represents a shared material. More...
 
struct  diguyDrawCallData
 A struct that represents the information that diguy puts together for an immediate mode draw call. More...
 
class  diguyGraphicsMesh
 A class that represents a shared mesh object. More...
 
class  diguyGraphicsShaderInstance
 A class that represents the unique per-character shader object. More...
 
class  diguyGraphicsShaderProgram
 This class implements shader programs for use with DI-Guy character graphics. More...
 
struct  diguyShaderPickDescription
 This struct is passed into diguyGraphicsShaderTechnique::pick_shader_program() to provide the end user information to base the resulting shader choice. More...
 
class  diguyGraphicsShaderTechnique
 This class implements shader lod system for use with DI-Guy character graphics. More...
 
class  diguyGraphicsShape
 A class that represents the unique per-character non-shared mesh object. DI-Guy encapsulates its textured geometry in objects called shapes. One or more shapes are associated with each link, so when a link is "drawn", it is actually its array of shapes that are drawn. For example, a head link might have two shapes associated with it: A human head and a helmet. A shape can either be a rigid mesh or a skinned one. More...
 
class  diguyGraphicsState
 A class that represents a shared material/textures combination. More...
 
class  diguyGraphicsTexture
 A class that represents a shared texture. More...
 
class  diguyGraphicsTextureArray
 A class that represents a shared 2D texture array. More...
 
class  diguyParticleSystem
 An interface class that represents a particle system that has been created by diguy's appearance effect system. this class allows you to hook up diguy to a 3rd party particle system basing the mapping on the particle name. It's also possible to directly render diguy particles via the diguyParticleSystemRenderer class. More...
 
class  diguyParticleSystemRenderer
 An interface class that allows diguy to trigger an immediate mode rendering of a diguy particle system. This class allows you to directly utilize the DI-Guy particle system. See diguyOglParticleSystemRenderer for a sample implementation. More...
 
struct  diguyShadowMapParams
 Lightweight structure for sending shadow parameters to shaders from DI-Guy Scenario note this maps directly to a uniform buffer structure please be careful with padding. More...
 
class  diguyUniformBufferUpdater
 This class is an abstract wrapper around shader constants for use with DI-Guy rendering. More...
 
class  diguyRenderSettings
 Private Class. More...
 
class  diguyGraphicsFile
 A wrapper around a geometry file. More...
 
class  diguyGraphicsFrameBuffer
 A class that represents a frame buffer, this is used by the graphics api to enable shadow maps in programming examples. Will probably be unnecessary for most customers. See diguyOglGraphicsFrameBuffer for a sample implementation. More...
 
class  diguyParticleDrawDesc
 An Structure that represents a particle system draw state. This struct allows you to feed rendering information to OpenGL. 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_I4F_W4 = 1, DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4 = 2,
  DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4 = 3, DIGUY_GRAPHICS_VERTEX_FORMAT_V4_N4_T4 = 4
}
 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 }
 This enumeration lists the type that indices stored in index buffer data might have. More...
 

Graphics API Initialization Functions

int diguy_graphics_initialize (bdiGraphicsInitGraphicsAPI *init)
 This function initializes the DI-Guy Runtime API for accessing information about DI-Guy graphics and geometry. More...
 
int diguy_graphics_get_defaults (bdiGraphicsInitGraphicsAPI *init)
 Fills out the init structure with default values. More...
 
int diguy_graphics_get_osg_defaults (bdiGraphicsInitGraphicsAPI *init)
 Fills out the init structure with default OSG values. More...
 
int diguy_graphics_get_dx9_defaults (bdiGraphicsInitGraphicsAPI *init)
 Fills out the init structure with default values. More...
 
void diguy_graphics_set_use_far_positions (int flag)
 This function turns far position rendering on or off. More...
 
int diguy_graphics_get_use_far_positions ()
 This function gets the status of far position rendering. More...
 

DI-Guy Graphics Object Create Functions

int diguy_graphics_set_link_create_func (diguyGraphicsLinkCreateFunc *func)
 Function responsible for allowing end users to subclass from a diguyGraphicsLink. More...
 

Detailed Description

The portion of the API focused on integrating DI-Guy into your rendering framework. detailed overview at 7.1 - Introduction to the DI-Guy 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_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_V4_N4_T4

padded data for use in SSBOs for blend shapes.

Enumerator
DIGUY_GRAPHICS_VERTEX_FORMAT_UNKNOWN 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_I4F_W4 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4_I4F_W4 
DIGUY_GRAPHICS_VERTEX_FORMAT_V3_N3_T2_T4 
DIGUY_GRAPHICS_VERTEX_FORMAT_V4_N4_T4 

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

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).

Unless the mesh has more then 65k verts the data will be unsigned shorts.

Enumerator
DIGUY_GRAPHICS_INDEX_TYPE_UNKNOWN 
DIGUY_GRAPHICS_INDEX_TYPE_UINT 
DIGUY_GRAPHICS_INDEX_TYPE_USHORT 

Function Documentation

int diguy_graphics_initialize ( bdiGraphicsInitGraphicsAPI init)

This function initializes the DI-Guy Runtime API for accessing information about DI-Guy graphics and geometry.

Use diguy_graphics_get_defaults() to fill out the init structure before changing specific entries.

Parameters
initpointer to type bdiGraphicsInitGraphicsAPI; passing NULL will cause defaults to be used for all values

Returns:

0 on success, non-zero error code on failure

Refer to diguy_constants.h for error code values.

int diguy_graphics_set_link_create_func ( diguyGraphicsLinkCreateFunc func)

Function responsible for allowing end users to subclass from a diguyGraphicsLink.

int diguy_graphics_get_defaults ( bdiGraphicsInitGraphicsAPI init)

Fills out the init structure with default values.

Selected entries can then be changed before calling diguy_graphics_initialize().

The default values are:

  • init->use_shaders = 1;
  • init->shader_language = DIGUY_GRAPHICS_SHADER_LANGUAGE_GLSL;
  • init->transpose_shader_matrices = 0;
  • init->use_4x3_shader_matrices = 1;
  • init->use_cached_optimized_geometry = 1;
  • init->use_cached_compressed_textures = 1;
  • init->use_sRGB_corrected_textures = 1;
  • init->characters_have_world_space_triangle_query = 1;
  • init->scene_objects_have_world_space_triangle_query = 0;
Parameters
initpointer to type bdiGraphicsInitGraphicsAPI

Returns:

0 on success, -1 on failure

int diguy_graphics_get_osg_defaults ( bdiGraphicsInitGraphicsAPI init)

Fills out the init structure with default OSG values.

Selected entries can then be changed before calling diguy_graphics_initialize().

The differences for the default values are:

  • init->transpose_shader_matrices = 1;
  • init->use_4x3_shader_matrices = 0;
  • init->use_sRGB_corrected_textures = 0;
Parameters
initpointer to type bdiGraphicsInitGraphicsAPI

Returns:

0 on success, -1 on failure

int diguy_graphics_get_dx9_defaults ( bdiGraphicsInitGraphicsAPI init)

Fills out the init structure with default values.

Selected entries can then be changed before calling diguy_graphics_initialize().

The differences for the default values are:

  • init->transpose_shader_matrices = 1
  • init->use_4x3_shader_matrices = 0
  • init->shader_language = DIGUY_GRAPHICS_SHADER_LANGUAGE_HLSL
Parameters
initpointer to type bdiGraphicsInitGraphicsAPI

Returns:

0 on success, -1 on failure

void diguy_graphics_set_use_far_positions ( int  flag)

This function turns far position rendering on or off.

It must be called after diguy_graphics_initialize().

Parameters
flagpass 1 to turn far positions on, 0 to turn them off
int diguy_graphics_get_use_far_positions ( )

This function gets the status of far position rendering.

It can only be called after diguy_graphics_initialize().

Returns:

1 if far position rendering is on, 0 if not