|
|
![]() |
|
||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
The interesting thing about the diagrams with two lines is that they allow to get the random values in the interval between the green and the blue lines. This means that each crated particle will get the different parameter's value. Not a bad result, but to make the fire more vivid I made the particles spin. The diagram Spin of particle is set from 0 to 100. And the diagram Spin over life (factor) is made fading to eliminate the unnatural spin at the top.
This is my result:
You can add some sparkles to the fire by creating a new particle type inside the emitter, and also some smoke. For sparkles pain a white dot or a stroke on a black background and use the Intense parameter. For smoke you'll have to experiment with textures. As smoke doesn't shine turn the Intense off and set a blue tint in the color settings. This is my simple way of creating fire in particle editors. If you download the file (link to the .zip file with the lesson data) with the example and the textures you'll be able to see my fire version in Magic Particles. Part 3: Export and Integration into a Game After the fire has been created it has to be integrated into a game. The simplest way in this case is to render the fire to a frame-by-frame animation and looping it after that. Then you'll be able to play this animation as sprites in any place of the game. Unfortunately the nature of such editors doesn't allow to make an infinite loop process. We'll have to cheat :). But first we have to get the sequence of frames. There is nothing difficult about it. Have a look at the export window of Magic Particles: ![]() Choose the frame size, usually multiple of power of 2 (for example 128, 256, 512), file type (any graphic format except lossy compression, alpha-channel not needed) and hit Export. You'll get too many frames, you'll need to select a small section, 1-3 seconds long. It'll be quite enough. To create a smooth transition I used Adobe After Effects. Not going into detail I'll just show you a couple of snapshots:
I imported the frame sequence into After Effects and copied the animation as a second layer. After that I "cut" the tracks in the middle and moved them so that one track ended in the place of the cut and the other began. I shortened the composition time to make the tracks overlap. And then I adjusted the opacity of the upper layer so that it changed from 0% to 100% from A to B. After this operation the transition becomes almost unnoticeable. We only have to render the composition into a frame sequence and see how it works in the game. Another way to export fire into a game is to use a developer version of the program Magic Particles (Dev). This version has an API to export the special effects into the game engine at a level of processing particles. The example of API use you can download here (http://www.astralax.com/programm/demo_api.zip.) Conclusion Experimenting with your results you can make the fire more fierce as a forest fire or calm as a gas stove fire. You can make it brighter, dimmer, quicker or slower. The real fire is sometimes very different and having toyed with the parameters you can make it the way you wish. In conclusion I would like to thank Yasha a.k.a Snork, Alexei a.k.a. Odin_KG and Masha Zaitseva for the help in the lesson creation. Ask your questions and put you comments.
With best wishes Evgeni Vendigo Bulatov. The translation from Russian by Grigori Bulatov.
|
||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||
|
|
Copyright © 2005-2009. All Rights Reserved | |||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||