Jump to content
  • Advertisement
Sign in to follow this  
AnthonyB

Index buffers

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

If you're using vertex data that never needs to be drawn more than once per frame, does an index buffer provide any benefit? As I understand it, the vertices can be cached, but if they're never being re-used, I'm not sure if that cache is beneficial in any way. If you're wondering why nothing would ever be re-used, it's for a 2D-only project. I didn't want to have to make a SetTransform and DrawPrimitive call for every single drawn rectangle. I don't anticipate many groupings of them to be used (as in small groups of rectangles to form a larger image), so that's why it's designed this way. This may not be ideal though, and I'm certainly open to discussion/suggestions.

Share this post


Link to post
Share on other sites
Advertisement
You only need index buffers if you can lower the mesh data sent to the GPU using it and if you need vertex caching. Vertex caching, however, is not there for multiple reuse of geometry data, you have instancing for that.

2D project needs a bunch of quads. With today's GPUs I think it's just easier to use a VB with tri lists. I wouldn't try anything more complex unless I knew it was the bottleneck.

Share this post


Link to post
Share on other sites
I made some benchmarks with HD3870 by Sapphire.
It results that index buffer saves preformance every time. The only reason to not use it it's a single triangle drawing.

Share this post


Link to post
Share on other sites
Quote:
Original post by darkelf2k5
Vertex caching, however, is not there for multiple reuse of geometry data, you have instancing for that.

If it's not there to speed up re-use of vertices, what purpose DOES it serve?


Quote:
Original post by XVincentX
It results that index buffer saves preformance every time. The only reason to not use it it's a single triangle drawing.

I was hoping this wouldn't be the case, but I had a feeling it was.


Thanks for the input from both of you.

Share this post


Link to post
Share on other sites
Quote:
Original post by XVincentX
I made some benchmarks with HD3870 by Sapphire.
It results that index buffer saves preformance every time. The only reason to not use it it's a single triangle drawing.


I'd be interested in the code for this test. Is it super simplified with nothing else going on? I'd like to see what happens on some more GPUs. I have 5 to test here if you can provide the test.


Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!