You are on page 1of 1

S E Z

U !

Readers Want Flames, Believe It or Not


FLAME ON! Dear Editor: he article by David Sieks, Where the Sun Dont Shine (April/May 1996), was great coverage of lighting and creating mood. However, his article didnt mention anything about torchlight and other animated light forms caused by fire. Since I am currently working on a project that incorporates this kind of lighting, I would like to find out more about it. Do you have an idea of where to look? Thomas Buytaert Via e-mail

David Sieks replies: When first writing the article, I had considered the issue of firelight. The problem I ran into is that approaches vary from one 3D package to the next, depending on the tools available. Unfortunately, I havent seen very much written on flames or torchlight that I can recommend to you. One article that does come to mind is Fun With Flames, a LightWave howto by Bill Arbanas in 3D Artist #17. Its got a lot of LightWave-specific detail, but many techniques should also prove of more general interest if you use another package. Theres also a Pyromania CD-ROM of animated flames and explosions, though in a quick look around here I wasnt able to turn up the company that offers it. I bet a web search would help. I dont know what software you are using or what you have attempted so far in the way of flame effects, but the two chief effects you have to create are the flames themselves and the light cast by the flames. As far as the first item, you probably dont want to try to model a leaping torch flame in 3D. Instead, try making a short, looping 2D animation of a flame shape surrounded by an alpha key color (so that the

negative space around the flame drops out). You can use a yellow-to-orange gradient to color the flames, but move the gradation slightly up and down over the course of the sequence so it doesnt look too static. Apply this flame sequence as an animated texture map to a flat polygon in your 3D program. Position this flame-painted polygon to face your camera. Many 3D packages let you link the two together so that even as the camera moves, the polygon turns to face it. As for the flickering light of the torch, youll need to place one orpreferablymore light sources on or very near the flame-painted polygon. Animate the intensity levels of the lights so that their brightness increases and diminishes and animate a color shift back and forth between yellow and orangeyred. Depending on how much your animated fire map leaps, you may also want to animate a small range of movement for the lights. Multiple light sources, each shifting hue (at a different rate) from yellow to orangeyred, with animated intensity levels never quite in sync, positioned slightly apart from one another and all casting shadows should give a really nice look. Of course, shadowcasting is a real time-sink, so you have to strike your own balance here. If your flame is off camera and you just need the effect of flickering light and leaping shadows in your scene, it might be easier to use an animated projection map in front of your light source: make an abstract, looping 2D animation of yellows and oranges amidst patterns of light and dark and project this animated map onto your scene. This is rather general, but I hope its been some help. Id be interested to hear of any refinements or new tricks you come up with as you continue with your project.

I HAVE A GREAT IDEA... Dear Editor: n a not so recent Game Developer article (Lets Get To The [Floating] Point, February/March 1996), Chris Hecker derived some equations for properly taking the floor and mod of negative numbers. I just had an idea which may speed up the method he gave. If you know that the number you want to operate in is never going to be less than -A where A is a positive integer, pick some integer B>A. Then, when you want to do a floor on x, add in B, do the floor and mod with the assurance that you are operating on a positive number, and then subtract B out of the floor. For example (note I am modding with 1):

x = -2.3 B = 100 floor(100+-2.3) = floor (97.7) = 97 97.7 mod 1 = .7 then, subtract B from the floor (97-100) = -3 This gets rid of the jumps needed when checking for the positive and negative cases. Tim DeBruine Via e-mail

Chris Hecker replies: Thats a good idea! Ive also seen cases where you can bias your entire coordinate system until its positive to avoid the subtraction. This technique also works for the floating-point conversion from another article.

We Want Your Feedback! Please direct all comments, questions, and suggestions to the Game Developer web site http://www.gdmag.com. Thanks!

http://www.gdmag.com

GAME DEVELOPER AUGUST/SEPTEMBER 1996

You might also like