Platform SDK: DirectX |
Vertex buffers, represented by the IDirect3DVertexBuffer7 interface, are simply memory buffers that contain vertex data. Vertex buffers can contain any vertex type—transformed or untransformed, lit or unlit—that can be rendered through the use of the vertex buffer rendering methods in the IDirect3DDevice7 interface. You can process the vertices in a vertex buffer to perform operations such as transformation, lighting, or generating clipping flags. (Transformation is always performed.)
Vertex buffers, represented by the Direct3DVertexBuffer7 class, are simply memory buffers that contain vertex data. Vertex buffers can contain any vertex type—transformed or untransformed, lit or unlit—that can be rendered through the use of the vertex buffer rendering methods in the Direct3DDevice7 class. You can process the vertices in a vertex buffer to perform operations such as transformation, lighting, or generating clipping flags. (Transformation is always performed.)
The flexibility of vertex buffers make them ideal staging points for reusing transformed geometry. You could create a single vertex buffer, transform, light, and clip the vertices in it, and render the model in the scene as many times as you need without re-transforming it, even with interleaved render state changes. This can be very useful when rendering models that use multiple textures: the geometry is only transformed once, and then portions of it can be rendered as needed, interleaved with the required texture changes. Render state changes made after vertices are processed take effect the next time the vertices are processed. For more information, see Processing Vertices.
You can optimize geometry in vertex buffers to get maximum performance for vertex operations and rendering. See Optimizing a Vertex Buffer for details.
Note Internally, vertex buffers use DirectDrawSurface objects for their memory management services. As a result, the semantics for accessing vertex buffer memory are similar to those of DirectDrawSurface objects. In fact, the IDirect3DVertexBuffer7::Lock method accepts the same flags as the IDirectDrawSurface7::Lock method. For more information, see Accessing the Contents of a Vertex Buffer.
Note Internally, vertex buffers use DirectDrawSurface objects for their memory management services. As a result, the semantics for accessing vertex buffer memory are similar to those of DirectDrawSurface objects. In fact, the Direct3DVertexBuffer7.Lock method accepts the same flags as the DirectDrawSurface7.Lock method. For more information, see Accessing the Contents of a Vertex Buffer.