I read one month ago, a paper from nvidia, which shows with graphically that vertex buffer (sorry in DX ) are drawn faster when there are sorted. So, I sorted my vertex array (in openGL so, I’m not treacherous person), but I loose 1,15 millions of polygone, what an ugly performance, isn’t it? Anybody know why I get a such slowdown? Is it only working with DX?
Here an example of my vertices indexes before and after sorting :
before : 0;17;18;18;1;0;1;18;19;19
after : 0;1;2;2;3;0;3;2;4;4
and so on … of course I change my vertex, normals, texture coordinate array to suit with the new index array, do I use a wrong
You probably got such a slowdown because you spent time you would have been rendering in a sort operation.
I would imagine that sorting only helps through its use of cache memory. If your arrays are separate (as opposed to interleved), they may be stomping on each other’s cache memory.
Anyway, I wouldn’t be too concerned about this in any event. Since you are using OpenGL, not D3D, you should look into other vertex array optimizations first (CVAs, VARs, etc). And sorting will offer no help to VARs, since the memory is uncached anyway.