Overview

A popular way to create smoke effects in visual simulation is through particle systems.  Briefly, a particle system emits particles.  Each particle can have a texture as well as a variety of physical characteristics.  Particles can be shot or just placed in the world.  If you shoot your particles you can control a randomize range of angles and speeds.  You can give your particles a life span in seconds and have them grow or shrink over their life.  Particles can have mass and surface area which affects their motion.  They can move relative to the world or relative to the shooter.  They can blow in the wind, they can spin in various axis; there are many cool things you can do with particles!

I am going to focus on a smoke trail emitted by an aircraft engine.  Often, aerobatic aircraft are rigged to dump  a special oil into the hot engine exhaust which creates a thick smoke trail.  This is really cool at air shows.

We would like to simulate this effect in FlightGear and we do.  However, I’m a little unsatisfied with some of the existing particle configurations.  I’ve seen much better in other packages.  I have carefully made some improvements which I will explain here.  Hopefully other aircraft developers can take this and run with it and make their smoke effects look even better.

Example

For detailed documentation on the FlightGear particle system, please consult the file README.xmlparticles in the FlightGear documentation folder (included with every installation.) Here is an example xml config file I have been working with to create smoke effects for my small UAV models:

<particlesystem>
    <name>smoke</name>

    <offsets>
      <x-m>  0.000 </x-m>
      <y-m>  0.000 </y-m>
      <z-m>  0.000 </z-m>
      <roll-deg>    0.000 </roll-deg>
      <pitch-deg>   0.000 </pitch-deg>
      <heading-deg> 0.000 </heading-deg>
    </offsets>

    <texture>smoke.png</texture>

    <condition>
      <property>sim/multiplay/generic/int[0]</property>
    </condition>

    <emissive>false</emissive>
    <lighting>false</lighting>
    <align>billboard</align> 
    <attach>world</attach> 



    <placer>
      <type>point</type> 


    </placer>

    <shooter>
      <theta-min-deg>70</theta-min-deg>
      <theta-max-deg>110</theta-max-deg>
      <phi-min-deg>70</phi-min-deg>
      <phi-max-deg>110</phi-max-deg>
      <speed-mps>
        <value>10</value>
        <spread>5</spread>
      </speed-mps>
      <rotation-speed>
        <x-min-deg-sec>0</x-min-deg-sec>
        <y-min-deg-sec>0</y-min-deg-sec>
        <z-min-deg-sec>-180</z-min-deg-sec>
        <x-max-deg-sec>0</x-max-deg-sec>
        <y-max-deg-sec>0</y-max-deg-sec>
        <z-max-deg-sec>180</z-max-deg-sec>
      </rotation-speed>
    </shooter>

    <counter>
      <particles-per-sec>
        <value>200</value>
        <spread>5</spread>
      </particles-per-sec>
    </counter>

    <particle>
      <start>
        <color>
          <red><value>   1.0 </value></red>
          <green><value> 1.0 </value></green>
          <blue><value>  1.0 </value></blue>
          <alpha><value> 0.3 </value></alpha>
        </color>
        <size>
          <value>0.2</value>
        </size>
      </start>

      <end>
        <color>
          <red><value>   0.95  </value></red>
          <green><value> 0.95  </value></green>
          <blue><value>  0.95  </value></blue>
          <alpha><value> 0.001 </value></alpha>
        </color>
        <size>
          <value>5.0</value>
        </size>
      </end>

      <life-sec>
        <value>30</value>
      </life-sec>
       
      <mass-kg>0.1</mass-kg>
      <radius-m>0.25</radius-m>
    </particle>
     
    <program>
      <fluid>air</fluid>         


      <gravity>false</gravity>
      <wind>true</wind>
    </program>
     
  </particlesystem>

Again, rather than explain everything in detail, I just want to touch on several items that perhaps are being misunderstood or overlooked.

I think I have taken several significant strides forward to create a better smoke trail configuration for FlightGear, however, I’ve still seen better in other software packages.  This is something I will continue to work on and hopefully other developers will pick up on too, now that they know exactly what parameters they need to tune and why.

UAS Visualation

Smoke trails and trajectory markers can be two great tools when prototyping and developing UAS flight control systems.  Trajectory markers show the absolute flight path in world coordinates, and a smoke trail shows the relative path in the air mass.  Turn them both on at the same time to see how they relate to each other.  This enables an engineer to see exactly what their aircraft is doing under a variety of wind and turbulence conditions.

2011-05-08 21:38:57 -0500 - Written by curt