I’m considering porting nvidia stripifier to xith3d. It creates number of strips (or one long connected by degenerate triangles) plus number of single triangles not fitting in any of strips.
To render such output correctly (I’m mainly concerned about single long strip + triangle soup case), two draw calls are needed, but they share vertex data. In face, they could be even put into single index list, with just different range of elements to be drawn. With both coord and index data[1] in VBO, this possibly can even share vertex cache between calls ? Even if it is not a case, no rebind is necessary.
My question is how to do it in xith3d. In java3d, Shape3D supported mutliple geometries - so I could just create one IndexedTriangleStripArray and second IndexedTriangleArrray and put them into one shape. In xith3d, currently there is no support for multiple geometries. I wonder if it is really needed - after all, I don’t want to render different coordinates, just two times, using different mode and index list.
One, efficient and simple, but not very elegant way comes to my mind - adding IndexedTriangleStripAndSoupArray. It would be a subclass of IndexedTriangleStripArray, with just extra index list for rendering ‘triangle soup’ after going through all strips. Just this subclass needs to be added - fan are not interesting case.
What do you think about it ? If IndexedTriangleStripAndSoupArray is no-go, what other choice do I have ? Multiple geometries per Shape3D, hoping that they will manage to avoid unneeded VBO spills ?
[1] - currently index data is kept by xith3d in main memory, instead of integer VBO. AFAIK, for indexed geometry, VBOs are not really accelerated until BOTH coordinate data and index list are kept in VBO. This is a sure place for improvement, especially given the fact that index data is going to be static in almost all cases (even for real time skin deformation, only coordinates change).