Game Display Technology: 2D Display Technologies 3D Display Technologies
Game Display Technology: 2D Display Technologies 3D Display Technologies
• 2D Display Technologies
• 3D Display Technologies
2D Display Technologies
• The 2D engines build the world from a large set of prebuilt pieces. They are very
good if it is required to control every last pixel on the screen, but are not very
flexible compared to 3D engines.
• Sprites
• The 2D display technologies are sometimes also known as sprite engines. A sprite
is a two-dimensional image which is integrated into a larger scene. Initially,
sprites were a method of integrating unrelated bitmaps so that they appear as a
part of a single bitmap on the screen.
• The animations required in games were rendered exclusively using the CPU and
software as part of the screen video memory in itself. These techniques of
rendering animations using CPU and video memory came to be known as sprites.
Binary Image Masks
• In this technique, when an image was to be placed over a background, the transparent areas
would be specified by a binary mask. Hence there would be two bitmaps for each image: the
actual image, in which all the unused areas are given a pixel value of 0; and an additional image,
in which the area used by the elements are given a pixel value of 0; while the rest of the area is
given a pixel value of 1. Consider the sample shown in Figure 7.1, the black pixels represent 0
while white pixels represent 1.
• When the game is running, in order to put an image over the background, the program would
first mask the background with the image mask using the bitwise AND operator. This would
preserve the pixel of the transparent areas.
• Then the program would blend the image with the background using the bitwise OR operation,
which would place the image pixels appropriately, while keeping the surrounding pixels
preserved (Figure 7.2).
Transparent Color
• There are plenty of games which use both 2D and 3D technologies simultaneously. They
usually use sprites or static images to draw a background and then use 3D to draw
dynamic objects and characters in front of the backgrounds.
• This gives the developer the ability to display visually appealing environments without
using large amounts of processing power. It also gives the player the flexibility to move
around freely in the environment.
• Interaction of the characters with the 3D objects shown in the background would be
one of the major problems when developing a game using this technique. There are a
couple of ways to get around this.
• The developer could use sprites to display a different image when the character walks
behind objects in the 3D environment. Also use of pre-rendered depth buffers, tools
like 3D Studio Max provide the option of saving the depth buffer information with the
RGB channels.
DirectX and OpenGL
DirectX
• DirectX is a collection of application programming interfaces (APIs) for handling
tasks related to multimedia, game programming and video on Microsoft
platforms.
• It was designed to sit between the application and the hardware. If the hardware
was capable of performing the operation itself, DirectX would call the
appropriate driver, if the hardware did not support the operation, then DirectX
would emulate the call in the software.
• The basic components of DirectX are:
• Direct3D API within DirectX has been used extensively to develop video games for
Windows, XBOX and the XBOX360 platforms.
• DirectX provides just about all the APIs required to develop an interactive game,
the developer can choose (a) DirectDraw/Direct3D APIs for drawing his/her game
world, (b) DirectInput APIs to capture user inputs from various devices, (c)
DirectSound to play sounds that are required during gameplay, (d) DirectPlay to
allow multi-player interactions and (e) DirectMusic for setting the right
atmosphere.
• The DirectX functionality is provided through component object model (COM)
style objects and interfaces. Recently Microsoft has also announced the XNA
framework which is a managed environment used to develop games using higher
level languages like C# and VB.NET.
OpenGL
OpenGL
OpenGL
Tools for game development
Tools for game development
Tools for game development
Display System
• Display forms an important part of the game design and programming phase and
is probably one of the first aspects of the game that is decided upon before
anything else.
• The display technology depends on and varies from platform to platform on
which the game is developed and this section briefly discusses this variation.
Pixel
Screen Size, Resolutions and Aspect Ratio
Screen Size, Resolutions and Aspect Ratio
Screen Size, Resolutions and Aspect Ratio