Search Tips Advanced Search |
| Delphi Graphics and Game Programming Exposed with DirectX 7.0 by John Ayres Wordware Publishing, Inc. ISBN: 1556226373 Pub Date: 12/01/99
Search this book:
Previous | Table of Contents | Next
Alternatives/Enhancements The strength of the blaze could easily be controlled by writing smaller starting pixel values on the bottom line, or perhaps writing values on only a few pixels and initializing the rest to 0. Because of the way this algorithm works, any pixels drawn into the fire canvas will become part of the blaze. By drawing text into the surface, the letters would appear to burn, creating a very cool effect. Perhaps the easiest modification to this effect is changing the colors used in the palette. By defining a different range, we could make green fire, purple fire, etc. Indeed, by coupling this with some palette cycling, we could make the fire change colors on the fly. Employing a different method for moving the pixels could also dramatically change the effect. Various other plasma effects demonstrated in examples found throughout the Web use both of these techniques. ### Summary In this chapter, we discussed several techniques for providing visual special effects that can enhance and complement a game application. We examined various bitmap manipulation methods, including lighting and simple texture mapping, as well as methods for dynamically creating images. When creating visual effects for your games, it is important to keep these points in mind: • Computer graphic special effect techniques can be used to produce visual images that would be difficult or impossible to reproduce using blitting techniques alone. • By drawing bitmaps using mathematical equations to modify the location of pixels as they are drawn to a destination, you can produce some very cool effects. Manipulating and transforming bitmaps in this way can give images a sense of texture or depth, and can stretch the art budget dollar. • Bitmaps can be easily scaled to a larger or smaller size. DirectDraw supports this natively, but by using our own methods, we can control certain aspects and produce images with much better resolutions. • Rotating an image is only supported by DirectDraw if it is available in the hardware. We can use our own techniques for rotating images, but most simple implementations are slow due to the mathematical intensity of the algorithm. • Lighting techniques can be used to create game worlds that are more realistic. A cheap, simple method is to segregate the palette into four segments of 64 slots, with the first segment containing the full intensity colors, and the other segments containing the same colors at darker and darker intensities. This results in banding, but the effect is quick and produces adequate results. • Transition effects give a game a better sense of flow. Pay attention to how modern movies transition between scenes for inspiration. Many transition effects are relatively easy to implement. • Texture mapping is a complex subject with intense math requirements. However, we can use scaling techniques in order to produce some simple texture mapping effects. • Using some basic 3-D mathematical algorithms, it is fairly easy to produce a realistic star field. The equations used in this effect are at the core of real-time 3-D graphics programming techniques. • By moving the pixels in an image, we can create a very realistic fire effect. It is possible to modify how these pixels move as well as perform a little palette rotation to produce some very interesting plasma effects.
Previous | Table of Contents | Next

Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.