how many vertices??

Started by
2 comments, last by alnite 20 years, 10 months ago
One of the DrawIndexedPrimitive() parameters is number of vertices. I use triangle list and index buffer to draw my quads, thus the number of vertices for a quad is reduced from 6 to 4. But, if I put 4n (where n is the total number of quads to draw) for NumVertices in DrawIndexedPrimitive() call, the number of quads I get is n-1 (if I have 50 quads, I only see 49 quads). If I put 6n, I see all of them. But, each quad has only 4 vertices, why should I put 6 vertices for each quad?? I'm somewhat confused here... [edited by - alnite on June 17, 2003 4:40:15 PM]
Advertisement
I did not understand your question fully, but the number of tris to draw should be equal to NumVertices-2(if u draw tristrips), because when you draw a new triangle u reuse two of the previously drawn vertices. Is that what u were asking for?
the first time u draw a quad u need 4 vertices, but using 4n to draw quads is bad if u use tristrips, because after the first quad u only need 2 vertices to draw the second.
4 verts -> 1 quad
4+2 verts-> 2 quads
4+2+2 verts->3 quads

is it okay?
ultim, he''s already indicated that he''s using a tri list, not a strip.

alnite, the number of vertices parm is an indicator of how many verts need to be <i>indexed</i>. for a tri list that means 3 verts per triangle, whether they''re verts that are shared or not. what the index buffer does is save the cost of re-processing those verts which have already been processed due to a prior indexing as the vertex stream is processed, since these post-processed verts can be cached. is that the most uses of processed in a sentence or what?!

This topic is closed to new replies.

Advertisement