Game Development Reference
In-Depth Information
D3DDECLTYPE_D3DCOLOR —A D3DCOLOR type that is
expanded to the RGBA floating-point color vector ( rgba ),
with each component normalized to the interval [0, 1].
Method —Specifies the tessellation method. We consider this
parameter advanced, and thus we use the default method, which is
specified by the identifier D3DDECLMETHOD_DEFAULT .
Usage —Specifies the planned use for the vertex component. For
example, is it going to be a position vector, normal vector, texture
coordinate, etc.? Valid usage identifiers are of the D3DDECLUSAGE
enumerated type:
typedef enum _D3DDECLUSAGE {
D3DDECLUSAGE_POSITION = 0, // Position.
D3DDECLUSAGE_BLENDWEIGHTS = 1, // Blending weights.
D3DDECLUSAGE_BLENDINDICES = 2, // Blending indices.
D3DDECLUSAGE_NORMAL
= 3, // Normal vector.
D3DDECLUSAGE_PSIZE
= 4, // Vertex point size.
D3DDECLUSAGE_TEXCOORD
= 5, // Texture coordinates.
D3DDECLUSAGE_TANGENT
= 6, // Tangent vector.
D3DDECLUSAGE_BINORMAL
= 7, // Binormal vector.
D3DDECLUSAGE_TESSFACTOR
= 8, // Tessellation factor.
D3DDECLUSAGE_POSITIONT
= 9, // Transformed position.
D3DDECLUSAGE_COLOR
= 10, // Color.
D3DDECLUSAGE_FOG
= 11, // Fog blend value.
D3DDECLUSAGE_DEPTH
= 12, // Depth value.
D3DDECLUSAGE_SAMPLE
= 13 // Sampler data.
} D3DDECLUSAGE;
The D3DDECLUSAGE_PSIZE type is used to specify a vertex point
size. This is used for point sprites so that we can control the size
on a per vertex basis. A vertex declaration with a D3DDECLUSAGE_
POSITIONT member implies that the vertex has already been
transformed, which instructs the graphics card to not send this ver-
tex through the vertex processing stages (transformation and
lighting).
Note: A few of these usage types are not covered in this topic, such
as BLENDWEIGHTS , BLENDINDICES , TANGENT , BINORMAL , and
TESSFACTOR .
UsageIndex —Used to identify multiple vertex components of the
same usage. The usage index is an integer in the interval [0, 15].
For example, suppose that we have three vertex components of the
usage D3DDECLUSAGE_NORMAL . We would specify a usage index
of 0 for the first, a usage index of 1 for the second, and a usage
index of 2 for the third. In this way we can identify each particular
normal by its usage index.
Search WWH ::




Custom Search