Debian Codegraph @

Docs/README.materials

raw
1 README.materials
2
3 This README describes the materials.xml file format. It is targeted at those
4 wanting to change the appearance of the scenery in FlightGear.
5
6 The materials file used by FlightGear is set in the /sim/rendering/materials-files
7 property. It is read on startup, and can be reloaded in-sim from the
8 "Reload Materials" item in the Debug menu.
9
10 The materials file consists of one or more <region> elements. Each <region>
11 contains one or more geographical <area> elements, defining a rectangle
12 (lat1/lon1, lat2/lon2), and a set of <material> elements which describes a
13 single visually distinct terrain material in the FG world which will be used to
14 render one of more scenery landclasses (for example Grass or Town). When determining
15 the material to use for a given landclass at a given lat/lon, the <region> elements
16 are checked in order and the <condition> element of the materials evaluated. The
17 _last_ matching material definition is used. So more specific regions and materials
18 definitions should be put towards the bottom of the materials file.
19
20 The rest of this document describes the children tags of the <material> entry.
21
22 name : Scenery type names that map to this material. These are typically taken
23 from landclass definitions created by TerraGear. Multiple scenery types
24 may map to a single material. This is recommended to minimize texture
25 memory usage.
26
27 condition : A condition statement used to activate the material. Note that this
28 if evaluated once at start-up.
29
30 texture : A relative path to an SGI RGB, PNG or DDS file containing a texture
31 for the material. RGB and PNG are recommended for platform compatibility.
32 You may define more than one <texture> element, in which case the scenery
33 loader will choose one texture for each contiguous set of scenery
34 triangles.
35
36 texture-set : If using an effect (see below), it may be necessary to define more
37 than one texture. The texture-set element has multiple <texture> element
38 children which may then be referenced by the effect. You may define more
39 than one <texture-set> element, in which case the scenery loader will
40 choose one texture for each contiguous set of scenery triangles.
41
42 object-mask : An optional bitmap file used to control random placement of lights,
43 buildings and vegetation on the terrain. The green channel mask is used
44 for random vegetation placement, the blue channel for buildings and lights.
45 and the red channel controls the rotation of buildings (0.0 is North, 0.5
46 is South). Fractional colour values can be used to give a probability of
47 placement. Multiple object-masks may be defined to match up with <texture>
48 or <texture-set> elements.
49
50 effect : The effect to be used for this material. (default:
51 Effects/terrain-default)
52
53 ambient, diffuse, specular, emissive, and shininess are copied into the
54 parameter section of the effect created for this material.
55
56 parameters : Additional parameters to be used in the effect. See README.effects
57 for format information.
58
59 wrapu : True if the texture should repeat horizontally over a surface, false if
60 it should not repeat (default: true).
61
62 wrapv : True if the texture should repeat vertically over a surface, false if
63 it should not repeat (default: true).
64
65 mipmap : True if the texture should be mipmapped, false otherwise. (default: true).
66
67 xsize : The horizontal size of a single texture repetition, in meters.
68
69 ysize : the vertical size of a single texture repetition, in meters
70
71 light-coverage : The coverage of a single point of light in m^2. 0 indicates no
72 lights at all. Minimum value is 1000m^2. May be masked by the blue channel
73 of an object-mask. Lights are all generated 3m above the surface, and
74 have random colour (50% yellow, 35% white, 10% orange, 5% red)
75
76 light-edge-spacing-m : Spacing of lighting in m on the edge of line features in WS30.
77 light-edge-height-m : Height of lighting in m above the line feature surface.
78 light-edge-size-cm : Size of edge lighting in cm. Default 50cm
79 light-edge-intensity-cd : Intensity of edge lighting in candela. Default 100.
80 light-edge-angle-horizontal-deg : Horizontal extent of light. Default 360.
81 light-edge-angle-vertical-deg : Vertical extent of light. Default 360.
82 light-edge-color/r ... : Light colour, with r,g,b,a properties. Default 1.0, resulting in white light
83
84 line-feature-tex-x0 : x0 texture coordinate for WS3.0 line features
85 line-feature-tex-x1 : x1 texture coordinate for WS3.0 line features
86 line-feature-offset-m : vertical offset of line feature from underlying mesh in meters.
87 May be used to ensure roads go over rivers. Defaults to 1m.
88
89 ambient : The ambient light colour for the material, specified as separate
90 r, g, b, a components (default: all color components 0.2, alpha 1.0).
91
92 diffuse : The diffuse light colour for the material, specified as separate
93 r, g, b, a components (default: all color components 0.8, alpha 1.0).
94
95 specular : The specular light colour for the material, specified as separate
96 r, g, b, a components (default: all color components 0.0, alpha 1.0).
97
98 emissive : The emissive light colour for the material, specified as separate
99 r, g, b, a components (default: all color components 0.0, alpha 1.0).
100
101 solid : Whether the surface is solid from an FDM perspective. If it is not
102 solid, it is assumed that the material models a fluid (water) surface.
103 (default: true).
104
105 friction-factor : The friction factor for that material. The normalized
106 factor can be used by a FDM to post-multiply all contact friction forces
107 with that factor. That is the more slippery a material is the smaller
108 this value should be. (default: 1.0 for Dry concrete/Asphalt).
109
110 rolling-friction : the gear rolling rolling-friction coefficient for this
111 particular material. (default: 0.02 for Dry concrete/Asphalt).
112
113 bumpiness : normalized bumpiness factor for this particular terrain.
114 (default: 0.0 for a smooth surface).
115
116 load-resistance : a pressure value how much force per surface area this
117 surface can carry without deformation. The value should be in N/m^2
118 (default: 1e30).
119
120 glyph : group that defines one letter/digit/symbol in a font texture
121 sub-entries: name, left (default: 0.0), right (default: 1.0)
122 (left and right describe the horizontal position in the texture.)
123
124 wood-coverage : The coverage of trees in areas marked as woodland in
125 m^2. A lower number means a higher density of trees. A value of
126 0 indicates no woods. May be masked by the green channel of an
127 object-mask. (default: 0)
128
129 tree-range-m : The range at which trees become visible. Note that this
130 is not absolute, as trees are loaded in blocks. A lower number means
131 trees will not become visible until you are closer.
132
133 tree-texture : A texture to use for the trees. Typically this will contain around
134 8 different trees in a row, duplicate 4 times. From bottom to top, the
135 rows contain
136 * summer textures
137 * summer snow texture
138 * winter texture
139 * winter snow texture
140
141 Each tree must have space at the top. For a 512x512 texture sheet, this
142 should be 8 pixels. Otherwise subsequent rendering results in "top hats"
143 above trees in the distance where the trunk of the tree above in the
144 textures sheet bleeds downwards when the mipmaps are generated.
145
146 tree-varieties : The number of different trees defined in the tree-texture
147 horizontally. (default: 1)
148
149 tree-height-m : The average height of the trees. Actual tree height will
150 vary by +/- 50%. (default: 0)
151
152 tree-width-m : The average width of the tree cover. Actual tree width will
153 vary by +/- 50%. (default 0)
154
155 tree-max-density-angle-deg : The slope angle at which trees begin to thin out
156 as the slope is too steep to support the full coverage. Shallower
157 slopes have maximum wood-coverage. Steeper slopes have fewer trees.
158 (default : 45)
159
160 tree-zero-density-angle-deg : The angle at which the slope is too steep to
161 support significant vegetation. Steeper slopes have no trees.
162 (default : 60)
163
164 object-max-density-angle-deg : The angle at which objects and buildings become
165 less dense due to a steep slope. (default : 20)
166
167 object-zero-density-angle-deg : The angle at which the slope is too steep to build
168 on. No object/buildings will be placed on slopes steeper than this.
169 (default : 30)
170
171 object-group : A group of random objects to be placed on the surface. Contains
172 <range-m> and one or more <object> children.
173
174 range-m : The distance at which objects within this object-group become
175 visible. Note that for realism, 60% of the objects will become visible
176 at <range-m>, 30% at 1.5*<range-m>, and 10% at 2*<range-m>.
177 (default: 2000)
178
179 object : A set of random objects to be placed. Contains <coverage-m2>, <path>
180 and <heading> children.
181
182 coverage-m2 : The coverage of a single object in m2. Lower values mean a higher
183 density. Minimum value is 1000.
184
185 spacing-m : The minimum space between this object and any other on the surface in
186 meters. This helps to avoid objects being placed ontop of each other.
187 (default 20)
188
189 path : Path relative to FG_ROOT to a model definition, usually .ac or .xml file.
190 More than one <path> may be included within the <object> tag, in which
191 case a single <path> is chosen at random for each individual object
192 placement.
193
194 heading-type : Indicator of how the heading of the random objects should be
195 determined. Valid values are:
196 fixed - Objects all point North. Default.
197 random - Objects are assigned an individual random heading
198 mask - Rotation is taken from the red channel of the object-mask
199 billboard - Object is always rotated to face camera - expensive
200
201
202 Random Buildings
203 ================
204
205 Random Buildings come in three sizes, with individual constraints.
206
207 Small buildings. These have different textures on the sides compared to the front
208 and back. Small buildings are never deeper than they are wide.
209
210 Medium buildings, which are never taller than they are wide.
211
212 Large buildings. There are no constraints on their width, depth or height.
213
214 building-coverage : The coverage of random buildings in areas marked for random
215 objects in m^2. A lower number means a higher density of buildings. A
216 value of 0 indicates no buildings. May be masked by the blue channel of an
217 object-mask. (default: 0)
218
219 building-spacing-m : The minimum spacing between random buildings and other buildings
220 or random objects. This helps avoid objects being placed on top of each
221 other. (default: 5)
222
223 building-small-ratio: Ratio of small buildings. These buildings are 1-3 stories
224 in height, and may have a pitched roof. Fraction of small buildings is
225 (<building-ratio-small> / (<building-ratio-small> + <building-ratio-medium>
226 + <building-ratio-large>). (default: 0.8)
227
228 building-medium-ratio : Ratio of medium buildings. These buildings are 3-6 stories
229 in height, and have a flat roof. (default: 0.15)
230
231 building-large-ratio : Ratio of large buildings. These buildings are 5-10 stories in
232 height, and have a flat roof. (default 0.05)
233
234 building-small-pitch : Fraction of small buildings with pitched roofs. (default 0.8)
235 building-medium-pitch : Fraction of small buildings with pitched roofs. (default 0.2)
236 building-large-pitch : Fraction of small buildings with pitched roofs. (default 0.1)
237
238 building-small-min-floors : Min. number of floors for a small building. (default 1)
239 building-small-max-floors : Max. number of floors for a small building. (default 3)
240
241 building-medium-min-floors : Min. number of floors for a medium building. (default 3)
242 building-medium-max-floors : Max. number of floors for a medium building. (default 8)
243
244 building-large-min-floors : Min. number of floors for a medium building. (default 5)
245 building-large-max-floors : Max. number of floors for a medium building. (default 20)
246
247 building-small-min-width-m : Min. width of small buildings. (default 15)
248 building-small-max-width-m : Max. width of small buildings. (default 60)
249 building-small-min-depth-m : Min. depth of small buildings. (default 10)
250 building-small-max-depth-m : Max. depth of small buildings. (default 20)
251
252 building-medium-min-width-m : Min. width of medium buildings. (default 25)
253 building-medium-max-width-m : Max. width of medium buildings. (default 50)
254 building-medium-min-depth-m : Min. depth of medium buildings. (default 20)
255 building-medium-max-depth-m : Max. depth of medium buildings. (default 50)
256
257 building-large-min-width-m : Min. width of large buildings. (default 50)
258 building-large-max-width-m : Max. width of large buildings. (default 75)
259 building-large-min-depth-m : Min. depth of large buildings. (default 50)
260 building-large-max-depth-m : Max. depth of large buildings. (default 75)
261
262 building-texture : The texture used for all buildings. See Docs/buildings.png for
263 details. (default Textures/Buildings/buildings.png)
264
265 building-lightmap: Emissive texture for all buildings, which is faded in at night to
266 provide illusion of lit windows. Same texture coordinates and
267 format at building-texture above.
268
269 building-range-m: Range at which all buildings are visible. Beyond this point fewer
270 and fewer buildings are rendered, with no buildings rendered at
271 2*building-range-m (default 10000)