Jump to content
  • Advertisement

Archived

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

alnite

how many vertices??

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

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]

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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?!

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!