Re: State of Linux graphics

Antonio Vargas
2005-09-01T13:57:25Z

On 9/1/05, Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:
> On Iau, 2005-09-01 at 08:00 +0200, Antonio Vargas wrote:
> > 2. whole screen z-buffer, for depth comparison between the pixels
> > generated from each window.
>
> That one I question in part - if the rectangles are (as is typically the
> case) large then the Z buffer just ups the memory accesses. I guess for
> round windows it might be handy.
>

There are multiple ways to enhance the speed for zbuffer:

1. Use an hierarchical z-buffer

Divide the screen in 16x16 pixel tiles, and then a per-tile minimum
value. When rendering a poly, you first check the tile-z against the
poly-z and if it fails you can skip 256 pixels in one go.

2. Use scanline-major rendering:

for_each_scanline{
clear_z_for_scanline();
for_each_polygon{
draw_pixels_for_current_polygon_and scanline();
}
}

This is easily done by modeling the scanliner with a coroutine for each polygon
to be painted. The zbuffer is reduced to a scanline and is reused for
all scanlines,
so it's rather fast :)

--
Greetz, Antonio Vargas aka winden of network

http://wind.codepixel.com/

Las cosas no son lo que parecen, excepto cuando parecen lo que si son.