ALS technical notes: Difference between revisions

Jump to navigation Jump to search
Updated aircraft section
(→‎ALS secondary lights: Cleanup section)
(Updated aircraft section)
Line 153: Line 153:


To change position, size and orientation of the bounding box to match with the airplane model, translate, scale and rotate animations or model offsets can later be used.
To change position, size and orientation of the bounding box to match with the airplane model, translate, scale and rotate animations or model offsets can later be used.
=== Model definition for effect ===
This is a standard XML model definition that needs to specify the geometry, all animations and the effect to use. For the geometry you can use the standard ''Aircraft/Generic/Effects/Thruster/thrust_flame.ac'' or make your own. The F-15 uses a slightly different 3D model to allow for the nozzles. The 3D model needs to be big enough to contain the flame, bearing in mind that the flame is drawn as a cylinder.


<source>
<source>
<?xml version="1.0"?>
<?xml version="1.0"?>
<PropertyList>
<PropertyList>
<path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
<nopreview/>
<animation>
  <type>scale</type>
  <x-offset>8.0</x-offset>
  <y-offset>4.0</y-offset>
<z-offset>4.0</z-offset>
</animation>
<effect>
<inherits-from>Aircraft/MyAircraft/Models/Effects/my-flame</inherits-from>
<object-name>Bounding_box</object-name>
</effect>
</PropertyList>
</source>


    <path>Aircraft/Generic/Effects/Thruster/thrust_flame.ac</path>
    <nopreview/>
    <animation>
        <type>scale</type>
        <property alias="/params/augmentation-alight"/>
        <x-min>0.2</x-min>
        <y-min>0.3</y-min>
        <z-min>0.3</z-min>
        <y-max>1</y-max>
        <z-max>1</z-max>
        <x-factor>0.472</x-factor>
        <y-factor>0.6</y-factor>
        <z-factor>0.6</z-factor>
    </animation>
    <animation>
        <type>select</type>
        <object-name>ALS-FlameTrail</object-name>
        <condition>
            <greater-than>
                <property alias="/params/augmentation-ignition"/>
                <value>0.8</value>
            </greater-than>
        </condition>
    </animation>


    <effect>
        <inherits-from>Aircraft/MyAircraft/Models/Effects/my-flame</inherits-from>
        <object-name>Bounding_box</object-name>
    </effect>


</PropertyList>
</source>


Then, a derived effect (my-flame.eff in the above example) has to be created. Here the parameters for the flame are specified. For instance,
=== Effect definition for model ===
To define the effect to apply to the model (as referenced in the ''effect'' section in the model XML) you need to create ''my-flame.eff'' as below. The ''.eff'' file defines the parameters that are passed into the shader and it is these that control how the flame looks.


<source>
<source>
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<PropertyList>
<PropertyList>
  <name>AB-flame</name>
    <name>AB-flame</name>
  <inherits-from>Effects/thrust-flame</inherits-from>
    <inherits-from>Effects/thrust-flame</inherits-from>
  <parameters>
    <parameters>
    <flame_color_low_r type="float">0.95</flame_color_low_r>
        <base_flame_b type="float">0.8</base_flame_b>
    <flame_color_low_g type="float">0.55</flame_color_low_g>
        <base_flame_density type="float">0.6</base_flame_density>
    <flame_color_low_b type="float">0.1</flame_color_low_b>
        <base_flame_g type="float">0.9</base_flame_g>
    <flame_color_high_r type="float">1.0</flame_color_high_r>
        <base_flame_r type="float">0.9</base_flame_r>
    <flame_color_high_g type="float">1.0</flame_color_high_g>
        <deflection_coeff type="float">0</deflection_coeff>
    <flame_color_high_b type="float">1.0</flame_color_high_b>
        <flame_color_high_b type="float">0.8</flame_color_high_b>
    <use_shocks type="int">1</use_shocks>
        <flame_color_high_g type="float">0.85</flame_color_high_g>
    <use_noise type="int">1</use_noise>
        <flame_color_high_r type="float">0.9</flame_color_high_r>
    <thrust_collimation type="float">0.1</thrust_collimation>  
        <flame_color_low_b type="float">0.07</flame_color_low_b>
    <thrust_density type="float">1.0</thrust_density>
        <flame_color_low_g type="float">0.15</flame_color_low_g>
    <base_flame_density type="float">0.1</base_flame_density>
        <flame_color_low_r type="float">0.35</flame_color_low_r>
    <noise_strength type="float">0.2</noise_strength>
        <flame_radius_fraction type="float">0.8</flame_radius_fraction>
    <noise_scale type="float">0.3</noise_scale>
        <noise_scale type="float">0.3</noise_scale>
    <deflection_coeff type="float">0.</deflection_coeff>
        <noise_strength type="float">0.2</noise_strength>
    <flame_radius_fraction type="float">0.8</flame_radius_fraction>
        <thrust_collimation type="float">0.1</thrust_collimation>
  </parameters>
        <thrust_density type="float">0.7</thrust_density>
        <use_noise type="int">1</use_noise>
        <use_shocks type="int">1</use_shocks>
    </parameters>
</PropertyList>
</PropertyList>
</source>
</source>


creates the F-15 afterburner flame shown below:
=== F-15 Afterburner example image ===
The F-15 afterburner flame shown below (at different ambient lighting based on time) uses the parameters above. The main parameters of importance, and therefore to tune, for an aircraft jet engine are the colors, the two densities, the flame radius fraction. The base density is at the start of the flame and this. The F-15 overlays a billboarded image to achieve the diamonds that are interleaved with the ALS drawn flame.


[[File:Flame_f15.jpg|700px|F-15 afterburner flames]]


[[File:F-15 afterburner using ALS Thrust Effect.jpg|700px|This shows the F-15 afterburner at different ambient light.]]


The meaning of the parameter is as follows:
The meaning of the parameters are as follows:


<source>
<source>
Line 219: Line 238:
</source>
</source>


are configuration parameters determining whether random noise should be used for the flame and whether shock diamonds should be rendered. Both are modestly expensive, i.e. if they're not used it's better to switch them off (i.e. set to zero).
*use_shocks* and *use_noise* are the parameters that control the random noise and the shock diamonds. Both are modestly computationally expensive, i.e. if these effects are not required it is better to switch them off by setting these values to zero.


<source>
<source>
308

edits

Navigation menu