posted November 15, 1999 06:40 AM
Seumass, a few months ago you mentioned in a forum post that you don't use a priority queue, just split triangles down to a predefined error threshold, count them, compare to the target triangle count, then for the next frame try to correct the error threshold. Can you elaborate more on the formula? Of course, that depends on your particular error metrics...
I tried to do it like this:
fTriAdjust = nTrisLastFrame / nTargetTris;
if( fTriAdjust < 0.9 | | fTriAdjust > 1.1 )
fErrorThr *= CLAMP(fTriAdjust, 0.8, 1.4);
fErrorThr = CLAMP(fErrorThr, TOO_SMALL, TOO_LARGE);
The clams are needed to avoid too steep a increase in the triangle count, which causes a hiccup in the framerate.
The count eventually converges, but I get too many flipflopping triangles, especially with tri counts below 2000. I have spend too much time tweaking the constants above, and I can't get it to work the way I like.
One more thing: since you don't need a priority queue, you probably just keep the triangles to be split in a list. Do you access it FIFO or LIFO? Which has better locality of reference? There are good points for both approaches...