Particle emitters FCOLLADA extension

From COLLADA Public Wiki
Revision as of 02:23, 11 July 2007 by Glaforte (talk | contribs) (Draft V3: described the <modifier list> element as well as the two rotation modifiers.)
Jump to: navigation, search
Extension information
  • Purpose: unstated
  • Company(s): [[Feeling Software]]
  • Product(s): [[FCollada]]
  • Last updated: unstated
  • Contact for technical issues:
This article is part of the COLLADA extensions directory
Adding to the extensions directory

Particle emitters extension

DRAFT v3. This extension has two parts: the emitter description and the instance-specific information. The behavior is only loosely defined.

Particle emitter entity

This is a non-standard entity type extra emitter type, contained within a <emitter> entity of a <library_emitters> at the <COLLADA> level is used to emit particles.

FCollada currently support only one type of particle emitter: <type_spray>, which covers the large majority of cases. The spray particle emitter may define an area in which the particles are created. The particle emitter has a birth rate and defines how to generate the particles. This information applies to both billboard-style particles and geometry-style particles. See the instance description for more information on billboard-style particles and geometry-style particles, since the emitter instance determines the final look of the emitted particle.


Emitted particles are created with a linear velocity, which may be zero and may be modified by forces. See Particle forces FCOLLADA extension for more information on forces. Emitted particles have a material, an independent color, a lifetime and a scale factor. The color and scale factors may change according to the lifetime of the particle.


<type_spray>

Element Attributes Description
<life> variance, sid Contains one floating point value: the average lifetime of emitted particles. The variance attribute adds randomness. A variance of zero implies a constant lifetime for all emitted particles. The sid attribute can be used to animate this parameter.
<size> variance, sid Contains one floating-point value: the average size, in world units, of emitted particles. For flake geometries, this implies a scale factor. The variance attribute adds randomness. The sid attribute can be used to animate this parameter.
<speed> variance, sid Contains one floating-point value: the average size, in world units, of emitted particles. For flake geometries, this implies a scale factor. The variance attribute adds randomness. The sid attribute can be used to animate this parameter.
<color> sid Contains four floating-point values: one factor for each component of a typical color value. The sid attribute can be used to animate this parameter.
<color_var> sid Contains four floating-point values: one variance for each component of the color value. The sid attribute can be used to animate this parameter.
<spawn_multiplier> variance, sid Contains one floating-point value. The variance attribute adds randomness. The sid attribute can be used to animate this parameter.
<spawn_count> Contains one integer value.
<spawn_percent> Contains one floating-point value.
<direction_chaos> sid Contains one floating-point value. Adds randomness to the initial velocity of new particles. The standard direction of new particles is given by the orientation of the scene node containing the emitter instance. The sid attribute can be used to animate this parameter.
<speed_chaos> sid Contains one floating-point value. Adds randomness to the initial speed of new particles. The sid attribute can be used to animate this parameter.
<birth_rate> Contains one floating-point value: the number of particles to emit per seconds. The sid attribute can be used to animate this parameter.
<modifier_list> Complex element. Contains a list of complex particle modifiers. More information on this coming (and below...)
<emit_pos> Complex element. Contains the analytical geometry in which particles are created. If this element is missing or empty, all particles are created one point: the world position of the emitter instance. More information on this coming (and below...)


<modifier_list>

Element Description
<rotation_basic> Contains the parameters for a simple rotation modifier. The particles will rotate around a given axis at an animatable rate.
<rotation> Contains the parameters for a complex rotation modifier. Either or both the velocity and the orientation of particles can be rotated around a given or random axis.
<velocity_align> Contains the parameters for an aligning modifier. The particles will rotate to follow the path of their velocity. This modifier is mutually exclusive with the <rotation> and the <rotation_basic> modifiers.
<random_offset> Contains the parameters for a random translation modifier. The particles will translate by a random amount within a given interval, at random times.
<random_accel> Contains the parameters for a random acceleration modifier.

The particles will accelerate by a random amount within a given interval, at random times.

<generation_size> Contains the parameters for a lifetime-based size modifier. The size of each particles will be scaled according to its lifetime and a given factor.
<colour_tint> Contains the parameters for a particle color modifier. The material of each emitted particles will be blended, according to a given blend mode, with a given animatable color.


<basic_rotation>

Element Attributes Description
<speed> sid Contains one floating point value: the speed at which the particles will rotate around the given axis. The sid attribute can be used to animate this parameter.
<axis> Contains three floating point value: the 3D vector around which the particles rotate, in local space.


<rotation>

