All Topics  
Scanline rendering

 

   Email Print
   Bookmark   Link






 

Scanline rendering



 
 
Scanline rendering is an algorithm for visible surface determination
Hidden surface determination

In 3D computer graphics, hidden surface determination is the process used to determine which surfaces and parts of surfaces are not visible from a certain viewpoint....
, in 3D computer graphics
3D computer graphics

3D computer graphics are graphics that use a Cartesian coordinate system#Three-dimensional coordinate system representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images....
, that works on a row-by-row basis rather than a polygon
Polygon

In geometry a polygon is traditionally a plane Shape that is bounded by a closed curve path or circuit, composed of a finite sequence of straight line segments ....
-by-polygon or pixel
Pixel

In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles....
-by-pixel basis. All of the polygons to be rendered are first sorted by the top y coordinate at which they first appear, then each row or scan line of the image is computed using the intersection of a scan line
Scan line

A scan line is one line, or row, in a raster scanning pattern, such as a line on a cathode ray tube display of a television or computer.On older CRT screens the horizontal scan lines were visually discernible, even when viewed from a distance, as alternating colored lines and black lines....
 with the polygons on the front of the sorted list, while the sorted list is updated to discard no-longer-visible polygons as the active scan line is advanced down the picture.

The asset of this method is that it is not necessary to translate the coordinates of all vertices
Vertex (geometry)

In geometry, a vertex is a special kind of point which describes the corners or intersections of geometric shapes. Vertices are commonly used in computer graphics to define the corners of surfaces in 3d models, where each such point is given as a vector....
 from the main memory into the working memory—only vertices defining edges that intersect the current scan line need to be in active memory, and each vertex is read in only once.






Discussion
Ask a question about 'Scanline rendering'
Start a new discussion about 'Scanline rendering'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Scanline rendering is an algorithm for visible surface determination
Hidden surface determination

In 3D computer graphics, hidden surface determination is the process used to determine which surfaces and parts of surfaces are not visible from a certain viewpoint....
, in 3D computer graphics
3D computer graphics

3D computer graphics are graphics that use a Cartesian coordinate system#Three-dimensional coordinate system representation of geometric data that is stored in the computer for the purposes of performing calculations and rendering 2D images....
, that works on a row-by-row basis rather than a polygon
Polygon

In geometry a polygon is traditionally a plane Shape that is bounded by a closed curve path or circuit, composed of a finite sequence of straight line segments ....
-by-polygon or pixel
Pixel

In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles....
-by-pixel basis. All of the polygons to be rendered are first sorted by the top y coordinate at which they first appear, then each row or scan line of the image is computed using the intersection of a scan line
Scan line

A scan line is one line, or row, in a raster scanning pattern, such as a line on a cathode ray tube display of a television or computer.On older CRT screens the horizontal scan lines were visually discernible, even when viewed from a distance, as alternating colored lines and black lines....
 with the polygons on the front of the sorted list, while the sorted list is updated to discard no-longer-visible polygons as the active scan line is advanced down the picture.

The asset of this method is that it is not necessary to translate the coordinates of all vertices
Vertex (geometry)

In geometry, a vertex is a special kind of point which describes the corners or intersections of geometric shapes. Vertices are commonly used in computer graphics to define the corners of surfaces in 3d models, where each such point is given as a vector....
 from the main memory into the working memory—only vertices defining edges that intersect the current scan line need to be in active memory, and each vertex is read in only once. The main memory is often very slow compared to the link between the central processing unit and cache memory, and thus avoiding re-accessing vertices in main memory can provide a substantial speedup.

This kind of algorithm can be easily integrated with the Phong reflection model, the Z-buffer algorithm, and many other graphics techniques.

Algorithm


The usual method starts with edges of projected polygons inserted into buckets, one per scanline; the rasterizer maintains an active edge table(AET). Entries maintain sort links, X coordinates, gradients, and references to the polygons they bound. To rasterize the next scanline, the edges no longer relevant are removed; new edges from the current scanlines' Y-bucket are added, inserted sorted by X coordinate. The active edge table entries have X and other parameter information incremented. Active edge table entries are maintained in an X-sorted list by bubble-sort, effecting a change when 2 edges cross. After updating edges, the active edge table is traversed in X order to emit only the visible spans, maintaining a Z-sorted active Span table, inserting and deleting the surfaces when edges are crossed.

Variants


A hybrid between this and Z-buffering
Z-buffering

In computer graphics, z-buffering is the management of image depth coordinates in three-dimensional graphics, usually done in hardware, sometimes in software....
 does away with the active edge table sorting, and instead rasterizes one scanline at a time into a Z-buffer, maintaining active polygon spans from one scanline to the next.

In another variant, an ID buffer is rasterized in an intermediate step, allowing deferred shading
Deferred shading

In computer graphics, deferred shading is a 3D computer graphics shading technique in which the result of a shading algorithm is calculated by dividing it into smaller parts that are written to intermediate buffer storage to be combined later, instead of immediately writing the shader result to the color framebuffer....
 of the resulting visible pixels.

History


The first publication of the scanline rendering technique was probably by Wylie, Romney, Evans, and Erdahl in 1967.

Other early developments of the scanline rendering method were by Bouknight in 1969, and Newell, Newell, and Sancha in 1972. Much of the early work on these methods was done in Ivan Sutherland
Ivan Sutherland

