A Primer on 3D shapes

Using Airbrush requires that you have some working knowledge of how 3d shapes in general work. If you do not understand terms such as LOD nodes or point normals, you may want to read this section
 
How a 3d shape is put together:

A single shape in FA (a .sh file) is actually a collection of several individual shapes. These "sub shapes" are referred to as meshes. Airbrush does not allow you to work with a shape as a whole -- you can only edit individual meshes. This does not mean that you can't edit all aspects of a shape -- only that you must edit them one at a time.

There are generally two kinds of meshes in an FA shape: Level of detail nodes, and animation nodes.

Level-of-detail nodes (LOD nodes), which are used to speed up the game. By having several representations of an object, each with less detail, it is possible to avoid rendering detail with would be invisible because the shape is too far away from the camera. Look at the LOD nodes of SACRAM.SH:

As you can see, lower levels have fewer polygons, and are thus "cheaper" to draw. By drawing only what will be seen, the game can run a lot faster.

The second type of mesh is an animation node. These are landing gear, flaps, rudders etc. which move independently relative to the shape -- for instance, if you have a plane flying at heading 250, with the rudder deflected 10 degress, the rudder is actually heading 240. In FA, it is usual for LOD 1 (the highest detail LOD) to have several anim nodes, LOD 2 to have only one (the undercarriage), and LOD 3 usually has none (because they would be too small to see at the distances at which LOD 3 is selected).
 
The structure of a mesh:

A shape file is simply a serial sequence of mesh definitions, all tacked on end-to-end. Understanding a single mesh means understanding the lot.

A mesh has two main parts: vector definitions, and polygon definitions. These two together provide the information necessary for the FA and Airbrush rasterizing routines to draw the polygons which come together to make a shape. Although polygons give the shape the physical properties you see (such as colour, shading, texture, etc.), it is in fact the vector definitions which give a polygon its particular shape - the positions in space of the corners of the polygon. Have a look at the following pictures of vectors only, and polygons with vectors overlayed:


Vertices only - they give the mesh its shape


With the edges of the polygons shown, the shape becomes more evident


With polygon material properties on, you have the actual mesh.


Gear, rudder, flaps and other animated things:

Part of the complication of an SH file comes into the fact that the rudders, etc. are in fact represented as separate meshes. So, a shape will have three representations of the rudder - one deflected to port, one amidships and another to starboard. When modifying a shape, you need to edit all of these subshapes, or suddenly your flaps might change colour when they are lowered!

Exceptions to this rule are the sort of animated parts that move smoothly, such as swinging wings, AWACs radomes, and the engines on the Osprey. For these shapes, only one mesh is given.
 
Polygon shading styles:

Not all polygons are rendered using the same techniques. Fighters Anthology uses three techniques of polygon rendering:
 
 

In this image, the canopy is rendered as a texture map (transparent bits are actually drawn in colour 255 in the texture bitmap). The wings and tail surfaces are rendered with flat shading, and the fuselage is Gouraud shaded (which gives it a rounded apperance). Note that the styles can be mixed - the fuselage and wings have both flat (or Gouraud) shading, as well as texture mapping.
  1. Flat shading - this simply draws the entire polygon in one colour, which is selected based on two factors: the basic colour of the polygon (called the flat colour), and the direction of the polygon relative to the sun. Thus, a polygon might have its flat colour be index 128, but its colour on the screen will be more or less than that. The actual range that a polygon takes on (given its flat colour)
  2. Gouraud Shading - This technique looks at light not on the polygon as a whole, but looks at how bright each of the vertices of the polygon is. Then, a continous range is drawn between these colours. Again, the actual colours rendered depend on two factors: the flat colours of the polygon, and the direction of the polygon relative to the sun. Here, the relationship between the sun and the final colours if more complex than in flat shading, because a colour must be chosen for each vertex. To aid in this effort, the shape has point normals stored (a point normal is a vector which is the mean of all the normals of the polygons which share that vertex). Because of this, you cannot add Gouraud shading to apolygon which was not already shaded in this way, because this would entail adding point normals to the shape - which is not possible. Fighters Anthology gouraud shades not single polygons, but  entire convex hulls - groups of polygons forming enclosed (or semi-enclosed) forms. This means that you cannot give different colours to the polygons forming a single hull, because FA assumes that all the polygons in a hull have the same colour. If you try to have multi-coloured hulls, you will see some nifty psychedelic aircraft! The advantage of Gouraud shading is that it blurs the borderlines between polygons, giving the hulls a rounded appearance.
  3. Masked Texture Mapping - FA uses two forms of texture mapping: approximated and depth-corrected (called "best textures" in the graphics preferences screen). The only difference between these two is that approximated mapping texnds to distort if the polygon is large in the frame, while corrected mapping remains accurate regardless of the polygon. The problem is that the depth correction requires a lot of divisions (which are computationally expensive), so this tends to spoil frame rates. Texture mapping requires not only the usual polygon info, but also extra information: the uv-coordinate pairs for each vertex in the polygon. These indicate which part of the texture bitmap correspond to each vertex. So, if you are using the piece of bitmap bounded by (10,24) (30,24) and (15,47)on a polygon, these will be the values for your uv pairs (the numbers correspond directly to the pixel coordinate values in the texture bitmap). The fact that the textures are masked means that they can be "transparent" - that is, pixels in the texture (called texels) which are colour index 255 (which is represented by a funky pink) will not be drawn. Because this uv information is needed, you cannot add texture mapping to a polygon that does not have it - but you can "remove" texturing, by assigning uv painrs to a polygon in such a way that the texture bitmap area enclosed is all colour 255.
Note that often a texture map is superimposed on a flat or Gouraud shaded polygon. This is used for panel lines,etc.

The tail art, nose art and nationality roundels are not textured onto a plane itself. In fact, small, transparent polygons are laid just on top of the body, and these are textured with the roundel or whatever.

Any polygon which is camouflaged (ie. has the bitmap part of th camo on it) is in effect texture mapped. If you want texture rich models, look at these planes first (eg. don't edit the MiG-29 shape, but rather go for the camouflaged (but otherwise identical) MiG-29M shape).