Aircraft‎ > ‎

Gauge Conversion

Change List

A list of changes made to this document.

Version Date Revision
 1.008/08/2016
 Initial document.
 1.115/08/2016 Added known issues section.
   

Introduction

Gauge rendering in aircraft simulators built on prior versions of this engine was done using the GDI library. We have movedaway from GDI and now use DirectX for gauge rendering in order to release theCPU from 2D graphics operations. This change has had an impact on a number ofthe XML gauges syntax.

Jobs

The main function of the gauge converter is to take XML gauge files written for aircraft simulators built on prior versions of this engine and convert them to the format required for the new platform, which is very close to the previous format.

The other functionof the converter is to create texture atlases. In order to keep GPU draw callsminimum, small BMPs are packed in bigger textures. 

ModifiedXML tags

  • Image: Regiontag introduced to identify the coordinates (top-left, top-right, bottom-right,bottom-left) of the image in a texture atlas.
  • MaskImage: Mostly unsupported for the time being. At the moment, they are convertedto rectangle clipping of the size of the image.
  • RelativeClipping:Unsupported, the tag is removed in the converted XML.
  • Brighttag: This tag is left untouched however its meaning has changed. When brighttag is used on an image, it indicates that the image will only be rendered inthe emissive pass. See below for more information about emissive textures.

Input/Output

The only input requiredfor the GaugeConverter is the path to the original XML file. For example, opena command window and type "GaugeConverter.exe C:\dev\MyGauge.xml".You can also drag and drop the XML file on the GaugeConverter executable tostart the process.

If the conversionis successful, several files will be created:

  • Theexported XML file will have the same name as the original with "_d3d"before the extension. Example: "MyGauge_d3d.xml". The original filewill be untouched.
  • A logfile will also be created. Example: "MyGauge_conversion_log.txt".This will contain various information, warnings and errors that happened duringthe conversion process.
  • Andfinally one or multiple textures atlases. Each atlas is exported in BMP and DDSformat Example "MyGauge_atlas_0_D.bmp” and “MyGauge_atlas_0_D.DDS".The engine only uses the DDS file but the BMP is also useful if you need tomake changes to the art. If any manual change is made to the BMP atlas, it thenmust manually reconverted to DDS format (DXT3 if you don't need alpha or DXT5otherwise). Note the "_D" and "_E” at the end of texture atlasnames. These letters correspond to Diffuse and Emissive textures.All the images tagged Bright or with _night filename are packed in emissivetexture atlas. All the others go in diffuse textures.

Arguments

Arguments areoptional parameters which can be given to the exporter after the xml file path.They are case sensitive.

  • -keep_black_opaque:By default the converter will assume that pure black colours are transparent.This behaviour originates from legacy code in the engine. To avoid black beingconverted to transparent use this argument.

Diffuse and Emissive Textures

Previous titles built on this engine use two sets of BMPs; one for day and one for night. Both sets are used as diffuse textures. During night time, day textures are swapped for night textures. Going forward, night or bright images are packed in emissive texture maps. They arethen added on top of the diffuse in the pixel shader. For this reason, emissivetexture atlases generated by the gauge converter will give a very bright resultin the engine. This is because the original night or bright textures alsocontain diffuse information which will be added again on top of the day(diffuse) texture. Unfortunately there is no automated process to remove thediffuse information of generated emissive textures and some manual work from anartist is required.

Batch Convert

  • batch_convert.bat:is a script which provided with a folder path, will convert all xml at thespecified location.

Example"BatchConvert.exe C:\dev\MyGaugesFolder"

Known Post-Conversion Issues

  • Converted images with a width or height biggerthan 4096 pixels will not load. Most of images found above this dimension areused for altimeter or airspeed ladders. These are usually seen as long strips.Unfortunately there is no solution yet to convert properly these images. Theway to rework them is to create only a graduated ladder which can wrap aroundand render the text corresponding to the graduation as a gauge string. Thesesteps involve rewriting the gauge element in the xml.


Back to top