Howto:Texture a building

From FlightGear wiki
Jump to: navigation, search

In this howto I'll show how I texture a FlightGear building using Blender and Gimp. I'll assume you're quite familiar with them both - knowing how to use UV maps in Blender and Layers in Gimp for instance - and can therefore follow my method.

There are no images in this article. For examples see San Francisco International Airport (KSFO) terminal 2 (the control tower) or London Gatwick Airport (EGKK).

Approach

Variety, randomness and non-uniformity in textures give models a more natural appearance. Use the burn, dodge and blur tools wherever you can and slightly modify textured areas. Lighten edges and darken corners, introduce shadows, subtly change hues and bravely blur details. Darken edges in contact with the ground and add random highlights at corners and horizontal surfaces. Make the observer's eye and brain work a little more and (s)he will often assume that the fuzz contains more than it actually does. Give him(er) sharp lines and pure tones and (s)he will just see unrealistic forms. Of course, if you have your own photographs of building elevations then your work is much easier.

Blender

Modelling

I guess you've almost finished constructing your model in Blender saving regularly as you go along (F2, +, Enter). If in doubt at any stage, simplify entities as simple geometric forms and add as much detail as you wish (future PCs will always be able to handle whatever you construct and low power users can always opt for another model). Remember to get the scale of your model correct. An alternative estimate of height is to make each storey (floor) 3m high or try importing an existing building and sit it by the side of yours.

For this howto I chose an existing, simple FG model - $FG ROOT/Models/Industrial/Industrial50x100.ac which is not yet textured. In Blender I combined the two object meshes (Ctrl+J) to make UV mapping easier. Looking at the model in Blender I also saw that I could merge several vertices (select, Mesh, Vertices, Merge, At Center). This reduced vertices from 26 to 14 without changing the model. I increased the roof overhang which was not prominent so it was considered better to exaggerate it a little - every little bit of complexity adds to the realism in FG. Right, that's the modelling done now to bring it to life with texturing.

UV Maps

Create a UV map by selecting all vertices (A) in Edit Mode (Tab) and using Blender's powerful UV generator (Mesh, UV Unwrap, Unwrap (smart projections). Quite often the UV map layout seen in the UV/Image Editor window is not suitable for full utilisation of available texture space; so the UV maps need manipulation, as described later.

UV Alternative Method

  1. Build up the UV map by first selecting one face and projecting it exactly as it is seen in the Edit view (Mesh, UV Unwrap, Project From View).
  2. Repeat this for each face and chosen an appropriate view from which to project - thus building up the whole UV mapping of the model. It is convenient to move each UV map away from the grid area to avoid them being sat on top of each other before organizing them back on the grid in an efficient layout.
  3. Finally, check there are no isolated UV's by selecting all vertices which then displays all the UV maps.

Organize UV Maps

In either case the next job is to tidy up the positions of the UV maps so that the available space is utilised most efficiently. This can take some time but is a worthwhile process. The aim is to make most use of the UV grid available, so start with the most important aspect of the building and give it the largest area - in this case the side that would normally be seen from your aircraft.

  1. Select each UV map (Ctrl+L), resize it if necessary (S) and grab it (G) and move it into position until all maps are located so that the grid area is fully used. Superimpose the long wall on top of each other to make the best use of space. Also do the same the same with the end walls, gable ends and roof.
  2. Change things a little, if necessary, as you go along but it is worth the effort. A neat trick is to expand the UV maps of the long walls outside the grid area so that a single texture area can be repeated thus giving much more detail to your building (some adjustments can be done in Blender later).

Export UV Map

When you’ve created a compact UV map layout on the grid export it ready for painting the textures (UV/Image Editor view, A, UVs, Scripts, Save UV Face Layout, Size:512, OK, Industrial50x100_new.tga). Keep Blender open because you will be doing an iterative process later.

Gimp

  1. Open Gimp and open the Industrial50x100.tga file and use this as the base for the texturing.
  2. Create a new layer (Layer, New, colour) and fill the layer with the main colour of the building - say a warm tan-grey. This is eventually going to be lightened, darkened and smeared to give variety.
  3. Set the opacity of the layer so that the underlying Industrial50x100.tga layout can be seen (60%).
  4. Save the file regularly as Industrial50x100.xcf.

Texturing Strategy

