FAC File Specification

Facade (.fac) File Format Specification
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. World Editor can create facades in a visual manner.

Extrusion Rules for Facades
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 appropriate 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 cutter. (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.''

Facade File Commands
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.

TEXTURE
This defines the texture to be used by the facade. Facades can only use one texture. The .png or .bmp extension should be included. TEXTURE &lt;filename&gt;

TEXTURE_LIT
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.

TEXTURE_LIT &lt;filename&gt;

RING
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.

RING 0|1

TWO_SIDED
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.

TWO_SIDED 0|1

LOD
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 from the viewer than the largest LOD, the facade will not be drawn, so this also provides the maximum rendering distance for the facade. LOD &lt;near distance&gt; &lt;far distance&gt;

ROOF
This defines one texture coordinate for the roof. See the section above for how roof points are managed.

ROOF &lt;s&gt; &lt;t&gt;

WALL
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 &lt;minimum length&gt; &lt;maximum length&gt;

SCALE
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 &lt;width&gt; &lt;height&gt;

ROOF_SLOPE
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. ROOF_SLOPE &lt;angle&gt;

LEFT|CENTER|RIGHT
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 &lt;s1&gt; &lt;s2&gt; CENTER &lt;s1&gt; &lt;s2&gt; RIGHT &lt;s1&gt; &lt;s2&gt;

BOTTOM|MIDDLE|TOP
These commands define the vertical divisions of the texture. Bottom and top divisions 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 &lt;t1&gt; &lt;t2&gt; MIDDLE &lt;t1&gt; &lt;t2&gt; TOP &lt;t1&gt; &lt;t2&gt;

HARD_ROOF|HARD_WALL
[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 &lt;surface&gt; HARD_WALL &lt;surface&gt;

NO_BLEND
[New in 850:] Normally the textures from a facade are alpha-blended. This can cause the translucent 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 Specification and associated documents for an in-depth discussion of the rationale behind no-blend geometry.

NO_BLEND NO_BLEND &lt;level&gt;

Example facade
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