Thank you for visiting Blazing Games

Artificial lighting

Lighting is one of those things that can add a lot of atmosphere to a game. The problem with lighting is that it tends to be computationally intensive. There are numerous factors that effect the way lights interact with a scene. The brightness and color of the lights are the most obvious. The thing is that when light bounces of surfaces, the color and intensity of the light can change. In fact, the light bouncing off surrounding objects is one of the reasons that shadows are seldom solid black. In fact, the repeated bouncing of light off of surfaces leads to a lighting effect known as radiosity. The effects of radiosity is especially noticeable indoors. Of course, the surfaces of the objects can have a huge effect alone as a mirrored surface is going to give you a drastically different lighting effect then a dark porous wood would have. And that is not taking into account how the light is affected as it travels through transparent or translucent objects.

To get the most realistic results, one can use a technique known as ray tracing. This is a technique where each pixel of a display is generated by tracing a ray from where it intersects the eye back to the light source(s). The problem with this technique, despite the photo-realistic results, is the length of time it takes to calculate all this information. For a complex image, it can take hours or even days to generate an image. Games are real time so they simply can not do this type of thing yet. Of course a fast computer, such as the 80 core Intel prototype, could possibly be used to do real time ray tracing so in the future this may be the way things are done.

Instead, of calculating the lighting on a per-pixel basis, polygon based renderer's that are used in games tend to drastically simplify the lighting work. One thing that is done is doing shadow effects as a separate pass (or even pre-calculate the shadow and lighting in cases where the lights are stationary). The polygons are then lighted by calculating the lights at the vertexes and extrapolating the results. This can be done in hardware so this is a standard feature on 3D graphics cards. Doing this work in software is much more time consuming.

The best way of doing lighting effects in Flash 7 is to either pre-calculate the effects or fake them. Thankfully, Flash has some incredibly powerful tinting and alpha blending effects that can be used to help simulate more sophisticated lighting.

Previous page
Chapter 20 Page 4

About - Privacy Policy - Contact - Links - FAQ
Copyright © 2007 Blazing Games Inc. All Rights Reserved