Procedural texturing: Difference between revisions

Jump to navigation Jump to search
Line 470: Line 470:


and the textures and parameters to configure it must be specified in the <parameters> section of the landclass used for the runway.
and the textures and parameters to configure it must be specified in the <parameters> section of the landclass used for the runway.
<b>Important note:</b> Part of the effect explicitly relies on a particular uv-mapping of the dirt runways. For this reason, the effect may or may not work as intended with scenery other than FG world scenery 2.0 - in particular custom scenery builds may not give the desired visuals if they treat unpaved runways differently.
The effect uses a mixture of three texture layers - a base texture layer (n=16) an overlay texture layer (n=17) and a grain texture layer (supposed to be a largely transparent texture with just a darker overlay pattern on it, n=18).
For each of the textures, a mapping to a physical size of the texture patch can be defined by the set of parameters
      <size_base>25.0</size_base>
      <size_overlay>100.0</size_overlay>
      <size_grain>100.0</size_grain>
(i.e. setting a parameter to 100 means that the texture sheet is supposed to represent a 100 m x 100 m patch of runway). This is different from the way the default renderer treats dirt runways by stretching the assigned texture over the whole runway (i.e. texture magnification depends on runway size). The strength of the grain overlay can be controlled by
      <grain_strength>0.3</grain_strength> 
where a value of zero implies no grain texture and a value of 1 the full grain effect as on the texture.
The mixture of base and overlay texture layers is controlled by filtered Perlin noise. The frequencies of the base noise distribution can be controlled by
      <strength_05m>0.0</strength_05m>
      <strength_1m>0.4</strength_1m>
      <strength_2m>0.3</strength_2m>
      <strength_5m>0.2</strength_5m>
      <strength_10m>0.1</strength_10m>
where the sum of all parameters is supposed to be 1. Strengthening a parameter generates more structure at this scale, for instance in order to generate a small-scale, fine-grained pattern one should set the lower frequencies to larger values, whereas for large continuous patches of texture strength_10m and strength_5m should be largest.
The raw Perlin noise is post-processed by a filter driven by two parameters.
      <filter_threshold>0.2</filter_threshold>
      <filter_transition>0.2</filter_transition>
Of these, the threshold regulates the relative mixture of the two textures (0.5 roughly corresponds to 50%) and transition how the mixture will be drawn. A small transition value (say 0.1) corresponds to an either/ or scenario in which only one of the textures will be drawn (appropriate for grass patches on dirt), a large transition value smoothly blends the textures (appropriate for different sand textures).
If
      <bias_center>1</bias_center>
 
is set to 1, the noise distribution will tend to favor the base layer in the center of the runway. <b>This requires a specific uv-mapping and will not work for custom-generated runways.</b> The strength of that bias is set by
    <bias_center_strength>0.6</bias_center_strength>
which is between 0 (no bias) and 1 (don't draw overlay layer in runway center no matter what).
In addition, the effect uses a normal map (since it is used in a non-standard way, touch at your own risk) - the visual 'bumpiness' of the runway can be adjusted using
      <relief_strength>0.35</relief_strength>
Using different mixtures of textures and parameters, a wide variety of visuals can be achieved, a few examples in the following.
A lakebed texture overlaid with sand gives proper visuals for e.g. the Rogers Dry Lake runways at Edwards AFB:


     <texture-set>
     <texture-set>
Line 492: Line 543:
       <grain_strength>0.3</grain_strength>
       <grain_strength>0.3</grain_strength>
     </parameters>
     </parameters>




|[[File:Dirt rwy01.jpg|500px|Dirt runway example 1]]
|[[File:Dirt rwy01.jpg|500px|Dirt runway example 1]]
Using a largely grass-textured surface and allowing some gravel to show in the runway center gives the appearance of a worn grass runway:


   <texture-set>
   <texture-set>
1,360

edits

Navigation menu