Parallax scrolling: Difference between revisions

Content deleted Content added
disambiguation link repair (You can help!); moving template to talk page
The raster way: Clarify that raster techniques are more popular in older graphic chipsets
Line 12:
== The raster way ==
In [[raster graphics]], the lines of pixels in an image are typically composited and refreshed in top-to-bottom order, and there is a slight delay, called [[horizontal blank]], between drawing one line and drawing the next line.
Games designed for older graphical chipsets, such as those of the [[History of video game consoles (third generation)|third]] and [[History of video game consoles (fourth generation)|fourth]] generations of video game consoles, those of dedicated [[TV game]]s, or those of similar handheld systems, take advantage of the raster characteristics to create the illusion of more layers.
 
Some display systems have only one layer. These include most of the classic 8-bit systems (such as the [[Nintendo Entertainment System]] and, the original [[Game Boy]], and the [[PC Engine]]). Games on such systems generally divide the layer into horizontal strips, each with a different position and rate of scrolling. Typically, strips higher up the screen will represent things farther away from the virtual camera, or one strip will be held stationary to display status information. The program will then wait for horizontal blank and change the layer's scroll position just before the display system begins to draw each scanline. This is called a "[[raster effect]]" and is also useful for changing the system [[palette]] to provide a gradient background.
 
Some platforms ([[Super Nintendo Entertainment System|Super NES]], [[Sega Genesis]], [[Game Boy Advance]], [[Game Boy]]) provide a [[horizontal blank interrupt]] for automatically setting the registers independently of the rest of the program; others, such as the NES, require the use of cycle-timed code, which is specially written to take exactly as long to execute as the video chip takes to draw one scanline, or timers inside game cartridges that generate interrupts after a given number of scanlines have been drawn. Many NES games such as the classic ''[[Super Mario Bros.]]'' use this technique to draw their status bars, and ''[[Teenage Mutant Ninja Turtles II: The Arcade Game]]'' and ''[[Vice: Project Doom]]'' for NES use it to scroll background layers at different rates.
 
More advanced raster techniques can produce interesting effects. A system can achieve breathtaking depth of field if layers with rasters are combined; ''[[Sonic the Hedgehog 2 (Megadrive)|Sonic the Hedgehog 2]]'', ''[[ActRaiser]]'', and ''[[Street Fighter II]]'' used this effect well. If each scanline has its own layer, the ''[[Pole Position]]'' effect is produced, which creates a pseudo-3D road (or in the case of ''[[NBA Jam]]'', a pseudo-3D ball court) on a 2D system.