Speed delta between Strips and Triangles

Started by
6 comments, last by MARS_999 17 years, 6 months ago
Well I don't know what to say but in my terrain rendering I been using strips, and decided to give triangles a shot and see really no difference in speed at best may be 1-3fps. Yes I am using VBO's and a IBO. I have 6 indices per quad for my triangle list and with strip I do have degenerate triangles. This is on a 7800GT... AFAIK if I am fillrate limited then this will not show any speed ups?
Advertisement
Since you're already storing your vertex data on the video card, there's no real speedup to be obtained through vertex strips. It'd be different if the vertices weren't indexed, and were being dynamically generated. What you should REALLY worry about is ordering your vertices in a cache-friendly way.
Just for everyones FYI I removed my bottleneck that causes my fillrate to go up and still no delta between the two methods. What order do you recommend then Sneftel? Thanks
EDIT: nevermind, I misread. Well, check this out. Though it might be tricky to apply to terrains; I don't have much experience with that.
Cache priming is quite useful for terrain optimization.
SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
To Promit, I am assuming this is more aimed at strips and not lists? Due to you were talking about strips with your posting.

What kind of speed up could one expect to see if the indices were cache friendly?

BTW I am using a patching system with 17x17 patch sizes...
Think of it this way:

If you have a 17x17 block of vertices to render a 16x16x2 block of triangles:

With an ideal strip, you get one triangle per transformed vertex, plus two vertices per row of triangles. That makes for 16x16x2+16x2 transformed verts to render the block.

With an ideally sorted vertex cache optimized list, you can get much better than one triangle per transformed vert, because some triangles use all three vertices out of the post-transform cache. Thus, you only need to transform 17x17 vertices.

Thus, a triangle list, with an ideal vertex cache, is faster than a triangle strip. However, you could sort the strip, too, and get pretty much the same performance between the two.

I would just go with lists and not worry about it.
enum Bool { True, False, FileNotFound };
This is the code I am using to create the list

			for(z = startz; z < endz-1; ++z)			{				for(x = startx; x < endx-1; ++x)				{					triBuff[currentIndex++] = x + (z * mapData.map_X);					triBuff[currentIndex++] = x + ((z + 1) * mapData.map_X);					triBuff[currentIndex++] = x + 1 + (z * mapData.map_X);					triBuff[currentIndex++] = x + 1 + (z * mapData.map_X);					triBuff[currentIndex++] = x + ((z + 1) * mapData.map_X);					triBuff[currentIndex++] = x + 1 + ((z + 1) * mapData.map_X);				}			}

This topic is closed to new replies.

Advertisement