Flexible Vertex Format Flags
The flexible vertex format (FVF) is used to describe the contents of vertices stored interleaved in a single data stream. A FVF code is generally used to specify data to be processed by fixed function vertex processing.
The following tables show the flags that describe a vertex format. For information regarding vertex formats, see About Vertex Formats.
Flexible vertex format (FVF) flags
Flag | Description |
---|---|
D3DFVF_DIFFUSE | Vertex format includes a diffuse color component. |
D3DFVF_NORMAL | Vertex format includes a vertex normal vector. This flag cannot be used with the D3DFVF_XYZRHW flag. |
D3DFVF_PSIZE | Vertex format specified in point size. This size is expressed in camera space units for vertices that are not transformed and lit, and in device-space units for transformed and lit vertices. |
D3DFVF_SPECULAR | Vertex format includes a specular color component. |
D3DFVF_XYZ | Vertex format includes the position of an untransformed vertex. This flag cannot be used with the D3DFVF_XYZRHW flag. |
D3DFVF_XYZRHW | Vertex format includes the position of a transformed vertex. This flag cannot be used with the D3DFVF_XYZ or D3DFVF_NORMAL flags. |
D3DFVF_XYZB1 through D3DFVF_XYZB5 | Not supported in Windows CE. |
Texture-related FVF flags
Flag | Description |
---|---|
D3DFVF_TEX0 through D3DFVF_TEX8 | Number of texture coordinate sets for this vertex. The actual values for these flags are not sequential. |
D3DFVF_TEXTUREFORMAT1 through D3DFVF_TEXTUREFORMAT4 | Number of values that define a texture coordinate set. The D3DFVF_TEXTUREFORMAT1 indicates one-dimensional texture coordinates, D3DFVF_TEXTUREFORMAT2 indicates two-dimensional texture coordinates, and so on. These flags are rarely used alone; they are used with the D3DFVF_TEXCOORDSIZEn macros. |
Mask values
Flag | Description |
---|---|
D3DFVF_POSITION_MASK | Mask for position bits. |
D3DFVF_RESERVED0 and D3DFVF_RESERVED2 | Mask values for reserved bits in the flexible vertex format. Do not use. |
D3DFVF_TEXCOUNT_MASK | Mask value for texture flag bits. |
Miscellaneous
Flag | Description |
---|---|
D3DFVF_LASTBETA_UBYTE4 | Not supported in Windows CE. |
D3DFVF_TEXCOUNT_SHIFT | Number of bits by which to shift an integer value that identifies the number of a texture coordinates for a vertex. |
The following example shows how the D3DFVF_TEXCOUNT_SHIFT value might be used.
DWORD dwNumTextures = 1; // Vertex has only one set of
// coordinates.
// Shift the value for use when creating an FVF combination.
dwFVF = dwNumTextures<<D3DFVF_TEXCOUNT_SHIFT;
/*
* Now, create an FVF combination using the shifted value.
*/
The following example shows some other common flag combinations.
// Lightweight, untransformed vertex for lit, untextured,
// Gouraud-shaded content.
dwFVF = ( D3DFVF_XYZ | D3DFVF_DIFFUSE );
// Untransformed vertex for unlit, untextured, Gouraud-shaded
// content with diffuse material color specified per vertex.
dwFVF = ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE );
// Untransformed vertex for light-map-based lighting.
dwFVF = ( D3DFVF_XYZ | D3DFVF_TEX2 );
// Transformed vertex for light-map-based lighting
// with shared rhw.
dwFVF = ( D3DFVF_XYZRHW | D3DFVF_TEX2 );
// Heavyweight vertex for unlit, colored content with two
// sets of texture coordinates.
dwFVF = ( D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_DIFFUSE |
D3DFVF_SPECULAR | D3DFVF_TEX2 );
See Also
Direct3D Macros | About Vertex Formats | D3DFVF_TEXCOORDSIZEn
Last updated on Thursday, April 08, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.