Jump to content
  • Advertisement

Archived

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

steg

DrawPrimitive or DrawIndexedPrimitive?

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

Hi, DrawPrimitive or DrawIndexedPrimitive, what are the advantages, disadvantages? I guess rendering with DrawIndexedPrimitive would be quicker doing the vertex processing? Your thoughts are most welcome, Steve You can achieve anything if you want it badly enough.

Share this post


Link to post
Share on other sites
Advertisement
Hmm .. this is probably a hard one to answer.

There are cases where either one will out perform the other.
Your best bet is to decide on how you want to store
your model information first.

The biggest performance increase from the two calls is
organising your vertex information to be in triangle
strips/fans - literally you get a single triangle
per vertex this way (after the first). In models for
veichles/characters etc - organising the information into
tri strips and passing through DrawPrimitive would
probably be a good idea.

With stuff where you can do major vertex re-use i.e. landscapes
using DrawIndexedPrimitive would probably be better - especially
if you can keep the vertex cache misses low. This is done by
organising your index list to perform as few vertex changes
per triangle as possible.

Overall the use of either call should give very similar
results.... maybe some benchmarking might be in order
for this ....

--
Code..reboot..code..reboot..sigh!

Share this post


Link to post
Share on other sites
Thanks,
The reason I asked was that I have seen some examples that use these methods in the same kind of scenario, for example, drawing a cube.

Cheers for your reply,
Steve


You can achieve anything if you want it badly enough.

Share this post


Link to post
Share on other sites
If you have models which have the same indices but different vertices (ie the links between triangles are the same, but the models may have vertices in different positions) you can use the same index buffer. Indexed primitives are faster to light than nonindexed ones, and they are faster to transform.



Please state the nature of the debugging emergency.


sharewaregames.20m.com

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!