Procedural texturing: Difference between revisions

Jump to navigation Jump to search
m
→‎The dirt runway effect: begin adding syntax highlighting (generally missing)
m (→‎The dirt runway effect: begin adding syntax highlighting (generally missing))
Line 467: Line 467:
Using a dedicated ALS effect, it is possible to generate a wide variety of visuals for non-paved runways. The effect is used to texture a runway as
Using a dedicated ALS effect, it is possible to generate a wide variety of visuals for non-paved runways. The effect is used to texture a runway as


<syntaxhighlight lang="xml">
     <effect>Effects/dirt-runway</effect>
     <effect>Effects/dirt-runway</effect>
</syntaxhighlight>


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.
Line 477: Line 480:
For each of the textures, a mapping to a physical size of the texture patch can be defined by the set of parameters
For each of the textures, a mapping to a physical size of the texture patch can be defined by the set of parameters


<syntaxhighlight lang="xml">
       <size_base>25.0</size_base>
       <size_base>25.0</size_base>
       <size_overlay>100.0</size_overlay>
       <size_overlay>100.0</size_overlay>
       <size_grain>100.0</size_grain>
       <size_grain>100.0</size_grain>
</syntaxhighlight>


(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
(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
Line 489: Line 495:
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  
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  


<syntaxhighlight lang="xml">
       <strength_05m>0.0</strength_05m>
       <strength_05m>0.0</strength_05m>
       <strength_1m>0.4</strength_1m>
       <strength_1m>0.4</strength_1m>
Line 494: Line 502:
       <strength_5m>0.2</strength_5m>
       <strength_5m>0.2</strength_5m>
       <strength_10m>0.1</strength_10m>
       <strength_10m>0.1</strength_10m>
</syntaxhighlight>


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.
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.
Line 499: Line 508:
The raw Perlin noise is post-processed by a filter driven by two parameters.
The raw Perlin noise is post-processed by a filter driven by two parameters.


<syntaxhighlight lang="xml">
       <filter_threshold>0.2</filter_threshold>
       <filter_threshold>0.2</filter_threshold>
       <filter_transition>0.2</filter_transition>
       <filter_transition>0.2</filter_transition>
</syntaxhighlight>


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

Navigation menu