Comet 4c - Texture Baking - Engineer's Station

(click for full size)

The flight engineer’s station is now done - or re-done, but with texture baking and dynamic lighting. It was a mammoth task; not least because there were a vast number of gauges, switches, levers and circuit-breakers to be unwrapped and flattened out as UV co-ordinates on a texture map. The screen-shot above shows the panel with a mix of daylight and dynamic lighting, the picture below shows it at night.

(click for full size)

Compared with the picture in a previous article (seats), fuses and relays have been modelled individually.

(click for full size)

The second part of the problem was text legibility. When I first drew the engineer’s station in May 2009, I realised that if I mapped one of the main engineer’s panels to a PNG texture file in the conventional way, the entire area would have to be filled from edge to edge for the writing to be large enough to read. Even with 2048x2048 textures, I would have needed to break the whole engineer’s pedestal into two or three separate object files simply to have enough texture area to work with. This was a bad idea because so many full resolution texture files (and their LIT versions) would gobble VRAM.

My first solution was to divide each panel into lots of tiny surfaces, like a jig-saw puzzle. Areas with writing were given more space; areas that were plain colour could be crammed onto a few pixels. The advantage was that the whole area could be accommodated by a single 1024x1024 PNG. It looked like this:

The disadvantage was that I could not apply any kind of false lighting or shadow-baking, because the change in resolution of neighbouring parts of the jigsaw became immediately apparent.

With a mark 2, I decided to model the text itself in 3D (or “polytext”). This has the advantage of keeping the PNG files small, keeping the text crisp, regardless of each X-Plane user’s render settings, and it means lighting for individual text labels could be controlled individually; something I made use of on the fire warning panel.

The disadvantage with polytext is that the number of polygons in labels for a busy panel could be as much as the entire cockpit. As Ben Supnik reminded us in July, polygons are cheap in terms of processing and frame rates, but I was about to add a very big number indeed. My first test allowed AC3D to make its own polytext from a stock TTF font. I reeled from the results, which showed an increase of no fewer than 0.8 million triangles.

Of course this was a rough, and I realised that there were a lot of wasted polygons in curved letters, like “O” and “S”. The first example is at AC3D default setting (= 5), which preserves the original font shape extremely well, but these letters alone contain 342 polys:

By reducing the quality setting in AC3D to minimum (= 1), the poly count came down to 76, but the letters became distorted, even when read from a distance, and it was clear there were still a lot of unnecessary vertices and triangles:

The third option was to draw each letter manually. For the overhead panels and pedestal, I did this point by point. For the engineer’s station, I used Fontforge to create a new TTF font that AC3D handled perfectly. The result was extremely economical on polygons. It looks coarse at this magnification, but very smooth in X-Plane. In the example below, the poly count was only 49:

A new problem with dynamic lighting was finding one’s way in a cold and dark cockpit at night. One of the benefits of polytext is that it individual lettering can be lit separately. It’s not strictly accurate, but when everything is off, you will see the legend for the battery switches glowing in the dark, and also some of the lighting dimmers. The picture below also shows how the polytext font looks in X-Plane.


Increase in texture area:
Mark 1 = 1024x1024;
Mark 2 (with components unwrapped and baked) = 2048x1024.

Total polygons (engineer’s station):
before = 362,447;
with polytext = 630,402.

236 MB (at EGKK with texture resolution = “very high”, and texture compression ON).

Frame rates:
3D cockpit, EGKK, looking forwards, 45 degree camera, 1024x1024 pixels, texture “very high”, 2x anti-alias, pixel shading off, Mac Pro 2x2.66 MHz:
Nvidia 7300/256MB: 30 FPS;
ATi 3870/512MB = 66 FPS.

1920x1200 pixels, pixel shading on (all boxes ticked):
ATi 3870/512MB = 42 FPS.

GMM-P (22/08/2010)

blog comments powered by Disqus
Copyright © 2022, Guy Montagu-Pollock. All rights reserved.

Privacy policy: this web site does not store your personal data, nor does it use cookies, except to flag that you have understood this message.

RapidWeaver Icon

Made in RapidWeaver