sdk:scenery
Differences
This shows you the differences between two versions of the page.
Next revisionBoth sides next revision | |||
sdk:scenery [2017/01/16 11:51] – created aerofly | sdk:scenery [2017/01/16 11:52] – aerofly | ||
---|---|---|---|
Line 179: | Line 179: | ||
However, the SDK doesn' | However, the SDK doesn' | ||
- | |||
- | ===== Creating an Aircraft for Aerofly FS 2 ===== | ||
- | |||
- | ==== Overview ==== | ||
- | |||
- | This overview shows the necessary steps to get an aircraft model from a 3D design software like 3D Studio Max or Cinema4D into Aerofly FS 2. The steps are described in more detail later in this chapter. | ||
- | |||
- | Steps 1. to 6. have already been done for the example aircraft that comes with this SDK so that you can start with step 7. right away and use the example aircraft as a reference for your projects. | ||
- | |||
- | - Create a new folder using lowercase letters a-z, digits 0-9 and the underscore only (like c172, b747, f4u, mustang, …). This folder will be referred to as the intermediate folder. The name of this folder will be the internal name of the aircraft (the name displayed in the aircraft menu can be set later) and determines the names of several files. In the following, we will choose the name to be xxxx. | ||
- | - Copy and/or export all necessary source texture and sound files to the intermediate folder. The files must be in a format supported by the Aircraft Converter (.bmp / .tif / .png / .wav). | ||
- | - Prepare the 3D model as described below. | ||
- | - Export the 3d model to the intermediate folder using the filename xxxx (this creates the ' | ||
- | - Create the aircraft definition and configuration files. You can create these files from scratch using the section ' | ||
- | - Add the ' | ||
- | - Run the aircraft converter. Right click on the ' | ||
- | - 8.Your new aircraft is available in Aerofly FS 2 now. Test and refine the dynamics, graphics and sounds as desired. | ||
- | |||
- | ==== Preparing the 3D Model ==== | ||
- | To achieve an error free export some preparation is needed to be done first. For the DR400 example aircraft all these steps have already been completed so that this plane can be used as a reference. | ||
- | |||
- | === Single 3D Model === | ||
- | Aerofly FS 2 works with just one 3D for an entire aircraft; there is no need to provide an external and internal model separately. The Aerofly FS 2 engine is optimized to draw only those objects that are in the view of the camera. | ||
- | |||
- | === Generic Modeling Units === | ||
- | The units of the aircraft model should be set to ' | ||
- | |||
- | === Alignment and coordinate system === | ||
- | The aircraft should be aligned to the x-axis as the forward flight direction, the positive y-axis towards the left and the positive z-axis pointing upwards. The origin of the model coordinate system should be placed close to the center of gravity. | ||
- | |||
- | Animated objects should have their axis and rotation pivots set to a plausible location. Hinged objects should have their local origin in their hinge location. The pivots and axes set in 3D Studio Max will be exported to the log files which will be used later on to animate the objects in the graphics section of the .tmd file. | ||
- | |||
- | Animated objects should be positioned in the following neutral positions before export: | ||
- | *control surfaces neutral, flaps up | ||
- | *gear down and compressed as if the aircraft would stay on the ground | ||
- | *gear doors closed to assure perfect alignment when the gear is retracted in flight | ||
- | *cabin doors and windows closed | ||
- | *knobs and switches that are not planned to be animated should be in an in-flight position | ||
- | *switches and knobs that will be animated are best exported in their off state | ||
- | *instrument needles point to zero or neutral depending on the instrument | ||
- | *magnetic compass points towards 090 degrees (East). This is needed because the x-axis of the global coordinate system of the Aerofly FS 2 points towards the East as well. | ||
- | |||
- | === Individual objects === | ||
- | All animated objects like the control surfaces (rudder, aileron, elevator) and trim rudders, switches and knobs, gear parts and so on have to be individual objects in the 3D model so that they can be animated independently from each other. The Aerofly FS 2 rendering engine is optimized to merge objects in the same GeometryList when the aircraft is loaded, so there is no real benefit combining objects. Experience has shown that development time can be reduced if all switches and knobs are available as individual objects right away and the model doesn' | ||
- | |||
- | Display screens have to be separate objects so you can set the display brightness independently of the background lighting later. | ||
- | |||
- | === Object naming conventions === | ||
- | 3D objects will be referenced by their name for display and animations, so it is essential that each object has a unique name. Objects should be named logically, and the name must not contain spaces or special characters (it is recommended to use A-Z, a-z, 0-9 only). While the object names have no meaning to the simulation, it is easier for everyone working on the project to use standardized names. We use the ' | ||
- | |||
- | Advisable names are e.g.:\\ Fuselage, LeftWing, LeftAileron, | ||
- | |||
- | === Materials === | ||
- | Materials are defined by the set of textures they use and by tags or hints that describe the intended usage. A simple material just needs a diffuse texture, but Aerofly FS 2 also supports ambient, specular, bump/ | ||
- | *Diffuse: diffuse color. An optional grayscale ' | ||
- | *Ambient: ambient color. This is a separate grayscale RGB map. | ||
- | *Bump: bump map if texture name ends with ' | ||
- | *Specular: specular highlight color and strength. Color and strength are given by RGB values of the texture, specular highlight width is controlled by the alpha channel | ||
- | *Reflection: | ||
- | *Self-Illumination: | ||
- | *Filter Color: illumination. RGB channels encode the illumination strength/ | ||
- | |||
- | We use the suffixes ' | ||
- | |||
- | === Textures === | ||
- | All textures must be square power-of-two images with a pixel depth of 24-bit RGB .bmp, 24/32-bit .png or .tif files. Bump maps can be 16-bit grayscale textures. There is no support for .psd files in the converter, the different layers for diffuse, ambient, .. have to be exported to the intermediate folder first. You can keep a .psd file assigned to a texture slot in the 3D software if it has the name as the bitmap file except for the suffix. | ||
- | |||
- | It is recommended to create all textures at a resolution of 4096x4096 or even 8192x8192 pixels, and use the appropriate converter setting to reduce the actual size used in the simulator. The smallest size recommended is 32x32 pixels, the maximum supported texture resolution by the engine is currently 4096x4096px. The total compressed texture amount should be in the range of 150 MB to ensure compatibility with all platforms. The final texture resolution can be set in the ' | ||
- | |||
- | === Refresh Texture assignments === | ||
- | If necessary, refresh the texture assignments in the 3D modeling software to use the exported textures in the intermediate folder. Again, you can keep a .psd file assigned to a texture slot in the 3D software if it has the name as the bitmap file except for the suffix. The converter ignores the texture suffix, so you can change from .bmp to .tif without changing or exporting the 3D model again. | ||
- | |||
- | === Material Tags or Hints === | ||
- | Each material can define tags or shader hints to support the selection of the best shader when the aircraft is loaded. Shader hints can be combined to describe the material properties as precise as possible. Currently, the following shader hints are supported: | ||
- | |||
- | | exterior | everything that is not in the cockpit/ | ||
- | | interior | everything that is in the cockpit and cabin, inside of windows and canopy | | ||
- | | default | | | ||
- | | standard | | | ||
- | | glass | | | ||
- | | canopy | | | ||
- | | window | | | ||
- | | instrument | | | ||
- | | darken | | | ||
- | |||
- | The hint can be added to a material in 3D Studio Max as follows: | ||
- | |||
- | - Select an object that uses the selected material | ||
- | - Open ' | ||
- | - Select 'Add to Type' -> ' | ||
- | - Select | ||
- | - Enter ' | ||
- | - Click the ' |