Element Attributes Description
<flags> Contains one masked enumerated type value:
  • USE_DEFINED_AXIS = 2
    Whether to apply rotations around the given axis, instead of a random axis.
  • FLIP_STARTING_COORDS = 4
    Whether to randomly multiply the rotation axis by -1.
    Meant to be used with USE_DEFINED_AXIS.
  • APPLY_WORLD_TRANSFORM = 8
    Apply the rotation in world-space instead of rotating in local space.
  • APPLY_TO_ORIENTATION = 16
    Whether to apply the rotation to the screen-facing of the particles.
  • APPLY_TO_VELOCITY = 32
    Whether to apply the rotation to the velocity of the particles
    At least one of APPLY_TO_ORIENTATION and APPLY_TO_VELOCITY should be set.
  • <initial> sid Contains one floating point value: the rotation angle to give to newly emitted particles. The sid attribute can be used to animate this parameter.
    <initial_var> sid Contains one floating point value: the variance in rotation angles for newly emitted particles. This parameters defaults to 2*PI, which implies doubly-fully random angles. The sid attribute can be used to animate this parameter.
    <speed> sid Contains one floating point value: the speed at which the particles will rotate around the given axis. The speed is given in rads per seconds. The sid attribute can be used to animate this parameter.
    <speed_var> sid Contains one floating point value: the variance in rotation speeds. This parameters defaults to PI. The sid attribute can be used to animate this parameter.
    <axis> sid Contains three floating point values: the 3D vector around which the particles rotate, in local space. The sid attribute can be used to animate this parameter.
    <axis_var> sid Contains one floating point values: the variance in 3D rotation axis. This value is in radians and represent the possible derivation of the rotation axis on the unit sphere. The sid attribute can be used to animate this parameter. [editor] Is this a square or a circular derivation?


    Example

    A simple, but complete emitter.

     <extra type="libraries">
       <technique profile="FCOLLADA">
         <library_emitters>
           <emitter id="Emitter">
             <type_spray>
               <life variance="0">1</life>
               <size variance="0">1</size>
               <speed variance="0">1</speed>
               <color>1 1 1 1</color>
               <color_var>0 0 0 0</color_var>
               <spawn_multiplier variance="0">1</spawn_multiplier>
               <spawn_on_death>1</spawn_on_death>
               <spawn_count>1</spawn_count>
               <spawn_percent>0.5</spawn_percent>
               <direction_chaos>0</direction_chaos>
               <speed_chaos>0</speed_chaos>
               <birth_rate>10</birth_rate>
               <modifier_list/>
             </type_spray>
           </emitter>
         </library_emitters>
       </technique>
     </extra>
    

    An emitter with a modifier and a complex emission area.

     <emitter id="Emitter1">
       <type_spray>
         <life1</life>
         <color>1 1 1 1</color>
         <modifier_list>
           <colour_tint>
             <blend_mode>set</blend_mode>
             <color>1 1 1 1</color>
           </colour_tint>
         </modifier_list>
         <emit_pos>
           <area>
             <width>10</width>
             <length>10</length>
           </area>
         </emit_pos>
       </type_spray>
     </emitter>
    

    Particle emitter instance

    Particle emitters are a non-standard entity type. Therefore, they are not contained directly under the <node> element. For more information on how to include the <instance_emitter> element in the scene graph, see Extra entity instances FCOLLADA extension.


    It is the particle emitter instance that will determine the final look and behavior of the emitted particles. There are two types of emitted particles: billboards and geometries. In the case of billboards, they should all start as camera-facing, but a rotation may be appllied to them by the particle emitter. In the case of geometry particles - also called flake geometries - you can imagine that a list of <instance_geometry> is added to the node where the emitter instance belongs.


    <emitter_instance>

    Element Attributes Description
    <flake_geometry> Complex element. Implies that the emitter instance emits geometry-style particles. This element contains may contain only one child: <instance_geometry>. See the COLLADA specification for more information on <instance_geometry>.
    <sprite> Complex element. Implies that the emitter instance emits billboard-style particles. This element may contain only one child: <instance_material>. See the COLLADA specification for more information on <instance_material>.


    Example

       <node id="some_node" type="NODE">
         <extra type="instances">
           <technique profile="FCOLLADA">
             <instance_emitter url="#Emitter">
               <flake_geometry>
                 <instance_geometry url="#small_mesh">
                   <bind_material>
                     <technique_common>
                       <instance_material symbol="polygons1" target="#material1"/>
                     </technique_common>
                   </bind_material>
                 </instance_geometry>
               </flake_geometry>
             </instance_emitter>
           </technique>
         </extra>
       </node>
    


       <instance_emitter url="#Emitter">
          <sprite>
            <instance_material target="#small_mesh">
          </sprite>
    
    </instance_emitter>