Sprite (computer graphics)

The term sprite is used in computer graphics to refer to a two dimensional image 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. As computer performance improved, this optimization became unneccessary and the term evolved to refer specifically to the two dimensional images themselves that were integrated into a scene. That is, figures generated by either custom hardware or by software alone were all referred to as sprites. As three-dimensional graphics became more prevalent the term was used to describe a technique whereby flat images are seamlessly integrated into complicated three-dimensional scenes.

Missing image
SpriteExamplefromZelda.jpg
An example of sprite animation from the popular game The Legend of Zelda: The Wind Waker. In this frame the brown puffs of smoke are integrated into the scene using sprites. Other objects in the frame such as the character (Link), the flower just behind his feet, and the rock walls and ground are more complicated three dimensional objects that employ texture mapping. (Notice that one sprite at the bottom of the largest puff of smoke is actually cutting into the ground, revealing its actual geometry.)

More often a sprite now refers to a partially transparent two dimensional animation that is mapped onto a special plane in a three dimensional scene. Unlike a texture map the sprite plane is always perpendicular to the axis eminating from the camera. The image can be scaled to simulate perspective, it can be rotated two dimensionally, it can overlap other objects and be occluded, but it can only ever be viewed from the same angle. This rendering method is also refered to as billboarding.

Sprites create an effective illusion when:

When the illusion works viewers will not notice that the sprite is flat and always faces them. Often sprites are used to depict phenomenon such as fire, smoke, small objects, small plants (like blades of grass), or special symbols (like "1-Up"). The sprite illusion can be exposed in video games by quickly changing the position of the camera while keeping the sprite in the center of the view.

Sprites have also occasionally been used as a special effects tool in movies. Most notably the creators of the fire breathing Balrog in The Lord of the Rings: The Fellowship of the Ring used sprites to simulate fire emanating from the surface of the demon. Small bursts of fire were filmed in front of a black background and made transparent using a luma key. Many bursts were then attached to the surface of the animated Balrog model and mixed with simulated smoke and heat waves to create the illusion of a monster made from fire.

Contents

Billboarding

Billboarding is one term used to describe the use of sprites in a 3D environment. In the same-way that a billboard is positioned to face drivers on a highway, the 3D sprite always faces the camera.

Rationale

There is both a performance advantage and an aesthetic advantage to using billboarding. Most 3D rendering engines can process "3D sprites" much faster than other types of 3D objects. So it is possible to gain an overall performance improvement by substituting sprites for some objects that might normally be modeled using texture mapped polygons. Aesthetically sprites might be desirable because polygons might never be able to realistically reproduce phenomenon such as fire. Sprite images of fire might provide a more attractive illusion.

Alternative Terms

Hardware Sprites

In early video gaming, sprites were a method of integrating unrelated bitmaps so that they appear to be part of the a single bitmap on a screen.

Rationale

During most of the the 1980s, hardware speed was in the low, single-digit megahertz and memory was mere kilobytes. With these constraints video game programmers resorted to extreme measures to speed up the process of writing bitmaps onto the display. A sprite engine is hardwired into a computer or videogame system's architecture. The central processor can instruct the engine to fetch source images and integrate them into the main screen using direct memory access channels. (This is related to what a genlock does with video sources and to a playfield). Calling up sprite hardware, instead of the using processor alone greatly improved graphics performance. Because the processor is not occupied by the simple task of transfering data from one place to another software can run faster and because the hardware provided certain innate abilities programs that used sprites were also smaller.

Separate locations in memory were used to hold the main display and the sprites, which were composited together into the display in two passes. This placed the sprites on the display without interferring with the "background" image, making them easy to move around the display. Examples of such systems include the Atari 8-bit machines (which referred to them as player/missile graphics) and the Commodore 64.

In contrast, bit blitting (short for "bit block transfer") drew sprite-like figures into the same memory as the background, with the main display hardware rendering the entire image at once. Moving a bit blit object on the screen requires several steps; the orignal background to be painted over must be stored, the image drawn, then when it moves the original image painted back into the blit's location to "repair" the display and the process repeated for the new location. The upside to this approach is that there is no need for custom hardware and any number of images can be composited. The downside is that in the era of severly limited processor performance the time needed to repair the images and redraw them was considerably more expensive than using a sprite system.

Sprites are rare in most video hardware today. More commonly, bit blitting is employed or more complicated rendering algorithms are used. For extreme graphics performance, graphics accelerators now have a similar role.

Capabilities

Sprite engines were varied in their capabiliies. The various parameters included:

Sprites are typically used for characters and other moving objects in video games. They have also been used for mouse pointers and for writing letters to the screen.

Alternative Terms

For on-screen moving objects larger than one sprite's extent, sprites may sometimes be scaled and/or combined.

Notable Implementations

External links

See also: Sprite (computer graphics), 1980, ANTIC, Amiga, Apple II, Atari 8-bit, Atari 8-bit family, Atari Lynx, Atari ST, Balrog