User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sdk:aircraft:modelling [2017/01/30 12:28]
jh [Converting]
sdk:aircraft:modelling [2020/05/10 21:20]
jh [Supported Modelling tools]
Line 1: Line 1:
 ====== Modelling ====== ====== Modelling ======
-===== 3D Model ===== 
-The 3D model is the visible aircraft that displayed on the screen. The 3D model on the computer is a bunch of numbers that define several hundred-thousand points and their connections. Three connected points make one triangle (a tiny bit of surface) and several triangles connected to each other can approximate any shape, e.g. the shape of a certain aircraft part. This collection of triangles is called a mesh and can be imagined as a dense net that spans over the entire surface. Onto the mesh an image (texture) is overlaid to define the coloring of the surface. +===== Robin DR-400 - Example Aircraft =====
-All meshes of the individual parts make up the '3D model' of the aircraft.+
-Of course not each individual point (vertex) is placed by hand. There are software programs that let the user modify primitive geometry (cubecylindersphere,...) into any shape desired. These modelling tools also do a great job of flattening/stretching the 3D surface of triangles into a flat surface so that it becomes easy to assign parts of an image (texture) to a part of the model (uv-mapping).+In the [[sdk:intro|SDK]] we have included an entire aircraft projectthe Robin DR-400including its 3D model and texturesBy following the steps of the [[sdk:aircraft:tutorial|aircraft tutorial]] the necessary development programs will be installed and at the end of the tutorial the DR-400 will be installed as an additional aircraft in the simulator.
-===== Supported Modelling tools =====+> Please note that the 3D model of the Robin DR-400 provided is copyrighted and may not be used for any other purpose then demonstrating how to create aircraft for the Aerofly FS 2.
-Currently (30th January 2017) the Aerofly FS 2 Software Development Kit ([[sdk:intro|SDK]]) supports 3D Studio Max 2010 or higher, Maxon Cinema 4D version 17 and AutoCAD (AC3D) 3D version 8.+===== Preparing a Custom 3D-Model =====
-===== Example Aircraft - Robin DR-400 =====+After installing the [[sdk:intro|SDK]] we will now go through the steps of converting a custom made 3D model from 3Ds Max into the Aerofly FS 2 Flight Simulator.
-In the [[sdk:intro|SDK]] we have included an entire aircraft project, the Robin DR-400, including its 3D model and texturesBy following the few steps of the [[sdk:aircraft:tutorial|aircraft tutorial]] the necessary development programs will be installed and at the end of the tutorial the DR-400 will be installed as an additional aircraft in the simulator.+To achieve an error free export some preparation is needed to be done firstFor the DR400 example aircraft all these steps have already been completed so that this plane can be used as a reference.
-> Please note that the 3D model of the Robin DR-400 provided is copyrighted and may not be used for any other purpose then demonstrating how to create aircraft for the 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.
-===== Preparing Custom 3D-Model =====+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 reference for your projects.  
-After installing the [[sdk:intro|SDK]] we will now go through the steps of converting custom made 3D model from 3Ds Max into the Aerofly FS 2 Flight Simulator+  - Create a new folder using lowercase letters a-z, digits 0-9 and the underscore only (like c172, b747, f4u, …). 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 format supported by the Aircraft Converter (.bmp / .tif / .png / .wav).   
-To achieve an error free export some preparation is needed to be done firstFor the DR400 example aircraft all these steps have already been completed so that this plane can be used as a reference.+  - Prepare the 3D model as described below.   
 +  - Export the 3d model to the intermediate folder using the filename xxxx (this creates the 'xxxx.tgi' file) as described further down.   
 +  - Create the aircraft definition and configuration files. You can create these files from scratch using the section 'Aircraft Definition' in this document as a reference, or you can copy and modify the files from an existing aircraft. If you just want to get the 3d model into the simulator to check the graphics,  simply copy the 'template.tmc' and 'template.tmd' files from the SDK's 'template' folder and rename them to 'xxxx.tmc' and 'xxxx.tmd' respectively. Change the name and description in the .tmc file and replace the entry 'Box' in the GeometryList parameter at the end of the .tmd file by the names of all your geometries.   
 +  - Add the 'model.tmc' file. For the beginning, you can copy the 'model.tmc' from the SDK's 'template' folder and fine tune texture sizes later.   
 +  - Run the aircraft converter. Right click on the 'xxxx' intermediate folder and choose Aerofly FS 2 Aircraft Converter from the context menu and start the conversion  
 +  - Your new aircraft is available in Aerofly FS 2 nowTest and refine the dynamics, graphics and sounds as desired 
 ==== Single 3D Model ==== ==== Single 3D Model ====
