triangle strips with index buffer

Started by
4 comments, last by steg 20 years, 11 months ago
Hi all, Is it possible to render a quad (2 tri''s) using triangle strips and index buffers ? I guess this would be the fastest primitive ? Kind regards, Steve As I get older, my mind becomes more cluttered.

If it isn't working, take a bath, have a think and try again...

Advertisement
It is possible, yes. Of course you should bear the following in mind:

What is ''slow'' on today''s hardware, are SetRenderState calls, setWorldMatrix and DrawPrimitive calls. Making ten calls of DrawPrimitive with a few polys each is much slower than one call with many polys, I mean.

''The fastest way to draw this primitive'', well, take that with a grain of salt. The mere call to drawprimitive will so much outweigh any changes you get from using an index list of two triangles or a fan of two tris or whatnot that you won''t notice a difference.

In some circumstances, this ''slowness'' of calls to a small batch of two tris is unavoidable: Like a GUI which is usually comprised of a series of quads, each with a different texture. But if you can batch your polys at all, do so!

So I guess my question is: Why do you want the fastest way to draw a quad? What are you trying to achieve?


=^.^= Leaders and teachers should remember: It is best to offer others what they Need, not what they Want.
=^.^= Leaders and teachers should remember: It is best to offer others what they Need, not what they Want.
Thanks,

I am trying to render terrain, done brute force using triangle lists, now doing it with index buffers b4 doing some CLOD on it.
Just wondering how I could use strips with index''s.

Kind regards,
Steve

If it isn't working, take a bath, have a think and try again...

Egads, do -not- render your terrain with drawprimitives holdig just two tris each then. Batch batch and batch! You gotta batch all the polygons that share the same renderstates/texture in a single call! (And that''s fairly easy to do with trianglelists, I believe)

Strips may -seem- faster, but that speed can be imitated (and even beaten) by triangle lists in most cases.

Things to know:
1-Batch all the polys that share the same renderstates/textures into a single DrawPrimitive call. I can''t say it often enough.
2-There is a ''vertex cache'' on most modern video cards. About 10-20 vertexes are kept (LRU method) in a small ultrafast buffer. But this buffer is only used for indexed trianglelists according to NVidia.

Now, you''d want to make splits in the middle of trianglestrips when you start LODing?!? that''s going to make your strip management rather hellish, won''t it?

On the other hand, a triangle list seems to me much simpler to manage with splits and LOD alterations...

You -can- make a triangle list faster than a strip: just make sure you have a big number of polys per drawprimitive call, and try to reuse the same vertex indexes as early as possible inside the same drawprimitive call. (Drawing the ground in a ''wiggly'' pattern rather than a straight line, for example)
=^.^= Leaders and teachers should remember: It is best to offer others what they Need, not what they Want.
Thanks,

I know were you are coming from, think I will stick with lists. As for CLOD, thinking of using patches (geomipmapping) is this a good method ?

Kind regards,
Steve

If it isn't working, take a bath, have a think and try again...

DRAWING triangle strips is not faster than drawing triangle lists.
Please AGREE or I will LIBERATE you

This topic is closed to new replies.

Advertisement