Ivan Edward Sutherland is an United States computer scientist and Internet pioneer. He received the Turing Award in 1988 for the invention of Sketchpad, an early predecessor to the sort of graphical user interface that has become ubiquitous in personal computers....
's graphics group at the University of Utah
University of Utah

The University of Utah is a public university research university in Salt Lake City, Utah. One of ten institutions that make up the Utah System of Higher Education and Utah's premier research school currently enrolls 21,526 undergraduate and 6,684 graduate student students and has 1,419 regular Faculty members....
, and at the Evans & Sutherland
Evans & Sutherland

Evans & Sutherland is a computer firm involved in the computer graphics field. Their products are used primarily by the United States military and large industrial firms for training and simulation, and in digital projection environments like planetariums....
 company in Salt Lake City, Utah
Salt Lake City, Utah

Salt Lake City is the Capital and the most populous city of the U.S. state of Utah. The name of the city is often shortened to Salt Lake or SLC....
.

Use in realtime rendering


The early Evans & Sutherland ESIG line of image-generators (IGs) employed the technique in hardware 'on the fly', to generate images one raster-line at a time without a framebuffer, saving the need for then costly memory. Later variants used a hybrid approach.

The Nintendo DS
Nintendo DS

The is a dual-screen handheld game console developed and manufactured by Nintendo. It was released in 2004 in video gaming in Canada, the United States, and Japan....
 is the latest hardware to render 3D scenes in this manner, with the option of caching the rasterized images into VRAM.

The sprite hardware
Sprite (computer graphics)

In computer graphics, a sprite is a two-dimensional/three-dimensional or animation that is integrated into a larger scene.Sprites were originally invented as a method of quickly compositing several images together in two-dimensional video games using special hardware....
 prevalent in 1980s games machines can be considered a simple 2D form of scanline rendering.

The technique was used in the first Quake engine for software rendering of environments (but moving objects were Z-buffered
Z-buffering

In computer graphics, z-buffering is the management of image depth coordinates in three-dimensional graphics, usually done in hardware, sometimes in software....
 over the top). Static scenery used BSP-derived
Binary space partitioning

Binary space partitioning is a method for recursively subdividing a Euclidean space into convex sets by hyperplanes. This subdivision gives rise to a representation of the scene by means of a Tree known as a BSP tree....
 sorting for priority. It proved better than Z-buffer
Z-buffering

In computer graphics, z-buffering is the management of image depth coordinates in three-dimensional graphics, usually done in hardware, sometimes in software....
/painter's
Painter's algorithm

The painter's algorithm, also known as a priority fill, is one of the simplest solutions to the visibility problem in 3D computer graphics....
 type algorithms at handling scenes of high depth complexity with costly pixel operations (i.e. perspective-correct texture mapping without hardware assist). This use preceded the widespread adoption of Z-buffer-based GPUs now common in PCs.

Sony experimented with software scanline renderers on a second Cell processor during the development of the PlayStation 3
PlayStation 3

The PlayStation 3 is the third home video game console produced by Sony Computer Entertainment, and the successor to the PlayStation 2 as part of the PlayStation ....
, before settling on a conventional CPU/GPU arrangement.

Similar techniques

A similar principle is employed in tiled rendering
Tiled rendering

Tiled rendering is the process of subdivision a cut scene by a regular grid in to facilitate the use of limited 3D rendering resources later in the pipeline....
 (most famously the PowerVR
PowerVR

PowerVR is a division of Imagination Technologies that develops hardware and software intellectual property for 2D and 3D rendering, and for video encoding, decoding, and associated image processing....
 3D chip); that is, primitives are sorted into screen space, then rendered in fast on-chip memory, one tile at a time. The Dreamcast provided a mode for rasterizing one row of tiles at a time for direct raster scanout, saving the need for a complete framebuffer, somewhat in the spirit of hardware scanline rendering.

Some software rasterizers use 'span buffering' (or 'coverage buffering'), in which a list of sorted, clipped spans are stored in scanline buckets. Primitives would be successively added to this datastructure, before rasterizing only the visible pixels in a final stage.

Comparison with Z-buffer algorithm


The main advantage of scanline rendering over Z-buffering
Z-buffering

In computer graphics, z-buffering is the management of image depth coordinates in three-dimensional graphics, usually done in hardware, sometimes in software....
 is that visible pixels are only ever processed once—a benefit for the case of high resolution or expensive shading computations.

In modern Z-buffer systems, similar benefits can be gained through rough front-to-back sorting (approaching the 'reverse painters algorithm'), early Z-reject (in conjunction with hierarchical Z), and less common deferred rendering techniques possible on programmable GPUs.

Scanline techniques working on the raster have the drawback that overload is not handled gracefully.

The technique is not considered to scale well as the number of primitives increases. This is because of the size of the intermediate datastructures required during rendering—which can exceed the size of a Z-buffer for a complex scene.

Consequently, in contemporary interactive graphics applications, the Z-buffer has become ubiquitous. The Z-buffer allows larger volumes of primitives to be traversed linearly, in parallel, in a manner friendly to modern hardware. Transformed coordinates, attribute gradients, etc., need never leave the graphics chip; only the visible pixels and depth values are stored.

See also


  • Raster scan
    Raster scan

    A Raster scan, or raster scanning, is the pattern of image detection and reconstruction in television, and is the pattern of image storage and transmission used in most computer bitmap image systems....
  • Z-buffering
    Z-buffering

    In computer graphics, z-buffering is the management of image depth coordinates in three-dimensional graphics, usually done in hardware, sometimes in software....


External links