IB vs VB

Started by
4 comments, last by fallex 19 years, 10 months ago
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?
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).

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

also index buffers have a higher periority.use them whenever possible.
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?
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.
No no no no! :)
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.

---------------------------Hello, and Welcome to some arbitrary temporal location in the space-time continuum.

This topic is closed to new replies.

Advertisement