To use vertex buffers or no to use (DirectX8)?

Started by
0 comments, last by Commando 23 years, 2 months ago
Every DX8 document I''ve read says that I should always use vertex buffers - because they''re efficient & fast. What about in the following situation? I have an engine and I have to draw some lines every frame. Since I''m using d3d lighting I had to create another custom vertex format for the lines (lit & non-transformed). And because I have a different vertex format, I had to create another vertex buffer for the lines. The another VB has 6 vertices in it. And when I''m rendering the lines, I have to change the vertex buffer (setstreamsource) and also the vertexshader. Then I render the lines and swich back the VB and vertexshader. Isn''t this a bit silly for 3 lines (with 6 vertices)? Wouldn''t it be faster to to render the lines with drawprimitiveup and having no vertexbuffer for the lines? I think it takes more time to change the vertex buffer than to render the lines. So, if I shold use drawprimitiveup instead, what kind of memory structure it needs (is it the same kind of like vertex buffers have)? Commando Commando''s Base
CommandoCommando's Base
Advertisement
Yeah, its worth it, because if you don''t use vertex buffers, directx will go and do it behind your back so to speak, and it will be more efficient (and more within your control to optimize and debug) if you do it yourself. So remember, if you don''t use a vertex buffer, you''re still using one, but not as efficiently, and not as "intelligently"..

HTH...

This topic is closed to new replies.

Advertisement