This article needs additional citations for verification. (September 2007) (Learn how and when to remove this template message)
|Part of a series on:|
|Video game graphics|
Parallax scrolling is a technique in computer graphics where background images move past the camera more slowly than foreground images, creating an illusion of depth in a 2D scene of distance. The technique grew out of the multiplane camera technique used in traditional animation since the 1930s. Parallax scrolling was popularized in 2D computer graphics and video games by the arcade games Moon Patrol and Jungle Hunt, both released in 1982. Some parallax scrolling had earlier been used by the 1981 arcade game Jump Bug.
This section possibly contains original research. (March 2015) (Learn how and when to remove this template message)
Some display systems support multiple background layers that can be scrolled independently in horizontal and vertical directions and composited on one another, simulating a multiplane camera. On such a display system, a game can produce parallax by simply changing each layer's position by a different amount in the same direction. Layers that move more quickly are perceived to be closer to the virtual camera. Layers can be placed in front of the playfield—the layer containing the objects with which the player interacts—for various reasons such as to provide increased dimension, obscure some of the action of the game, or distract the player.
Programmers may also make pseudo-layers of sprites—individually controllable moving objects drawn by hardware on top of or behind the layers—if they are available on the display system. For instance Star Force, an overhead-view vertically scrolling shooter for NES, used this for its starfield, and Final Fight for the Super NES used this technique for the layer immediately in front of the main playfield.
The Amiga computer has sprites which can have any height and can be set horizontal with the copper co-processor, which makes them ideal for this purpose.
Repeating pattern/animation method
Scrolling displays built up of individual tiles can be made to 'float' over a repeating background layer by animating the individual tiles' bitmaps in order to portray the parallax effect. Color cycling can be used to animate tiles quickly on the whole screen. This software effect gives the illusion of another (hardware) layer. Many games used this technique for a scrolling star-field, but sometimes a more intricate or multi-directional effect is achieved, such as in the game Parallax by Sensible Software.
In raster graphics, the lines of pixels in an image are typically composited and refreshed in top-to-bottom order with a slight delay (called the horizontal blanking interval) between drawing one line and drawing the next line. Games designed for older graphical chipsets—such as those of the third and fourth generations of video game consoles, those of dedicated TV games, 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 Commodore 64, Nintendo Entertainment System, Sega Master System, PC Engine/TurboGrafx-16 and original Game Boy). The more sophisticated games on such systems generally divide the layer into horizontal strips, each with a different position and rate of scrolling. Typically, strips higher on 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 (such as the Commodore 64, Amiga, Sega Master System, PC Engine/TurboGrafx-16, Sega Mega Drive/Genesis, Super NES, Game Boy, Game Boy Advance and Nintendo DS) 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 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 a very effective depth of field if layers with rasters are combined; Sonic the Hedgehog, Sonic The Hedgehog 2, ActRaiser, Lionheart 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 a pseudo-3D ball court as in NBA Jam) on a 2D system.
If the display system supports rotation and scaling in addition to scrolling—an effect popularly known as Mode 7—changing the rotation and scaling factors can draw a projection of a plane (as in F-Zero and Super Mario Kart) or can warp the playfield to create an extra challenge factor.
Another advanced technique is row/column scrolling, where rows/columns of tiles on a screen can be scrolled individually. This technique is implemented in the graphics chips of various Sega arcade system boards since the Sega Space Harrier and System 16, the Sega Mega Drive/Genesis console, and the Capcom CP System, Irem M-92 and Taito F3 System arcade game boards.
In the following animation, three layers are moving leftward at different speeds. Their speeds decrease from front to back and correspond to increases in relative distance from the viewer. The ground layer is moving 8 times as fast as the vegetation layer. The vegetation layer is moving two times as fast as the cloud layer.
2.5D parallax scrolling of city buildings.
Parallax scrolling in Web design
- "Cap. O'Rourke to the rescue". New Straits Times Malaysia. 1988-09-01. Retrieved 2009-07-06.
- Paul, Wyatt (August 2007). "The Art of Parallax Scrolling" (PDF). Archived from the original (PDF) on 2009-10-07. Retrieved 2009-07-06.
- Stahl, Ted (2006-07-26). "Chronology of the History of Video Games: Golden Age". Archived from the original on 2009-07-16. Retrieved 2009-07-06.
- "Gaming's Most Important Evolutions". GamesRadar. October 8, 2010. p. 3. Retrieved 2011-04-27.
- "Jungle Hunt Was a Terrible Waste of Quarters". Archived from the original on 2015-04-02. Retrieved 2015-03-27.
- Purcaru, Bogdan Ion (13 March 2014). "Games vs. Hardware. The History of PC video games: The 80's". Purcaru Ion Bogdan – via Google Books.
- "Risky Woods". codetapper.com. Archived from the original on 2015-02-19. Retrieved 2015-04-23.
- "Archived copy". Archived from the original on 2017-11-09. Retrieved 2018-09-04.CS1 maint: archived copy as title (link)
- "Archived copy". Archived from the original on 2014-03-18. Retrieved 2014-03-18.CS1 maint: archived copy as title (link)
- "Using MAME's tilemap system - DevWiki". archive.org. 2 January 2014.
- "Archived copy". Archived from the original on 2016-03-04. Retrieved 2016-08-08.CS1 maint: archived copy as title (link)
- "Sega Genesis vs Super Nintendo". gamepilgrimage.com. 2009-08-11. Archived from the original on 2015-09-24. Retrieved 2014-09-26.
- Leaman, Paul. "New Forgotten World Clone – CP System Code". Archived from the original on 25 May 2015.
- "System 16 - Irem M92 Hardware (Irem)". www.system16.com. Archived from the original on 2014-12-24. Retrieved 2014-09-26.
- "System 16 - Taito F3 System Hardware (Taito)". www.system16.com. Archived from the original on 2014-04-21. Retrieved 2014-09-26.
- Matthias Kretschmann (23 May 2008). "Showcasing the css parallax effect - 12+1 creative usages". Glutnix. kremalicious.com. Retrieved 28 June 2019.
- Dan Cederholm; Ethan Marcotte (9 April 2010). Handcrafted CSS: More Bulletproof Web Design. New Riders. pp. 5–. ISBN 978-0-13-210481-4.
- Dede M. Frederick (18 April 2013). "The Effects Of Parallax Scrolling On User Experience And Preference In Web Design". Purdue University. Purdue University. Archived from the original on 2014-04-16. Retrieved 17 April 2014.