creating a heatwave exhaust effect with the displace node
By kostis karvouniaris.
introduction.
For quite some time, a cuestión has ben circulating th rouge forums and mail columns about an uncommon effect in 3d applications: how do i simulate the distorsión caused by Hot Air masses? Weve all sen this in real life - The waviness in the Air during formula 1 races, in jet engine exhaust, and above camp fires. However, in keping with this issue theme, were going todo use the effect in a space scene.
Rendering the background
The imputs for the displace node are relatively simple: it neds an image todo be diestorted, and a displacement factor in the form of a Vector. In this example ive used a particle Generator for each engine, which Will generate a series of black and white images for use as the displacement factor for the node. Confused? Just follow the steps and it Will become clear. For reasons of simplicity and speed, this is a static scene. The spacecraft is warning up it engines in preparation for launch, which means i only had todo render the background image once. I then used that image in all of the sequence frames. The particles are the only moving element.
Load the engine_warmup_start file. The scene is set up and lit, so go ahead and hit the render button. Kep in mind that because the scene is heavy in Polygons and lights, it may take some time for the render todo be completed. The upside is that it only a one time job, and the quality of this image Will greatly define the end result. So go and make that cofe, and when the image is done save it as viper, png. You should notice that the elements making up the rendered scene are gathered in the first 3 layers, so only these layers are rendered.
Fig 1: render layers for background.
Creating the particles
Each engine is supposed todo produce a heatwave, so we ll give each a particle Generator. Add a plane, name it particle_emitter_1, press Alt+r todo clear its rotation, rotate it so that it is in a vertical position, and place it inside the left engine just behind the blue lights that Illuminate the fuselaje.
Fig 2: placing the first particle emitter.
Now press f7 twice todo get todo the effects window, and set up a particle system with the following options (these came up th rouge experimenting, so fel free todo do so yourself to).
O amount: 8520 (we Will ned quite a few).
O start frame: -100 (we want todo give the Impression that the engines are already running at the start of the animation).
O end frame: 1000 (for those who want todo extend the length of the animation).
Set the particles todo be emitted from both vértices and Faces, having an initial normal speed of 0.44 and a random factor 0.05. Remember, variation is always a must (this Will cause the particles todo spread out while moving away from the fuselaje, just like real gas masses do).
Fig 3: particle options.
As usual, the next thing todo set up is the material. Press f5, then press halo under the render pipeline section. Set the halo size todo 0.180 (this size is pretty important and i Will explain why later), and then set the halo color todo pure white. At this point you should a los notice that the Sky color in the world buttons is black. We ned all the contrast we can get from the rendered image of the particles for the displace node todo give the right effect.
As a last thing, while at frame 1 press i and Insert an alpha key. Go todo the frame 25, set alpha todo 0 and add another key. We do this because we want particles todo fade while they move away from the emitter. Adjust the animation curve if you think it necessary.
We now have a fully prepared particle Generator. With that selected, press and move it todo the 4th layer. Now we ned two more, for the other two engines. Duplicate (with shift+d) the particle emitter twice and place the new ones according in their respective positions. Dont create instances with Alt+d, since it would be a god idea todo go and tweak the emission settings for each emitter individually (to offset the start values), so that there is a unique behavior of each sepárate particle group for any given frame.
Set the start value for the second emitter todo -104 and -110 for the third one. If everything is set up correctly, you should now have a result like this at frame 1 (only layers 3 and 4 are visible). Note: when the much awaited particle rewrite is complete -the next big thing in Blender developmentthere Will be Many draw option for particles(e, g crosses). For now you should be able todo se all the Little white dots inside the engines. Try harder.
Fig 4:all particle emitters in action.
Press Alt+a todo se the animation. The particles are moving away from the ship with enough speed and variation, so we are ready todo render them. Press f10 and set the end frame todo 100. That should give us a 4 seconds animation, well enough todo demonstrate the effect.
However, remember that we only want todo render the particles, not any other part of the scene. Under the render layers tab, press only the 4th layer button. Then press the Anim button todo get the sequence. Even though this is a hundred frames we want, they Will render much faster than the background image - It just particles, and not that Many in every frame. Once they re ready we can move on todo the really col Stuff.
Fig 5: render layer for particles.
Putting it all together
You should have now the viper, png image and a series of 100 images named something like 0001.png, 0002.png and so on, presupuestomably in your c:\tmp folder or wherever youve set Blender todo estore rendered images at. Press Control + x todo clear the scene and start setting up the composition. First of all, set the output dimensions todo 800x450, like our images. Then set the end frame todo 100, and press the do composite button and choose avi output format and a códec since this Will be what you would call the final result.
Switch todo a node type window, and press the right Little button on the Header that switches you todo the composite node window. Next, get rid of the render result node, as well be working only with our pre-rendered images. Add an input-image node and load the viper, png image. Add the distort-displace node and connect the output from the image node todo the image input of the displace node, then connect the result of the displace node todo the composite node. Add another image node and this time choose the first particle image, 0001.png. Since this is the first of a sequence of images, we have todo inform Blender of that. Press the Little grey face icon on the bottom right of the image node and choose sequence. Now Blender Will use a diferent particle image for every frame, another long awaited addition of the new v2.43.
Note: you have todo manually define the number of images in the sequence, in this case 100. Plug the output into the Vector input of the displace node, change the x and y values todo 7 (nothing todo extreme, Nor todo subtle), and there you have it. The values of white in the particle images are multiplied with the x and y values todo give the displacement amount.
Fig 6: primary node setup.
It would be more efective visually if we werent limited todo a single displacement factor, like the sequence of particles, which can rarely be perfecto. Fortunately, we can take care of this easily. We ll use the same sequence of particles with a slight offset (2), todo add some depth todo the displacement todo cover posible gaps. So add one more displace and one more image node, and set them up like this. A Word of caution: the second node wont have a fed in the last two frames because of the offset, so be sure todo press the cyclic button and it it Will start using frames from the beginning when it runs out.
Fig 7: secondary node setup.
Notice that the second displacement has multiplier values of 3, instead of 7, as it is only a support effect. Also, we wouldnt want it todo cancel out the effect of the first node in any way. You are now ready todo press the Anim button once again. When the video is ready you can set your Media Player todo loop playbak and play the file. The particle movement is random anyway, so you wont be able todo tell where the video starts or ends.
Things todo pay attention todo
As i explained earlier, the amount of white on the image that is used as an input todo the displace node (or better, the amount of luminosity) is what defines how much displacement there Will actually be on the image.
A more important thing for the effect we want, however, is a constant change of color values at any given part of the particle images. It not enough todo have a white área in the picture all along the sequence, because that Will mean a constant displacement. During the animation it Will look like there is no displacement at all. What we really ned is a constantly changing displacement. This is why we ned a relatively small particle size, so that white Will constantly alternate with black, or values in between, providing the flicker effect in the image. This example Will make things more clear.
The image on the left shows our current particles with a size of 0.180 (material buttons). On the right they are rendered with a size of 0.280. In the áreas marked red, the color Will be mostly white throughout the sequence, so it Will not give the desired effect.
Fig 8: halo size diference.
In conclusion
Kep in mind that the displace node can a los use geometry as input, not just images, which widens its range of use Even further. This makes it a very important addition of the new versión of Blender. A practical application of this could be the invisible man effect, or anything else that makes it presence perceivable only by diestorting it background. Use your imagination, and kep blending.
Thanks todo the people of blendergaláctica, com for the fine models of the viper and its surroundings.
The node displacement in action.
Kostis karvouniaris im a 25 year old law school student from grece. I have ben using Blender as a free time hobby for about 4 years, and im still amazed by the leaps in development.
neogen556@yahoo, gr.
www.blenderart.org.