sdk:aircraft:modelling
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
sdk:aircraft:modelling [2017/01/30 12:24] – [Converting] jh | sdk:aircraft:modelling [2017/06/20 10:36] – borchers | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Modelling ====== | ====== Modelling ====== | ||
- | ===== 3D Model ===== | + | ===== Supported Modelling tools ===== |
- | 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 | + | Currently |
- | 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 (cube, cylinder, sphere,...) into any shape desired. These modelling tools also do a great job of flattening/ | + | ===== Robin DR-400 |
- | + | ||
- | ===== Example Aircraft - Robin DR-400 ===== | + | |
In the [[sdk: | In the [[sdk: | ||
Line 14: | Line 11: | ||
> 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. | > 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. | ||
- | ===== Supported Modelling tools ===== | + | ===== Preparing a Custom |
- | + | ||
- | Currently (30th January 2017) the Aerofly FS 2 Software Development Kit ([[sdk: | + | |
- | + | ||
- | ===== Bringing the Model into the Aerofly FS 2 ===== | + | |
After installing the [[sdk: | After installing the [[sdk: | ||
- | ==== 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. | 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 === | + | ==== 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 ' | ||
+ | - Your new aircraft is available in Aerofly FS 2 now. Test and refine the dynamics, graphics and sounds as desired. | ||
+ | |||
+ | ==== 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. | 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 === | + | ==== Generic Modeling Units ==== |
The units of the aircraft model should be set to ' | The units of the aircraft model should be set to ' | ||
- | === Alignment and coordinate system === | + | ==== 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. | 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. | ||
Line 46: | Line 53: | ||
*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. | *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 === | + | ==== 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' | 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. | Display screens have to be separate objects so you can set the display brightness independently of the background lighting later. | ||
- | === Object naming conventions === | + | ==== 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 ' | 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, | Advisable names are e.g.:\\ Fuselage, LeftWing, LeftAileron, | ||
- | === Materials === | + | ==== 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/ | 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 ' | *Diffuse: diffuse color. An optional grayscale ' | ||
Line 68: | Line 75: | ||
We use the suffixes ' | We use the suffixes ' | ||
- | === Textures === | + | ==== 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. | 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 ' | 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 === | + | ==== 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. | 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 === | + | ==== 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: | 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: | ||
Line 100: | Line 107: | ||
* The material now has a ' | * The material now has a ' | ||
- | ==== Exporting from 3D Studio Max ==== | + | ==== 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 ' | ||
+ | |||
+ | ===== Exporting from 3D Studio Max ===== | ||
If you haven' | If you haven' | ||
*10 if the one generic unit in 3D Studio Max corresponds to 1 mm | *10 if the one generic unit in 3D Studio Max corresponds to 1 mm | ||
Line 110: | Line 120: | ||
{{ : | {{ : | ||
- | ==== Converting ==== | + | ===== Converting |
When you have collected all required files for an aircraft in the intermediate folder, run the aircraft converter: right click on the ' | When you have collected all required files for an aircraft in the intermediate folder, run the aircraft converter: right click on the ' | ||
Line 119: | Line 129: | ||
The same folder contains the converter' | The same folder contains the converter' | ||
+ | |||
+ | ===== 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: | ||
+ | *Switches, knobs, pointers, ... : model in a position that corresponds to their position in normal flight configuration, | ||
+ | *Plan ahead and make a polygon budget for different sections (fuselage/ | ||
+ | *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, | ||
+ | *Check pilot' | ||
+ | *Object naming conventions: | ||
+ | *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/ | ||
+ | *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/ | ||
+ | *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/ | ||
+ | *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/ | ||
+ | *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): | ||
+ | *All maps for one material go into a single psd, use groups for specular, ambient, color, ... | ||
+ | *Example for grouping in psd file: | ||
+ | *Keep rendered layers (ambient/ | ||
+ | *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/ | ||
+ | *Pay attention to the pilot' | ||
+ | *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, | ||
+ | *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' | ||
+ | *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/ | ||
+ | *Don't squeeze too much into one texture, leave room for mipmapping, baking and future changes/ | ||
+ | |||
+ | ==== 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/ | ||
+ | | 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' | ||
+ | *Current max file is named like ' |
sdk/aircraft/modelling.txt · Last modified: 2020/05/10 21:20 by jh