Ehm,<br><br>Some thoughts:<br>- A stencil buffer implemented in software could be faster than just blitting. I've never thought of that, but instead of writing 32 pixels, you test 32bits in a mask, wich does not require any memory access at all (theoretically; if the mask is in a register).<br>- Of course this testing takes time, so at zero overdraw, this algorithm is obviously slower than a simple blit.<br>- Each implementation of the stencil buffer algorithm has it's own more or less exact percentage of overdraw at wich it is faster to use than plain blitting. Authors should calculate this figure and publish it with the source code.

<br>- The c-buffer can't handle alpha blending. Alpha stuff is fundamentally bad for c-buffers, since it REQUIRES overdraw. You could theoretically draw alpha spans without filling the c-buffer, though. That means however that subsequent spans that get behind the alpha spans should be mixed AT THAT STAGE. So while you don't fill the c-buffer, you still have to keep track of the fact that there is an alpha-span there. That's not funny anymore.

<br>- The performance of a c-buffer algorithm could be expressed in 'minimal efficient spanlength'. When you insert two 240 pixel span per scanline, ANY implementation of the c-buffer algo is faster than plain blitting. However, imagine an asm implementation of a c-buffer algo using trees instead of linked lists and a non-recursive insertion function (mine is still recursive). Given the simplicity of the actually executed code (the insertion function is huge, but the path is quickly narrowed down), a very good implementation could already be efficient at an average span length of 4 or 5 pixels. This would mean that almsot ANY situation would benefit from using it.<br>- Final thought: In the above optimal algo there would be a huge performance difference between an optimzied 'scene' and a scene that peforms OK just because the c-buffer code is so mighty efficient.

While high-speed is good, huge fluctuations in speed are NOT good.<br><br>- Jacco.