DirectX SDK

Manually Transforming Vertices

You can use three different kinds of vertices in your Direct3D application. Read Vertex Formats for more details on the vertex formats:

[C++]
Untransformed, unlit vertices
Vertices that your application doesn't light or transform. C++ applications that neither transform nor light vertices before rendering a scene can use D3DVERTEX vertices (or an equivalent flexible vertex format). Although you specify lighting parameters and transformation matrices, Direct3D does the math.
Untransformed, lit vertices
Vertices that your application lights but does not transform. C++ applications that use customized lighting effects might use D3DLVERTEX vertices (or an equivalent flexible vertex format).
Transformed, lit, vertices
Vertices that your application both lights and transforms. C++ applications that transform and light vertices on their own might use D3DTLVERTEX vertices (or an equivalent flexible vertex format). These vertices skip the transformations in the geometry pipeline altogether but they can be clipped by the system if needed. If your application clips vertices itself, you can get the best performance by specifying the D3DDP_DONOTCLIP flag when calling a rendering method. If you want Direct3D to clip vertices, omit the D3DDP_DONOTCLIP flag. Note that if you request Direct3D clipping on transformed and lit vertices, the system back-transforms them to camera space for clipping, then transforms them back to screen space, incurring processing overhead.

In DirectX 7.0, you can change from simple to complex vertex types by using vertex buffers. (In previous releases of DirectX, applications could call the TransformVertices method of the legacy IDirect3DViewport3 interface. With the advent of vertex buffers in DirectX 6.0 and the abandonment of discrete viewport objects in DirectX 7.0, this method became obsolete.) Vertex buffers are objects used to efficiently contain and process batches of vertices for rapid rendering, and are optimized to exploit processor-specific features. Vertex buffers offer the IDirect3DVertexBuffer7::ProcessVertices and IDirect3DVertexBuffer7::ProcessVerticesStrided methods to perform vertex transformations for you; this is usually much faster than the TransformVertices method. The ProcessVertices family of methods method accepts only untransformed vertices, and can optionally light and clip vertices as well. Lighting is performed at the time you call the ProcessVertices methods, but clipping is actually performed at render time.

After processing the vertices, you can use special rendering methods to render the vertices, or you can access them directly by locking the vertex buffer memory. For more information about using vertex buffers, see Vertex Buffers.

[Visual Basic]
Untransformed, unlit vertices
Vertices that your application doesn't light or transform. Visual Basic applications that neither transform nor light vertices before rendering a scene can use D3DVERTEX vertices (or an equivalent flexible vertex format). Although you specify lighting parameters and transformation matrices, Direct3D does the math.
Untransformed, lit vertices
Vertices that your application lights but does not transform. Visual Basic applications that use customized lighting effects might use D3DLVERTEX vertices (or an equivalent flexible vertex format).
Transformed, lit, vertices
Vertices that your application both lights and transforms. Visual Basic applications that transform and light vertices on their own might use D3DTLVERTEX vertices (or an equivalent flexible vertex format). These vertices skip the transformations in the geometry pipeline altogether but they can be clipped by the system if needed. If your application clips vertices itself, you can get the best performance by specifying the D3DDP_DONOTCLIP flag when calling a rendering method. If you want Direct3D to clip vertices, omit the D3DDP_DONOTCLIP flag. Note that if you request Direct3D clipping on transformed and lit vertices, the system back-transforms them to camera space for clipping, then transforms them back to screen space, incurring processing overhead.

You can change from simple to complex vertex types by using vertex buffers. Vertex buffers are objects used to efficiently contain and process batches of vertices for rapid rendering, and are optimized to exploit processor-specific features. Vertex buffers offer the Direct3DVertexBuffer7.ProcessVertices method to perform vertex transformations for you; this is usually much faster than the TransformVertices method. The ProcessVertices method accepts only untransformed vertices, and can optionally light and clip vertices as well. Lighting is performed at the time you call ProcessVertices, but clipping is actually performed at render time.

After processing the vertices, you can use special rendering methods to render the vertices, or you can access them directly by locking the vertex buffer memory. For more information about using vertex buffers, see Vertex Buffers.