308
edits
Red Leader (talk | contribs) (→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> | |||
<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> | |||
=== 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> | |||
<inherits-from>Effects/thrust-flame</inherits-from> | |||
<parameters> | |||
<base_flame_b type="float">0.8</base_flame_b> | |||
<base_flame_density type="float">0.6</base_flame_density> | |||
<base_flame_g type="float">0.9</base_flame_g> | |||
<base_flame_r type="float">0.9</base_flame_r> | |||
<deflection_coeff type="float">0</deflection_coeff> | |||
<flame_color_high_b type="float">0.8</flame_color_high_b> | |||
<flame_color_high_g type="float">0.85</flame_color_high_g> | |||
<flame_color_high_r type="float">0.9</flame_color_high_r> | |||
<flame_color_low_b type="float">0.07</flame_color_low_b> | |||
<flame_color_low_g type="float">0.15</flame_color_low_g> | |||
<flame_color_low_r type="float">0.35</flame_color_low_r> | |||
<flame_radius_fraction type="float">0.8</flame_radius_fraction> | |||
<noise_scale type="float">0.3</noise_scale> | |||
<noise_strength type="float">0.2</noise_strength> | |||
<thrust_collimation type="float">0.1</thrust_collimation> | |||
<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> | ||
=== 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:F-15 afterburner using ALS Thrust Effect.jpg|700px|This shows the F-15 afterburner at different ambient light.]] | |||
The meaning of the | The meaning of the parameters are as follows: | ||
<source> | <source> | ||
Line 219: | Line 238: | ||
</source> | </source> | ||
are | *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> |
edits