I FINALLY FOUND IT! Remember those streaks in Twilight Zone and Airborne only a couple of us were seeing that would come and go? I found another table that more reliably reproduced that problem - StarGate. I isolated it to the wire ramp objects. If I hid those, the errant polygons went away. If I changed them to flat ramps, the polygons also went away.
In Ramp.cpp, there's some strange code in prepareHabitrail that sets the wire ramps up. I don't fully understand how it's supposed to work, but if I initialize the vertex buffer:
staticVertexBuffer->lock(0,0,(void**)&buf, VertexBuffer::WRITEONLY);
memset(buf, 0,numVertices*sizeof(Vertex3D_NoTex));
The garbage all goes away. Of course, this means there's probably a bug in the code that also needs fixing, but at least this gets rid of the unpredictable behavior.
I suspect the bug is here:
if (i != 0)
{
memcpy( &buf[offset], rgv3D, sizeof(Vertex3D_NoTex)*32);
offset+=32;
}
The loop runs for "rampVertex" times, and the buffer is built for rampVertex*32 vertices, but this "i!=0" condition causes it to add (rampVertex-1)*32 vertices to the buffer, leaving the final 32 uninitialized.
Edited by DJRobX, 13 March 2014 - 05:26 AM.