This text was supplied by by Hans van Kampen <intermedia@mail.com>

"Unofficial" texts are member contributions that have not yet been discussed or approved by the ESP community.

X-Plane Texture Definitions
... a different approach
by Hans van Kampen <intermedia@mail.com>


4. Textures and colours
---------------------

Textures may have optimum sizes (256 x 256 pixels at 288 ppi) for fast processing and good rendering, specific colour information can seriously limit performance.

As can be seen textures are subjected to ‘daylight conditions’, that alter brightness, hue/colour and even colour saturation. XP uses a complicated lookup table to set various daylight conditions and change the projection properties of all textures accordingly.

This is a complicated matter until now not handled very well by XP.
An example is the grass runway in Version 5.03, that becomes a black rectangle when seen from very far and already behind the blue fog at the horizon. Also other runway systems show anomalies, that need to be corrected soon and will be corrected from Version 5.11 on.

The current BMP textures requires Red, Green, Blue colour mixtures in 24 bit format, of which most graphics cards only use 16 bit for faster colour composition. The raw, space-consuming BMP format is a true nuisance for many XP users. 50 Mb of 24 bit BMP textures equals 5 Mb of Jpeg formatted material or less when no control codes are required.

+Choosing landscape colours+
Satellite imagery of the Earth at a clear day reveals many basic landscape colours. Whereas the USA has dominantly yellowish-red and brown-green colours, Europe has deep-green, yellowish-brown and greyish blue colours.
Asia has greyish-yellow to brown-darkgreen tints etc.

To find a common denominator is next to impossible. The current generic XP textures (grs.BMP, mnt.BMP) are artistic inventions not based on reality.

The standard generic textures have remarkable and in fact undocumented ‘features’, that make some of them true framerate killers.

It is from the onset necessary to limit the number of tints, steep colour contrasts and repeating patterns in a texture (the latter become ugly parallactic ‘streams’ when viewed from above). The graphics card itself ads brightness and hue to the various patterns when compensating for daylight conditions. Besides they ad a light blue fog over the (in XP flexible) horizon causing colour shifts, which can be exploited in textures for an even better sense of reality. One has to compensate for this bluish gloss by adding some extra green or red, but still keeping brightness moderate. A texture may not become too bright and yellowish at high noon.

With this document goes a special ‘vk_tints_demo.BMP’ to demonstrate some useable colours and patterns.

+Colours can be killers+
Difficulties arise when textures comprise too many spectral colours, i.e. blue and red, green and white, brown and grey. It is not only the scenery texture, but also the airplane texture and the cockpit texture that has to be processed at (almost) the same time. If too steep a transition is present reduction of cross-colour is calculated and things slow down. This is particularly true for thick lines or heavy contrasts with a high frequency (grs.BMP). In how far also the monitor ads to specific ‘fast’ and ‘slow’ problems is uncertain, persistence of its phospor and its colour should have some influence though.
A deteriorating factor is a non-homogenous texture with borders that do not fit together, causing a borderline between adjacent textures.
An FPS-killer is a shade of blue (or cyan) across a texture, sometimes causing a severe slowdown and strange ‘fogging’ phenomena when in flight.

Remember that approaching a major airport with multiple runways much calculation power is required. When the underlying scenery texture has problems this magnifies the number of calculations, slowing down XP very considerably and collapsing the horizon to minimum values (f.e. 4 nm).

To test whether a texture has problems fly the suspect area in cockpit view first, denoting the framerate and timing (by setting these parameters on-screen), and after that change to Free View (with the full airplane in sight) to again fly across the area. Again denote the FPS, which will be considerably lower. If an FPS below 12 (f.e. 11.2) and Timing above 0.98 (f.e. 1.01) is denoted, you have a problem! At FPS 9 to Timing 5 XP stops its execution.

If in doubt fly an area in Full View and change nextly to Free View (with airplane on screen). If FPS lit. collapses you have a problem. Rotate your view to find the direction in which the problem lies and denote the associated texture. Check this texture for image size (256 x 256), resolution (288) and look for stark contrasting areas, lines etc.

+Borders of textures+
All 4 borders of a texture must have the same structure! Otherwise you will see a seam between adjacent textures. It is hardly possible to achieve this for all textures, but some tricks can be applied here.

Best is starting to design an appropriate ‘generic’ ‘grs.BMP’, replacing the original generic grass texture in the ‘terrain’ folder. Select a flat deep green colour first. Now make various random rectangles, small and wide, then change their brightness and colour balance slightly. A brightness variation of 3-5% (!!!) will do very well. An RGB colour balance variation of 6-10% is enough! Prevent repeating patterns that form ‘streets’ and ‘streams’ across the screen. If the design satisfies do copy one border (3 to 5 pixels along one border) to the 3 other sides. Tweak tiny disturbances with the pen tool in your graphics software (f.e. Adobe’s PhotoShop).

If in doubt about a seamless transition shift the whole texture (by using an available ‘offset’ menu function) across the border some 20 pixels (horizontally and vertically) to view and correct a visible borderline. Then shift the texture back again. PhotoShop software has this option under ‘Filter’ -> ‘Other...’.

+Deriving other textures from the gr(as)s.BMP+
From this newly designed ‘grs.BMP’ we derive all other necessary textures.
The ‘wtr.BMP’ (water) texture may be a flat deep greenish-blue with a very modest ‘Texturize... > Sandstone’ touch for its ‘waves’ effect. The current ‘wtr.BMP’ is very unrealistic!

