Jump to content
  • Advertisement

Archived

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

fallex

IB vs VB

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

Tell me plz, rendering using Index Buffer is very bad or not? Rendering using simple VB more faster than using IB or not? How does it influence to FPS?

Share this post


Link to post
Share on other sites
Advertisement
Index buffers allow you to reuse vertices. Assuming you don''t completely screw the pooch when it comes to generating the buffers, index buffers should be a minimum of 33% faster, since you (should be) using a minimum of 33% fewer vertices (assuming your basic data is in a "quad" form, going from 6 vertices to 4).

Share this post


Link to post
Share on other sites
So index buffer is good?
I''m working on terrain engine, which support huge height-maps with LODs. And i don''t know what is better - every time LOD changing to rewrite VB or IB. I''ve heard, that DrawIndexedPrimitive is more slower then DrawPrimitive. Is it real?

Share this post


Link to post
Share on other sites
There is no single truth for this. It all comes down to implementation and because of that you will have to profile different solutions and use what performs the best. Otherwise the card manufacturers and DirectX would only offer one solution.

Share this post


Link to post
Share on other sites
Whomever you "heard" that from is wrong.

DrawPrimitive() and DrawIndexedPrimitive() have the same draw time per triangle (rasterization), but DrawIndexedPrimitive() is faster due to the fact that you transform far, far fewer vertices to get the same results.

Rewriting an index buffer is definitely preferrable to rewriting a vertex buffer. Consider this:

For every vertex you write to the buffer, you have to send 32 bytes (assuming your vertex is made up of 8 floats).

For every index you write to the buffer, you send either 2 (using 16-bit indices) or 4 (using 32 bit indices) bytes.

There are usually 33% more indices than vertices.

For a vb that has 1MB (32768 vertices)in it, you''d need to send 1MB over the bus every frame.

For an IB, assuming you have 6 indices for every 4 vertices in the inital buffer, you''d need to send only to send 49152 indices - at 2 bytes each, that''s 98,304 bytes (96k).

Bus bandwidth is the single largest limiting factor in graphics today. Transforms are fast; fillrates are high. That issue may be reduced with faster busses, but even PCI express doesn''t look to fully eliminate the problem any time within the next 3-4 years.

It''s not just transfer that you gain in transferring though, either. You also do fewer transforms - not so much of an issue in a simple world->screen space transformation, but it can become quite cumbersome if you were to use, say, a complex vertex shader.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!