What the diffrerences between list and strip(specific to primitiveTopology) when i using DrawIndexed rather than Draw?(D3D11)

Started by
5 comments, last by 21st Century Moose 10 years ago

In my opinion, list and strip is the same thing when i using index to specify the trangles.

It's different just in the call Draw().

And i think the list and strip.etc. are kinds of hiding index just for draw some simple two-dimention figures.

If my opinion is totally mistaken, please explain the differences between them when i already have the index data and tell me when to use list or strip?

Hope U understand what i am taking about.(my suck english...)tongue.png

Advertisement

The difference is in how it interprets the specified index buffer, in the case of list it will read 3 verts each time and create a triangle with them these don't have to be connected to each other. In the case of a strip the triangle are connected to each other, and such will after reading the initial three discard the first one and read the next index in the Index buffer.

So in a list a square with 4 verts would need 6 indices to be able to be rendered properly by drawIndexed and would look like 123341 in the case of a triangle strip you only have to provide 4 indexes in the form of 1234.

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

You are correct that both forms have a buffer of vertices and a buffer of indices, and the indices specify 3 vertices per face. But that's where the similarity ends.

I don't know about D3D11 in particular, but a trianglestrip can be more efficient in the pipeline because two of the vertices for each triangle have already entered the pipeline.

A trianglestrip also requires that the same vertex (position, normal, texcoords, etc.) be used for adjacent triangles. In some cases, for instance - a cube with adjacent faces which are at right angles, a trianglelist provides for rendering two vertices at the same position, but with normals at right angles, and with different texture coordinates applied to adjacent faces.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Tks?man.By the way,I am wonder that if i extract data from obj file,what kinda primitive type i should deliver to IA stage?(tri-list or tri-strip)/*YOU CAN assume that i use the 3DMAX*/.unsure.png

Tks?man.By the way,I am wonder that if i extract data from obj file,what kinda primitive type i should deliver to IA stage?(tri-list or tri-strip)/*YOU CAN assume that i use the 3DMAX*/.unsure.png

I'm not familiar with obj file specs or 3DMAX. However, to use a triangle strip, rather than a triangle list, you'll have to analyze the incoming data to ensure it can be used as a trianglestrip. If you're going to be importing obj data, you'll need to review the file specs in any case.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

If you read an obj file (and as far as I know, any other file format) you should use list instead of strip. The obj file stores a list of vertex coordinates and then a list of faces. You should read each line that represents a face and send the vertex indices for that face to be drawn.

A list is more general so you can draw anything, you'll probably use other drawing methods if you know exactly what you're drawing (if you want a rectangle use strip, if you want to make an hexagon it's easier with a triangle fan, etc).

You are correct that both forms have a buffer of vertices and a buffer of indices, and the indices specify 3 vertices per face. But that's where the similarity ends.

I don't know about D3D11 in particular, but a trianglestrip can be more efficient in the pipeline because two of the vertices for each triangle have already entered the pipeline.

Almost, but not quite. In both cases, and via DrawIndexed, the index buffer is actually being used to control the vertex cache, so a list can also skip transforms for potentially 0, 1, 2 or even all 3 of the vertices in a triangle (a strip can only ever skip 2).

A strip can save index bandwidth because it just needs one additional index to fully specify a new triangle. A list is more flexible and potentially has better vertex reuse, but needs 3 indices to fully specify each triangle. Pick whichever best suits your source data.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

This topic is closed to new replies.

Advertisement