• Advertisement

Archived

This topic is now archived and is closed to further replies.

Whats the use of Vertex Buffer.

This topic is 6555 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The vertex buffer stores the vertex data. ... ... Is that it? Why would directx need a entirely new interface for storing vertecies? (erm what is the plural from of vertex?)

Share this post


Link to post
Share on other sites
Advertisement
Yes the vertex buffer is used to store vertices. The vertex buffer lets triangles share vertices without the need for triangle fans or strips. This can greatly enhance the speed of your application when rendering lots of triangles as the vertices are only transformed and lit once.

The new interface is needed because it lets directX assign more properties to the vertices that are invisible to the developer. One such attribute is the clip flag, that tells if the vertex is clipped or not. The interface can also speed up the rendering as DrawIndexedPrimitive() can safely return before the call is finished rendering without DirectX having to worry about the developer changing the properties of the vertices as it is reading them.

(Short answer: they are good, they are fast, use them )

Share this post


Link to post
Share on other sites
Vertex buffers have two uses:

Cache for static vertex information.

High speed vertex stream.


For static data, you can have a vertex buffer, Optimize() it to rearrange it for better performance, specific to the card/processor, and place it in the best memory location for highest performance. As an example, on a HW TnL device, you can place the untransformed vertex buffer in video memory. This way, the vertex data won''t have to be repeatedly sent over the bus.

Alternatively, you can use it for dynamic data, and smartly use the DISCARDCONTENTS and NOOVERWRITE flags in Lock() to stream the vertex data quickly to the card.

Share this post


Link to post
Share on other sites

  • Advertisement