Snowscapes can be derived from the ‘grs.BMP’ by simply +inverting (!)+ a good, greenish landscape texture. The bluish gloss that may appear disappears when seen under various daylights or may freely be corrected by altering the colour balance slightly. Mountains can be quickly produced from the ‘grs.BMP’ as well, by slightly changing the colour balance to yellowish-red and reducing the saturation, but adding some modest texturization effects or slight brightness variations (+ and - 5% max.).

+In between textures+
After designing the generic ‘grs’, ‘mnt’ and ‘wtr’ BMPs in between textures can be prepared. Here it appears that XP uses a complicated algorhythm to determine where a transition will be placed. Particularly water-grass and water-mountain borders are involved. Interesting to denote is, that 7 generic transition textures -in principle- can be weeded out, showing that the builder of XP himself didn’t fully understand his (brilliant!) routine... This space-saver requires but 1 extra custom transition texture as to be able to make all water-land transitions. The transition textures are marked uniformly: grs_mnt_c, grs_wtr_h (c=corner, h=horizontal) etc. etc. and can be found in the XP ‘textures’ >‘terrain’ folder. It is necessary to study their organization first prior to replacing them. Although 7 textures (requiring a standard RAM consumption of almost 2 Mb) could be weeded out, XP doesn’t allow this yet. The terrain lookup table within XP has not been adjusted.
The design oversight is: not using simple diagonal transitions, but somewhat strange halfway-diagonals as seen in the textures mentionned above. This however could be corrected. The generic Carabean textures are useless and can be trashed, if not flying near the equator, saving disk space.

+Cities+
A ‘city texture’ belongs to the ‘custom textures’.
Remember that any pixel in a 256 x 256 sized BMP equals about 3.5 meter/12 feet. The graphics card however needs at least 2 adjacent pixels to project a shape consistently. Remember furthermore that stark contrast is ‘prohibited’ and killing FPS. Nevertheless we do need contrast to design a topview of a city or village. Use 75% grey to outline the shadow/outline of a house or building, and use f.e. 45% red or brown to draw the ‘roof’. By keeping the contrast in a small middle range a good 3D effect will be obtainable when seen from above! Roads may be 40% grey and should be 2 or 3 pixels wide, alternatively 2 pixels with anti-aliassing. This seems small, but it works fine, as you will see when in flight. Adding 2 or 3 randomly placed full yellow pixels along the ‘road’ will produce a headlight effect when in dusk or dawn! Note however, that some spots may not appear (!) due to the somewhat strange and unconventional (interlacing without mipmapping) graphics projection in XP.

Finally copy your ‘grs.BMP’ in a separate ‘new’ layer above the ‘city’ and cut away everything up until 2-3 pixels from the ‘grs.BMP’ border. Flatten the design now to produce 1 image (‘layer’) and presto: seamless border.

+Distortions+
In World-Maker a quadrilateral may be distorted along both its diagonals to accomodate landscape features. Take care, that cornerpoints don’t undercut a diagonal. Too large distortions will cause strange graphical effects when seen in flight (although they may creatively be used to make a tunnel). A good custom texture design will require rather rectangular quads...

+Fog+
The bluish fogging and limit to visibility that can be preset in the Weather menu option has its effects on textures. There is always a bluish tendency over all textures. Use blue (cyan) very carefully in textures and avoid ‘noise’ with blue freckles. When the FPS gets low (FPS 11.8 by timing 1.01) the blue horizon will ‘run into’ the scenery, sometimes causing strange clouds of fog in particular places only. This phenomenon occurs when too many calculations are required, f.e. at a complex airport, when ‘slow’ textures are involved, objects are too complicated, or when an airplane in cockpit view has too many (map) functions on its display. Cutting a HUD, limiting EFIS and other range calculating instruments to show a 7 nm range instead of 30 will improve FPS. When starting XP up set these instruments to minimum values or off and wait 5 seconds to have XP settle itself first, when working on a ‘slow’ computer.

+Clouds+
Except for ‘clear’ and ‘overcast’ weather clouds are framerate killers. If not absolutely necessary avoid their usage. A good cloud design may be 128 x 128 pixels in size, but 64 pixels/inch resolution. A design must be blurred heavily to give a good cloud-to-air transition. Avoid using full white, but use a light blue tint instead. This does away somewhat with the rather nasty staircases you may see in the generic ‘cloud.BMP’. Since fractalized clouds are not available in XP, clouds now are primitive textures hovering over the landscape. Due to calculation imprecision clouds wobble in the air.

+Airplane textures+
Complex airplane textures with resolutions over 72 dpi can kill framerates.
Changing cockpit view for Free View may show a significant deterioration of the FPS and Timing. Reduce the texture and simplify complex patterns.

+Cockpit texture+
The cockpit is treated like a texture. It may be anything complying to the instrument placement rules within XP (see Plane-Maker) and as of Version 5.1 may have a different topbar/ceiling and panelsize. By assigning ‘glass’ (transparency) the scenery can be made visible in different places. For glass the RGB color 255, 0, 255 must be used. A cockpit display may be a true photograph or a handmade primitive, as long as it has 72 or 144 dpi (2 x 72) resolution for fastest processing. It doesn’t make sense to build a display with 600 dpi!

+Textures near airports+
Many quadrilaterals are heavily distorted, having consequences for the crispness of custom textures. This can be corrected by equalizing the dimensions of quads near vital optical points (airports). By making a quad near the end of the runway half its original size, sharpness and a far better approach (depth) cue can be achieved. By making the quad smaller, its projected information becomes compressed and the image thus gets sharper.
Trees in front of a runway can be designed by making custom objects.

Proceed to the last page