Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Have i understood index-buffers?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 KurtO   Members   -  Reputation: 230

Like
0Likes
Like

Posted 21 September 2012 - 01:36 AM

I have a question about index-buffers.

Is this correct?

1, Indexbuffers are used so that you can draw portions of the vertex-buffers instead of every vertex of the total vertex-buffer
2, if you need to update your vertex-buffers all the time, you dont need index-buffer (since everything is redrawn)
3, if you have a static house rendered with vertex-buffer, use index-buffer to draw all the buffers except the house on every frame

I normaly create a vertex-buffer for each of my geometry and then on frame_render i ->unmap copy ->map
i don+t use index-buffers.

is this the correct way to do it?

have i understood index-buffers correct?

Sponsor:

#2 CryZe   Members   -  Reputation: 768

Like
0Likes
Like

Posted 21 September 2012 - 02:11 AM

Index buffers are used to reduce the size of a vertex buffer. Vertices might be part of multiple adjacent triangles. You can either use triangle strips or triangle fans if you want to be able to use them for multiple triangles. But sometimes it's hard if not impossible to construct a model out of triangle strips or triangle fans. That's when you use a vertex list instead and use an index buffer to tell the graphics card which vertices form a triangle. This way it's easy to use vertices for multiple triangles. Also only the indices in the index buffer are redundant and not the vertices which require in most cases more memory than the indices.

But you might also use them to render only portions of a vertex buffer, as you said. You could also use the parameters IndexCount, StartIndexLocation and BaseVertexLocation of the DrawIndexed method to specify which parts of the index buffer and vertex buffer to render.

Edited by CryZe, 21 September 2012 - 02:17 AM.


#3 Ashaman73   Crossbones+   -  Reputation: 7987

Like
1Likes
Like

Posted 21 September 2012 - 02:28 AM

Index buffers are used to reduce the size of a vertex buffer.

Additional to that, a indexbuffer, more general indexed vertices, helps performance, because already transformed vertices are cached and follow up vertex transforms which targets the same index don't need to execute the vertex shader again, if it already exists in the cache.

#4 CryZe   Members   -  Reputation: 768

Like
0Likes
Like

Posted 21 September 2012 - 02:35 AM

That's a good point :)
rep++

#5 mhagain   Crossbones+   -  Reputation: 8270

Like
0Likes
Like

Posted 21 September 2012 - 03:30 AM

You can also use an index buffer to stitch together multiple strips or fans (or a model consisting of both strips and fans) without needing to use degenerate triangles.

It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#6 KurtO   Members   -  Reputation: 230

Like
0Likes
Like

Posted 21 September 2012 - 04:43 AM

Hm. it looks like i have to laborate some to get full understanding. But this line makes me understand a bit:Index buffers are used to reduce the size of a vertex buffer

it is optimization that cut off the overhead that vertexbuffers have.


By the way, i noticed last night that DX11 can render pointlist with just one pixel, didnt get this to work with DX9. How cool is this!!! i am going to create particles effect the whole weekend! and this without using any sprites textures!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS