Scanline algorithm

From DmWiki

The scanline algorithm, also called scan conversion, is a rasterization algorithm. It is used to find the set of pixels that belong to a polygon, starting from a list of the polygon's vertices.

During scan conversion, the polyon is broken into horizontal lines of pixels called scans or scanlines. Accessing video memory using scanlines is the most cache-friendly way, since horizontally adjacent pixels are also adjacent in video memory, and lots of software engines use this technique to render triangles as quickly as possible. During scan conversion, quantities such as, z-coordinate, texture coordinates, and others are linearly interpolated across the polygon's surface, producing the input values for the pixel shader. Alternatively, color alone may be interpolated from vertex colors.

Nowadays, GPUs use different approaches to the rasterization problem, since they are highly parallel and have different layouts of video memory. For example, a triangle may be split into many different parts to maximize cache reuse and coherency, or rasterization may be done in 2×2 pixel blocks rather than by scanlines.

This article is a stub. You can help improve the article by expanding it.


DevMaster navigation