DI-Guy SDK Documentation  13.1
7.2 - Types Overview

The basic concept for using the DI-Guy Graphics API is quite simple.

A set of classes, defined below, is available. You can make subclasses of these, and thus tailor DI-Guy rendering to the target rendering system.

7.2.1 Links

DI-Guy characters are composed of a hierarchy of links. These links, also known as bones, form the skeleton of the character. Links have no visible geometry of their own, but serve as attachment points for shapes. Links are not shared among characters; each character has its own collection of links.

Links are implemented with the diguyGraphicsLink object.

7.2.2 Shapes

Shapes are visible parts that are attached to links to "flesh out" the skeleton; with no shapes the link would not be visible. As links move, the shapes attached to them move. Shapes are not shared among characters; each character has its own collection of shapes.

Shapes are implemented with the diguyGraphicsShape object.

7.2.3 Files

Shapes are read from geometry files. DI-Guy most often uses the OpenFlight (.flt) format for static geometry, and the Collada (.dae) format for skinned geometry.

Geometry files are implemented with the diguyGraphicsFile object.

7.2.4 Meshes

Each shape is composed of one or more polygonal meshes. Each mesh consists of polygonal faces that have vertices, normals, and texture indices, as well as a graphics state that includes material, texture, and lighting settings. All faces in a mesh share the same graphics state. Meshes are shared among characters; if two characters with the same appearance are loaded, only one copy of each mesh is loaded.

Meshes are implemented with the diguyGraphicsMesh object.

7.2.5 Graphics States

Graphics states encode all information about how the polygons in a mesh should be drawn. This includes material information, a texture, and other lighting information. Graphics states are shared among characters; if two characters with the same appearance are loaded, only one copy of each state is defined.

Graphics states are implemented with the diguyGraphicsState object.

7.2.6 Materials

Materials specify the colors and lighting used to display the mesh. Materials include the ambient, diffuse, and specular components that are commonly used in renderer lighting models. Materials are shared among characters; if two characters with the same appearance are loaded, only one copy of each material is loaded.

Materials are implemented with the diguyGraphicsMaterial object.

7.2.7 Textures

Textures are 2D images that are painted onto mesh faces. Textures combine with materials to determine the appearance of the mesh. Textures are shared among characters; if two characters with the same appearance are loaded, only one copy of each texture is loaded.

Textures are implemented with the diguyGraphicsTexture object.

7.2.8 Shader Program

Most rendering environments use some type of shader system that offloads rendering operations from the CPU to a GPU. Terminology varies, but DI-Guy uses the term "shader" to refer to a pair of sub-programs: a vertex shader and a pixel shader (or fragment shader in OpenGL).

Shader programs are shared among characters; if two characters use the same shader, the same shader object is used for both.

Shader programs are implemented with the diguyGraphicsShaderProgram object.

7.2.9 Shader Technique

A shader technique describes the various shaders that can be used to render a character. These include a number of different shaders that represent different quality levels and depending on the camera's distance from a character a different one can be picked. A technique can be subclassed and an end user can add additional shaders to it and implement their own LOD system or switch in a different shader for alternative lighting situations.

Shader Technique are implemented with the diguyGraphicsShaderTechnique object.

7.2.10 Shader Instance

As mentioned above shader programs are shared among characters. Shader instances allow non-shared, character-specific shader state to be maintained. An example is having different uniform variable values for different characters, such as a highlight color that is applied during shading.

Shader instances are implemented with the diguyGraphicsShaderInstance object.

[<< Introduction to the DI-Guy Graphics API] [Home] [Top of Page] [Usage Overview >>]