Now, m_pusIArray is a valid pointer of 53 unsigned short indices making up a triangle list, m_uiICount is 159.
Can anyone help me get round this problem?
Err, I’ve just printed out the contents of that array of indices that I’m passing to the tri-stripper, and it has revealed some odd triangles, so maybe the tri-stripper has done me a favour…check out these triangles:-
…
40,41,42
43,29,44
45,46,47
34,34,36 //JESUS! How did that get in there?!
36,34,36 // ditto!
36,36,38 // ditto!
38,36,38 // ditto!
…
I’m getting these indices from a model exported in VRML97 from 3dsMax4. Looks like some weird ones are being created by the exporter…
Could this be the cause of the ASSERT?
Wow! Got it working - and it has drastically improved the performance of my renderer.
I strip out any of triangle that has duplicate vertices for corners before I send it to the tri-stripper.
Found what I think is a true bug in it though - it seems to be (every so often) giving me indices that are outside the vertex range - well, when I say outside, I mean that its giving me the occasional max value for an unsigned short (65536 or whatever it is). The indices I provide it with do not have such large values, so it must be a bug.
I have to do a pass over the index arrays it gives me, stripping out any triangles that index outside the vertex range - which solves the problem, and doesn’t seem to affect the final image at all…weird.
Is anyone at NVidia maintaining the tri-stripper? It’s a lovely piece of code, but with a few quirks - not bad for free, though!
Right, another question…probably answer it myself, the way things are looking (has ANYONE used the NvTriStrip lib at all? )
I want to take advantage of the RemapIndices() function in the library, where it’s supposed to reorder the indices so that they’re more cache friendly.
I’m a bit puzzled as to how I remap my vertices after the function call…do I build a new vertex/normal/texcoord array in the following way? :-
for (grp=0; grp<numGrps; grp++)
{
for (i=0; i<newPrimGroup[grp].numIndices; i++)
{
float* vertex = &oldvertexarray[oldPrimGroup[grp].indices[i]*3];
Another question:-
Am I right in thinking that if you ever disable GL_VERTEX_ARRAY_RANGE_NV in your render loop, you lose a massive amount of performance?
It seems that way to me…
What kind of performance improvement are you getting with it?
I’m programming my own stripper, and with the latest version I get twice the fps (31fps -> 64fps).
I use a 60,000 polygons model for those tests, the high polygons version of the 3D skull in Lightwave (6.0 or higher).
It’s hard to give you figures - the scene I’m running the stripper on consists of many seperate objects, some quite small…total triangles before stripping is about 120,000. After stripping, this number goes up considerably, to about 250,000, but most of them are probably degenerate triangles…I’ve got huge groups of trees, which are part of the same primitive group, but are discreet triangles…then after stripping they are turned into one tri-strip linked together by degenerate triangles.
I’m getting about double the frame rate after tri-stripping.