Revision History: 7/25/06 Updated for X-Plane 850b5 7/13/06 Updated for X-Plane 850 12/06/04 Added TEXTURE_LIT 12/07/04 Added new roof behavior, improved overview 11/19/04 Initial Draft
Facade files instruct X-Plane on how to convert a polygon footprint into a 3-d building. WorldMaker can edit .fac files in a visual manner.
Facades are "extruded" from a polygon base up to a certain height by X-Plane. X-Plane extrudes the facade once for each level of detail in the facade file, deriving possible multiple levels of detail for the finished facades. For each level of detail, X-Plane attempts to find a wall definition that is marked as approriate for the length of the wall. (If none is appropriate, a wall definition will be forced into service.) For each wall, the panels and roof segments are repeated or omitted as needed to cover the specified area and height.
If only one roof ST coordinate exists, the entire roof will be a solid color. Starting with XP802: If four roof points exist, this forms a quad that is used to texture the roof. If the facade is a triangle, the lower left triangular half of the quad is used. If the facade is a quad, the quad is textured directly. If the facade has five or more sides, the facade's shape is cut out of the quad texture like a cookie cuttter. (If a facade has two or three roof coordinates, the roof texturing is generally undefined.)
Historical note: previous documentation specified that if a facade had multiple roof coordinates then X-Plane would pick one randomly to choose the roof color. X-Plane 800/801 always used the first coordinate for color.
Facades are standard X-Plane 3-line-header text files:
A 800 FACADE
The rest of the facade file contains command, one per line. The commands are case sensitive and tokens should be separated by spaces.
This defines the texture to be used by the facade. Facades can only use one texture. The .png or .bmp extension should be included.
X-Plane 802This defines the night lighting texture to be used by the facade. The .png or .bmp extension should be included. If this is omitted no night lighting texture will be used. Note: X-Plane will not automatically load the bitmap with the LIT extension for facades.
This indicates whether the facade forms a closed loop. Closed loop facades can be used for buildings, while facades that are not closed can be used for fences.
This indicates whether X-Plane should draw both sides of the facade. This is useful for non-closed facades or facades where the inside can be seen.
This defines the distance for which the rest of the facade definition will be visible. This is similar to the ATTR_LOD command in an OBJ file. The distance is meters; one or more versions of the facade can be specified. When the facade is farther frmo the viewer than the largest LOD, the facade will not be drawn, so this also provides the maximum rendering distance for the facade.
LOD <near distance> <far distance>
This defines one texture coordinate for the roof. See the section above for how roof points are managed.
ROOF <s> <t>
This defines a wall definition for the facade. The wall has a minimum and maximum length; X-Plane will choose randomly among all wall definitions where the wall being built is within these limits, but may choose your wall anyway if only one wall definition is present. The length is in meters.
WALL <minimum length> <maximum length>
This defines the relationship between pixels in the textures and meters when the facade is built. The parameters indicate the number of meters covered by the entire texture horizontally and vertically.
SCALE <width> <height>
This parameter controls the slope of the top floor of the facade. A value of zero indicates no slope; otherwise this slope is in degrees (e.g. 0-90) for the roof to slope in at.
These commands define the various horizontal divisions of the texture. Left and right divisions are included at most once in the wall; center divisions are included zero or more times repeating. The coordinates are a range of texture S coordinates. Each horizontal division must be touching the previous and next one in terms of texture coordinates, and they must be sorted from left to right.
LEFT <s1> <s2> CENTER <s1> <s2> RIGHT <s1> <s2>
These commands define the vertical divisions of the texture. Bottom and top divisiions are included at most once in the wall; middle divisions are repeated zero or more times. The coordinates are a range of texture T coordinates. Similar restrictions and sorting requirements apply as to horizontal divisions.
BOTTOM <t1> <t2> MIDDLE <t1> <t2> TOP <t1> <t2>
[New in 850:] Starting with 850, you can declare the roof or walls to be "hard" - that is, to interact with the physics engine. The command takes a surface name - these are the same codes as in an OBJ8 ATTR_HARD command - see the OBJ8 spec for more info.
HARD_ROOF <surface> HARD_WALL <surface>
[New in 850:] Normally the textures from a facade are alpha-blended. This can cause the traslucent parts to block out other 3-d scenery. The NO_BLEND command disables blending - a pixel is either entirely opaque or transparent based on its alpha.
If no parameter is supplied, then all alpha over 50% is considered opaque. If a ratio is supplied (between 0.0 and 1.0 exclusive) then that ratio is used as a cutoff level. This command essentially works in the same manner as ATTR_no_blend for OBJ8 - see the OBJ8 spec and associated documents for an in-depth discussion of the rationale behind no-blend geometry.
NO_BLEND NO_BLEND <level>
A 800 FACADE TEXTURE skyscraper_2.png TEXTURE_LIT skyscraper_2_lighting.png RING 1 TWO_SIDED 0 LOD 20.000000 30020.000000 ROOF 0.287722 0.087036 WALL 11.000000 290.000000 SCALE 256.000000 256.000000 ROOF_SLOPE 1.000000 LEFT 0.000000 0.034792 CENTER 0.034792 0.063112 CENTER 0.063112 0.090456 CENTER 0.090456 0.118776 CENTER 0.118776 0.146120 RIGHT 0.146120 0.179323 BOTTOM 0.200806 0.245239 MIDDLE 0.245239 0.275513 MIDDLE 0.275513 0.308716 MIDDLE 0.308716 0.340942 MIDDLE 0.340942 0.372192 TOP 0.372192 0.546509