As always, WASDQE and arrow keys Play on Turbowarp: https://turbowarp.org/1274328372?fps=60&stuck
Span buffering is a rasterization technique to eliminate overdraw. They can be useful in overdraw-heavy scenes, or if overdraw is particularly costly. This is my implementation I made which uses a binary search tree for each scanline, and up to 360 of them. Considering that I find this a bit slow (TurboWarp and barely 70-80 FPS at res 4 on my computer is still way too slow for my liking), I do not want to know what would happen if I didn't use trees(It'd be even slower). The span conversion is not the most robust, but I think it works enough to demonstrate this technique well. The color gradients indicate individual spans on a scanline. It can be naturally understood that presence of red kind of means its gonna be slower. Gradients past red cause some serious slowdowns. If you have heavy overdraw, i.e. many rooms behind a wall, you can expect no more render spans produced than if those occluded rooms did not exist in the first place at all. This not how Quake went about eliminating overdraw. They used a method often regarded to be more robust. I might share my Quake-style span rasterizer some day later.