Line 100: Line 103:
   * The material now has a 'Custom Attribute' where you can enter the desired tags.\\ {{ :sdk:sdk_max_shader.png?200 |}}\\    * The material now has a 'Custom Attribute' where you can enter the desired tags.\\ {{ :sdk:sdk_max_shader.png?200 |}}\\ 
 +==== Propeller ====
 +Aerofly FS 2 needs two models for the propeller. First is the static / solid model including the spinner / hub and the blades as separate objects. Second is the propeller disk, this is the blurred hull of the spinning propeller. The propeller disk needs to have a planar mapping from the front such that the disk fills the UV unit square. The corresponding texture is applied to the prop disk such that the bottom is at the center and the top is at the tips, left side is facing forward and right side is applied onto the back. Refer to the DR-400 example aircraft and the 'prop_color.bmp' for an example.
 ===== Exporting from 3D Studio Max ===== ===== Exporting from 3D Studio Max =====
Line 120: Line 126:
 The same folder contains the converter's log file 'tm_aircraft_converter.log', which sometimes is helpful for troubleshooting, as well as the 'report.txt' in the aircraft's intermediate folder. The same folder contains the converter's log file 'tm_aircraft_converter.log', which sometimes is helpful for troubleshooting, as well as the 'report.txt' in the aircraft's intermediate folder.
 +===== Aircraft 3D Modeling Guidelines =====
 +We use the following 3d modeling guidelines for the aircraft in Aerofly FS 2 and provide them for reference. These requirements are not mandatory and you can get an aircraft into Aerofly FS 2 without adhering to each requirement (none of our models adheres to all). However, experience has shown that these best practices make it easier for all people involved in the project and create models that run smoothly on all platforms. If you ever plan to release your aircraft for different platforms, it is strongly recommended to fulfill as many requirements as possible.
 +==== Summary ====
 +An aircraft model for Aerofly FS 2 includes the exterior and interior in one model. The overall polygon budget is 400k triangles and 200k vertices. The total compressed texture amount is in the range of 150 MB; this allows up to 2 GB of uncompressed textures at a resolution of 4069x4096. A unique, non-shared, non-degenerate texture mapping is required for ambient occlusion, illumination and texture baking. The mesh has a clean topology without T-junctions and long triangles. The dimensions are correct and the model is set up using generic units, where one generic unit corresponds to some metric unit.
 +The following guidelines should clarify what we consider being a clean model and should help to integrate a model into Aerofly FS 2. None of our aircraft models adheres to all items entirely, but this is what to aim for to have the finest aircraft in Aerofly FS 2.
 +==== Mesh ====
 +  *Single model that contains both exterior and interior (there is no separate virtual cockpit)  
 +  *Overall polygon budget: 400k triangles (not polygons!) / 200k vertices for everything.  
 +  *+X axis is forward, +Y axis points to the left, +Z is up  
 +  *Center of the coordinate system is approximately at center of gravity (don't have the wheels at Z = 0)  
 +  *Aircraft has to be modeled in the clean configuration: flaps up, control surfaces neutral, gear doors closed, wing unloaded (no wing flex in the 3d model, this will be done by the sim). Landing gear needs special treatment: this is modeled in extended and loaded position.  
 +  *Switches, knobs, pointers, ... : model in a position that corresponds to their position in normal flight configuration, i.e. engine switches on, temperature and oil pressure needles in green arc, systems switches auto / on, transponder on and encoding, fuel and packs on, ...  
 +  *Plan ahead and make a polygon budget for different sections (fuselage/gear/wings/cockpit/...) don't start at a small detail, then work up at the same detail level and end up with too many triangles  
 +  *No single object larger than 50k triangles / 50k vertices.  
 +  *Get the dimensions right from the very beginning, this is very hard to fix later. Don't start with some small detail and work up from there.   
 +  *Use generic units in 3ds max. One generic unit corresponds to either 1mm, 1cm, 10cm or 1m real world size (all other units in max are language dependent and will change if opened on another computer with different settings)  
 +  *Depending on the dimensions of the real aircraft, use one of the scalings given above that fits your workflow best (consider near/far clipping in max, camera movement, displayed coordinates, enough precision for small details, ...)  
 +  *Check pilot's seat and controls position and dimensions using a pilot's model at an early stage.  
 +  *Object naming conventions:\\ - Name starts with an uppercase letter, followed by a-z, A-Z, 0-9 only.\\ - No spaces, no underscores, no minus/hyphen '-', no special characters whatsoever.\\ - Capitalize the first letter of a word (camelback): LeftWingLight2, FrontGearDamper, ...\\ - Use expressive names, don't use abbreviations in object names like LtLtKnb, use LeftLightKnob\\ - Each object has to have a unique name.  
 +  *Anything that will be animated separately has to be a separate object. If in doubt, use more objects and give them reasonable names.  
 +  *Clean meshes:\\ - No t-junctions\\ - No long triangles  
 +  *There are no hard edges in reality: use 45 deg bevels of 0.5 - 1.0 mm in the cockpit where necessary. Apply smoothing groups 31 or 32 to the bevel and use hard edges, Aerofly will create smooth normals and leave the normals of the adjacent faces intact (or use your favorite plugin to achieve this, sometimes this if preferable for rendering of ambient occlusion maps)  
 +  *Support wing flexing: use divisions/cuts running from the leading edge to the trailing edge across the wing and flaps/ailerons.  
 +  *Skinning is supported by applying vertex weights. Use a bone system with Bone 0 and Bone 1 to apply the weights.  
 +  *Use animations for control surfaces, flaps, landing gear, levers, knobs, ... to check the model and help setting up the aircraft in Aerofly. Keyframe 0 is the frame that will be exported, make sure object positions and orientations are as defined above.   
 +  *Keep future versions in mind: e.g. different versions with different fuselage lengths.  
 +==== Textures ====
 +  *Only use power of two square textures: 32x32, ... , 256x256, ... , 4096x4096  
 +  *Supported texture file types: BMP (24bit), TIF / PNG (24/32/16/48bit)   
 +  *Total texture amount:\\ - compressed textures 35 MB for mobile (mainly 1024x1024)\\ - 150 MB for desktop (mainly 2048x2048) this corresponds to about 2 GB of total textures for uncompressed 4096x4096 bmps / tiffs (about 40 4096x4096 textures or six main materials)\\ - some materials don't need large maps, usually you will end up with 20 - 30 materials  
 +  *Texture default size should be 4096x4096 for main maps. However, keep in mind that text has to be readable at the 1024x1024 for mobile devices (cf. UV mapping guidelines below)  
 +  *RGB color values 0 .. 255:\\ use values in the range 8 .. 16 for black surfaces, values smaller than 8 only for holes 232 corresponds to a pure white, values above 232 (in any channel) will add a fluorescent/neon look to the material.  
 +  *Use compression friendly color values for large uniform areas.  
 +  *Compression noise can be suppressed by adding some noise (use cautiously).  
 +  *Use noise, dirt, scratches at those locations where it makes sense, don't apply these everywhere  
 +  *Don't use parts of photos as textures.  
 +  *Don't bake illumination/highlights into textures.  
 +  *Keep textures mipmap friendly: no bright objects on a dark background and vice versa, leave room for a little border, adjust background to object color.  
 +  *Bumpmaps are pieces of art of their own, don't create them simply from an image or color layer.  
 +  *Same holds for specular (color+alpha): these are not just black and white versions of the color layer.  
 +  *All maps for one material go into a single psd, use groups for specular, ambient, color, ...  
 +  *Example for grouping in psd file:\\         UVW Templates\\         Checkerboard\\         Illumination\\         Light/Luminace\\         Reflection\\         Specular\\         Ambient\\         Bump\\         Alpha\\         Dirt\\         Markings\\                 Integral lighted\\                 Unlit\\         Details\\         Paint\\                 Airlines\\                     Repaints          Background (differently colored patches to support mipmapping)  
 +  *Keep rendered layers (ambient/illumination) in psd, don't edit these layers (re-render if necessary)  
 +  *Use 16 bit bump maps where necessary to avoid terracing.  
 +  *If you prefer to work with bmp files, you can use _alpha to add an alpha channel to a rgb bmp: xxx_color.bmp and xxx_color_alpha.bmp will be combined into a four-channel texture\\   
 +==== UV Mapping ====
 +  *Plan ahead: use your texture budget reasonably.  
 +  *Unique mapping is required for ambient occlusion and illumination.  
 +  *UV sharing:\\ - only for identical geometries exactly at the same UV location (clone objects after UV mapping)\\ - only if these objects never need different ambient occlusion or illumination  
 +  *Uniform mapping:\\ - minimize stretching/distortion\\ - use the same resolution/pixel density in world space for objects close to each other use checkerboard textures to verify  
 +  *Pay attention to the pilot's view: resolution for instrument panel and objects in pilot's view: 4-6 pix/mm for 4096x4096 textures.  
 +  *Exterior UV mapping: fuselage should be mapped contiguously on one texture for aircraft up to the size of an A320, cut into two parts for larger aircraft. This defines the resolution for other exterior parts like wings, stabilizers, engines, ...  
 +  *Keep the uv mapping repaint friendly. Use a small texture for pieces in the cockpit that can change with a repaint (e.g. registration number).  
 +  *Use grouping of similar objects for better mipmapping.  
 +  *Group objects reasonably: don't put small objects onto another texture just because there's some space left.  
 +  *Leave a border around objects for better mipmapping.  
 +  *Preferably map all parts visible from the main forward view onto the same texture, we can boost the size of this important texture if everything in the main view gets sharper.  
 +  *Clean mapping:\\ - no degenerate UV faces\\ - minimize cuts  
 +  *Use a separate texture for displays (display_luminance) and things that will be animated.  
 +  *Use tiling for some materials/layers to save texture memory without sacrifycing resolution (the underlying mapping must still be unique for ambient occlusion).  
 +  *Don't squeeze too much into one texture, leave room for mipmapping, baking and future changes/additions.  
 +==== Decals ====
 +  *Use decals for small details only. Don't use decals for large logos.  
 +  *Place 0.2 - 1.0 mm in front of mesh.  
 +  *Underlying mesh still must be closed and uniquely mapped (so we can render the decal into the base map if necessary)  
 +  *A smaller and lower resolution version of the decal can be included in the base texture (to avoid popping if decal is culled at some distance or with z-fighting)  
 +  *Don't cut decal into the underlying mesh.  
 +==== Materials ====
 +  *The standard material supports:\\   
 +| Function | 3ds max slot | Texture file suffix |
 +|       |
 +| diffuse / color | Diffuse Color | _color |
 +| specular color + width | Specular Color | _specular |
 +| reflection/gloss | Reflection | _reflection |
 +| ambient occlusion | Ambient Color | _ambient |
 +| bumpmap | Bump | _bump |
 +| (self-)luminance | Self-Illumination | _luminance |
 +| illumination | Filter Color | _illumination |
 +  *Materials can be tagged to select the best shader:\\ exterior\\ interior\\ glass\\ standard\\ default\\ darken\\ canopy\\ instrument\\ window  
 +  *Multi-materials are deprecated: no need to use them.  
 +  *Every material should correspond to exactly one material ball in max's material editor, all materials must be visible in editor.  
 +  *Use bump mapping (normal maps are supported, bump mapping is more flexible and better suited for future gimmicks). Object space normals are not supported.  
 +==== File Names ====
 +  *File and folder names: allowed characters are lowercase letters a-z, digits 0-9 and underscore only.  
 +  *Never use capital letters, spaces and special characters in file names.  
 +  *Don't include the aircraft's name in texture names (don't use 'f15_xxxx_color.bmp').  
 +  *Current max file is named like 'f15_2015-06-18_56.max'
sdk/aircraft/modelling.txt · Last modified: 2020/05/10 21:20 by jh