Modeling - Getting Started
- 1 Notice for Volunteers
- 2 Getting Started
- 3 Problems and Solutions
- 4 Improving models for best FlightGear performance
- 5 Resources
Notice for Volunteers
See Volunteer#Scenery Model Creators for the main article about this subject.
- We need people to go out and take good pictures of all the buildings at their local airports, build models, and create textures (that could be different people for each task).
- We need people to start modelling identifiable human-made landmarks like bridges, stadiums, and major buildings. Around the San Francisco Bay area, bridges are especially important. Once you have identified some buildings or objects you would like to have (Aircraft carriers, fuel bowsers, cars, towers, ...) you will need to check out the tools for creating and placing these objects.
Generally one can start with a blueprint using their favorite imaging software like Gimp, Photoshop, or Paint shop pro then separate various views (front, back, etc...) into greyscale jpg files. Then import them as a background for easy modelling in your favorite 3D modelling software program.
To begin, you will need to create models in a 3d modeling appliction. Three popular ones are AC3D, Blender and SketchUp. FlightGear can display models in several formats, any format supported by PLIB is acceptable. AC3D is the most popular format for including scenery in Flightgear. Most or all of the default scenery bundled with a Flightgear release are in AC3D format.
If you do not have AC3D, Blender offers many import and export tools. See the Blender website for further information.
Flightgear uses the ac3d model format for objects such as buildings. To create a model, you will need one of two modelling packages. Either go directly to AC3D itself, or use Blender and then convert via a Python script (see below). AC3D seems to be a much easier program to learn, while still being very powerful. The downside is that you have to buy a licence to get more than 14 days use.
Blender is more difficult to learn to use, since it is not quite as intuitive and is far more powerful. However it is GPL'd, and there are lots of tutorials to help with learning.
See Modeling - SketchUp for the main article about this subject.
SketchUp (http://sketchup.google.com) is the easiest to use of these three programs. But the results are very nice and professional. I recommend SketchUp for users who are not really good at difficult computer programs.
See Modeling - Wings 3D for the main article about this subject.
Wings 3D (http://www.wings3d.com/) is another 3D modeling program, and is free open source software.
Placing Objects on Scenery
There are several ways of doing this. The most direct way is to simply add the required data by hand.
The easiest way is to use the UFO's object placement feature (in version 9.10 or higher). When operating the UFO, left-clicking the mouse anywhere on the ground will place an object, and pressing space-up or down will cycle through the models. Coordinates of placed models can then be dumped to the terminal or written to a configuration file.
Another method is to use FlightGear Scenery Designer (Project Site). After setting the paths to your scenery data, simply load up the area where you want to place the object. Load your .ac format model, and right click on the desired spot to place your model there. Export the modifed scenery to save it, rerun Flightgear and your model should be there.
Finding, Creating, or Using Textures
Models in Flightgear use textures with PNG format.
Most image editors support editing PNG files, like THE GIMP, Corel Paintshop Pro, Adobe Photoshop, etc.
The old SGI rgb format (.rgb extension) is no longer supported. (see http://scenemodels.flightgear.org/)
Once you have made your model building, you will want to apply some textures to it, so it looks as realistic as possible. This is possibly one of the hardest areas, as a good model with bad textures will still look bad. Since Flightgear and the scenery data are all released under the GPL, any textures that you use must also be able to be released under this license. This will probably prevent you from just using anything you come across on the net, unless it is already under the GPL. It is quite common for people to state that their pictures or textures are free. Since Flightgear can be sold for profit, and is released on Linux distributions that are sold, check that there are no clauses stating that the item can not be sold or used for commercial use.
Generation of textured light objects in Blender
|See http://members.aon.at/mfranz/flightgear/blender-textured-lights.html for the main article about this subject.|
Problems and Solutions
Improving models for best FlightGear performance
- In a single model, use a single mesh so far as possible. Note that this doesn't mean that every node must be linked to its object with an edge (e.g. a line of trees can be easily a single object.) Only have the separate objects if you need them for an animation or parts that use a transparent texture (any object using more then one texture is anyway spitted by the rendering engine.)
- Delete unseen faces such as faces inside the model, but remember that the Rembrandt renderer needs closed meshes to cast shadows correctly, so you'll often want to keep the ones below.
- Remove "line faces", which are faces whose points are in the same line.
- Don't forget to remove double vertices (i.e. vertices sharing the same coordinates)
- See Howto:Decrease the number of faces.
Single sided / double sided
- Set all the faces of the model to SingleSided. DoubleSided faces are very expensive to render properly. If a face needs to be displayed from every view angle use two faces with opposite normals rather than a Doublesided one (the overhead from the extra geometry is far lower than the overhead of doublesided faces)
Textures and Materials
- Use Materials on Objects instead of textures where possible, but...
- ...avoid mixing textured and untextured geometry in the same model. Build the coloring into the texture map instead. This is to prevent that the object gets split, and anyway, the AC format supports only one texture per object.
- Textures must be a power of two, or they will be resized at loading, and cause issues to some users.
- Avoid using big textures: 512x512 is mostly enough for most models.
- Use a single texture. However, if your model absolutely needs alpha texture and another part of the model is opaque, you should use two textures: one with alpha and the other without.
- Don't use alpha in texture when it is not needed: transparency is not easy to deal with, and often causes artifacts.
- Shader effects (like lightmaps, normalmaps...) and Rembrandt lights are not affordable by everyone's machine, so try to provide alternatives. However, remember also that FlightGear provides options to adjust such effects.
Level of Detail (LOD)
|Note Note that range animations often used for LOD are very expensive (any time you move, every range animation must be evaluated), and give a real advantage only if they remove a very large amount of details (like 1000-2000 triangles), so it's not useful in many cases of for example scenery objects or cockpit details.|
|Tip Instead of using range animations for each little detail you could group many details together and do the range animation for them all, for example having one range animation for an entire cockpit instead of several dozens.|
- If a model has to be detailed to a very high degree, use multiple objects with different levels of detailing, and switch between them based on LOD with a range animation, or split the detailed parts to make them a couple more objects that add details incrementally.
- An alternative, less expensive way to support LOD is applying a select animation, that can hide an object based on some property, for example hiding a cars side mirrors if "detailed" level is at less than 1500m (which is the default), indicating that the user has a less powerful machine. It is less flexible, but allows everyone to enjoy your models.
- With modern graphics cards, the amount of objects can have a higher impact on performance than the amount of triangles/vertices.
- Textures, transparency, .xml included sub-models: The things that kill frame rate in FlightGear. Try to avoid them.
- Also avoid smooth shading when possible, but don't be afraid to use it for curved surfaces where it really has an impact on model quality.