Details of the building are then painted. This is where you use knowledge and observation of the real world. For example: no areas are completely uniform, there is variety everywhere, there are subtle changes in hue (colour values) in everything and hardly ever are colours seen in pure form. If in doubt, always tone things down, blur details and add a little blue to make things blend into the distance. Weathering is important too, most entities are bleached by the sun, smeared by the rain and generally age. If in doubt, do it (you can't do worse than the gaudy, uniform tones of many models).

Walls

  1. Create a new layer called “walls“ (Layer, New Layer, walls).
  2. Switch the grid on (View, Show Grid) and adjust to show many lines (Image, Configure Grid).
  3. Draw several vertical corrugated sides using the Pencil tool, dark tone and keep them straight (click and Shift) using the grid as guide.
  4. Select the drawn area, copy and paste it as a new layer.
  5. Position the new layer alongside thus creating a larger corrugated wall area.
  6. Repeat pasting and creating new areas a number of times until the corrugated area is complete. During this process, laterally invert a couple of the layers to give variety. Merge Down the layers until one corrugated layer is left.
  7. Mildly Burn and Dodge this layer randomly to give more variety. Blur a little to add subtlety.
  8. Copy the layer (Layer, Duplicate Layer, wall_end (.... and ...., gable)) and position over the gable and end wall regions and use the Eraser to create suitable shaped areas.
  9. Subtly darken, lighten and blur the lines again in random areas to give variety.
  10. Select the colour layer, using the Rectangle Select tool and select a single wall area in between the vertical lines and, using the shift key, select another wall area nearby.
  11. Still holding the shift key down, repeat this a dozen or so times so that the colour layer has a number of randomly selected rectangular areas. Change them in hue a little (Colors, Hue saturation) and also Burn and Dodge a little then switch the selection off (Shift+Ctrl+A).

Roof

  1. Create a layer for the roof lines (Layer, New Layer, roof) and draw them in a different style from the wall lines (again to add variety).
  2. Treat the roof lines in a similar manner to the wall lines: random darken, lighten, blur.

Rooflights

  1. Create a “rooflights” layer (Layer, New Layer, rooflights).
  2. Select a small rectangular area and fill it with dark blue.
  3. Burn this a little over part of the area then Blur it a little.
  4. Use the Pencil tool to draw a frame around the edges of the rectangle in a lighter and slightly different colour. Always change colours and tones a little to randomize the visual effects.
  5. Still with rectangular area selected, copy and paste as a new layer.
  6. Move it a slight distance along the roof in between the joints.
  7. Switch the selection off.
  8. Duplicate the rooflights layer a number of times, occasionally laterally inverting the layer, and position along the roof to create a row of roof window lights.
  9. Merge Down the layers to give just one rooflights layer.

Windows

Similarly to above, a "windows" layer is created and windows are painted.

  1. Once the window frames are drawn over the varied glass tones randomly select (holding down the Shift key) a number of the rectangular window panes and use the Dodge and Burn tools in a casual manner to give more variety to the panes; add extra highlights to give the impression of the reflected sky, for example.
  2. Copy the first window, paste, layer and change it slightly to make it subtly different.

Doors

  1. Create a "doors" layer paint a rectangular area slightly different in hue from the wall colouring.
  2. Create a line layer created over the top of this on which a few horizontal lines can be drawn to represent joints in the roller door. Copy these to give enough lines to cover the door.
  3. Darken, lighten and blur these lines in a non-uniform manner.
  4. A personnel door should also be constructed - another hue with more darkening, lightening and blurring.

Shadows

Make a "shadows" layer and add overhang shadows with the airbrush set at 15% opacity. Blur the bottom edges.

Weathering

  1. Merge all the layers as "day" ready to check, add final details, weather and create night textures.
  2. Check that the alpha layer works by Erasing a small area to reveal a chequered background.
  3. Carry out weathering by using the Burn tool along the ground edges and Smudging a little.
  4. Lighten the corners and add one or two specks of highlight on roof fittings.
  5. Do a final pass with the Burn tool over corner areas.

Iteration

During all the operations above, save the texture file as Industrial50x100.png and reload it in Blender and view it on the model to see how it is progressing (View, Texture Mode).

Night Textures

  1. Resize the "day" layer to 512 width 256 height (Layer, Scale Layer, unlock link).
  2. Carefully position the layer exactly on the bottom of the working square.
  3. Duplicate the resized layer and name it "night" and move it exactly on to the top edge of the square.
  4. Create a new layer called "dark" and colour it almost blue-black.
  5. Sort the layers so that the "day" layer sits at the top with the "dark" layer next and the "night" layer at the bottom.
  6. Add another layer at the bottom called “light”. Colour it pale yellow.
  7. Adjust the opacity of the "dark" layer so that detail on the "night" layer could be seen underneath.
  8. Select the window areas so that the corresponding areas on the "dark" layer can be Erased leaving the windows showing through.
  9. Keep the areas slected and move to the “night” layer and Erase the windows leaving the pale yellow “light” layer showing through.
  10. The windows may then be modified a little by Dodging and Blurring.
    • Paint the window frames in black. (A drawing guide can be made by making a copy of the "night" layer but often, a guess is good enough).
    • Treat the rooflights in the same manner.
    • A similar procedure is carried out to create half opened doors.
    • Lights falling on walls may be created by using the Eraser at 10% opacity and gently revealing details under the "dark" layer.
    • Another technique is to use the Overlay mode whilst Airbrushing very pale yellow around window and door edges to give a slight glare or hazy appearance.
  11. Increase the "dark" layer opacity back to about 94% before finally saving the file as Industrial50x100.png to give the texture for use on the Blender model.

Blender again

  1. Make one more visit to the Blender model to change the UV maps to coincide with the textures. Select all the UV maps in the UV/Image Editor and scale by a factor of 0.5 in the Y direction (S, 0.5, Y).
  2. Carefully grab and position exactly on the bottom of the grid square (G, Y). The UV maps are then on the bottom of the UV grid square with the "day" textures sat exactly on the top and ready for the switch to "night" textures with .xml file.
  3. Export the model as Industrial50x100.ac.

XML

A xml file is needed to switch on the night textures at the correct time. Copy an existing xml file and change the appropriate lines for model and texture. Because the textures were made in this model to repeat horizontally, the swipe of the textures has to be in the Y direction.

Testing

Copy the files Industrial50x100.ac, Industrial50x100.png and Industrial50x100.xml to your $FG ROOT/Models/Industrial/ folder ready to try out in the UFO view in FlightGear.

Database

This model has been added to the FlightGear Models database http://scenemodels.flightgear.org/modelbrowser.php?offset=0&shared=4