Jump to content
  • Advertisement

Archived

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

3DXD

Extremely Simple Question(I hope) about Triangle List/List Triangle Strip

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

Hello Folks, again thanks so much for all the help you have given me. I am trying to optimize my dungeon area. I have done a decent job so far and have come to another step. Etnu was nice enough to help point me to the primitive type I needed to use but I have a question. Right now, I have, lets say 100 Quads, all are the same size, but they have a random texture assigned. I suggested that I would send a list of quads to the DrawPrimitive command that shared the same texture. However, since these were not in order(touching necessarily), I can''t use a TriangleStrip. I was told I could use a Triangle List. Now here is where my questions come in. Right now I only generate 4 Vertices and use a Triangle Strip. Currently I intentionally use only one texture so that I "could" send them all at once. However my rendering engine renders them one at a time(the quads) just in case they have different textures. So if I turn them into Triangle Lists then I have to add two more vertices. Will that poorly affect performance etc compared to what I am doing now? I have 8 different textures it can be so there will be 8 different vertex buffers(which share their common texture). I just didn''t want to change my code to add new vertices and extra work, if it was a bad idea to group them and display them in groups of 8 Drawprimitives, compared to just rendering the 800 walls 1 at a time. silly question maybe but I had to ask Thanks!!

Share this post


Link to post
Share on other sites
Advertisement
It will effect performance, but it''s a relatively small cost, unless you start rendering several hundred thousand vertices.

If that''s the case, you''ll probably need to draw indexed primitives, like so:


Quad:
+----+
| |
| |
| |
| |
+----+

Vertices:
1 = Top Left
2 = Top Right
3 = Bottom Left
4 = Bottom Right

Indices:
1 = 1
2 = 2
3 = 3
4 = 2
5 = 3
6 = 4

indexed quad:
+----+
| /|
| / |
| / |
|/ |
+----+
(sorry about the scaling, my ascii art skills aren''t nearly as uber as some).

Share this post


Link to post
Share on other sites
ahh cool, ok so still use the triangle list, but using it with indexed vertices... Cool I was thinking that, but I just didn''t want to start making loads of changes without getting some advice first.

Thanks again so much Etnu :-0)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!