DrawPrimitive() DrawIndexedPrimitive()
DrawPrimitive() or DrawIndexedPrimitive(), which is faster? why? and by how much?
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
Ok, I''ll bite...
I would use DrawIndexed...() if I had a geometry in a form of a mesh where two side by side polygons shared a vertex. Then I would fill an array of vertices and using an index into this array I would pick the same shared vertex when the processing of the polygons begins. So going this route you save space as you don''t have to generate duplicate vertices. I guess it might be faster than DrawPrimitive since you don''t send as many vertices to the video card if you have hw t&l. In DrawPrimitive() the two side by side polygons would duplicate the shared vertex so you would waste space and it would take longer for the vertices to travel to the card since there are more of them, I guess Also, the more vertices there are the more multiplications with the world, view and projection matrices are done so it does takes longer to process the vertex array.
I would use DrawIndexed...() if I had a geometry in a form of a mesh where two side by side polygons shared a vertex. Then I would fill an array of vertices and using an index into this array I would pick the same shared vertex when the processing of the polygons begins. So going this route you save space as you don''t have to generate duplicate vertices. I guess it might be faster than DrawPrimitive since you don''t send as many vertices to the video card if you have hw t&l. In DrawPrimitive() the two side by side polygons would duplicate the shared vertex so you would waste space and it would take longer for the vertices to travel to the card since there are more of them, I guess Also, the more vertices there are the more multiplications with the world, view and projection matrices are done so it does takes longer to process the vertex array.
Which one is faster.... oooh .. nasty question:
Neither.
Both of them have their pro''s and con''s in their usage.
Generally I think you have to think about how the
vertex data you are sending to the card is ordered
and the primitive types you are sending. If you can
reduce the number of vertex changes that the cards vertex
cache has to apply then you will get a more optimum speed
that if you totally ignored it. Of course you should try
to avoid using triangle lists (3 vertices which change
for each try) in DrawPrimtive, but use them in draw index
primitive with vertex re-use (min 1 vertex change max 3 -
but this can be optimal changes)
--
Code..reboot..code..reboot..sigh!
Neither.
Both of them have their pro''s and con''s in their usage.
Generally I think you have to think about how the
vertex data you are sending to the card is ordered
and the primitive types you are sending. If you can
reduce the number of vertex changes that the cards vertex
cache has to apply then you will get a more optimum speed
that if you totally ignored it. Of course you should try
to avoid using triangle lists (3 vertices which change
for each try) in DrawPrimtive, but use them in draw index
primitive with vertex re-use (min 1 vertex change max 3 -
but this can be optimal changes)
--
Code..reboot..code..reboot..sigh!
MrF.--Code..reboot..code..reboot..sigh!
So if i''m creating a terrain from triangles i shouldn''t draw each triangle separatly right? but how do i know what the indicies are?
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement