Archived

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

When to use vertex buffers in dx9?

This topic is 5403 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

So that is the question. Im use a vertex buffer for a skybox, but would eventually somehow utilize it for my terrain as well. My terrain is drawn by going thru a tree, each node/leaf having a set of vertices to draw (average of about 12 vertices). Should I have a vertex buffer for EACH node in the tree, or should I place all drawable nodes into one large vertex buffer??

Share this post


Link to post
Share on other sites
thanks.
could this speed things up significantly?
because right now im running my demo in windowed mode...and when im drawing terrain i notice "artifacts".
basically it looks like im using 1 surface, the primary surface rather than double buffering.

btw, i started my game demo off by using Dx9''s CreateD3DDevice sample source code...and the basic setup of dx9 hasnt changed a whole lot from it.
thanks.

Share this post


Link to post
Share on other sites
quote:
My terrain is drawn by going thru a tree, each node/leaf having a set of vertices to draw (average of about 12 vertices).



Did you read the part of the DirectX documentation where it says that EVERY call to DrawPrimitive/DrawIndexedPrimitive should submit hundreds (today it says thousands) of vertices, not just a dozen?

I would say you overload the command queue :-) In my own terrain experiments, the patches had 65x65 vertices for 64x64x2 triangles - for every call.

Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsoft MVP C#/.NET)

Share this post


Link to post
Share on other sites