Procedural texturing: Difference between revisions

Jump to navigation Jump to search
Line 332: Line 332:
   <texture-set>
   <texture-set>


If the overlay texture is declared void.png (to which the effect defaults), it is not used. The effect takes a number of parameters. For the overlay, the fraction taken by the overlay texture and the scale at which the patches are drawn can be specified as:
If the overlay texture is declared void.png (to which the effect defaults), it is not used. The effect takes a number of parameters. For the overlay, the fraction taken by the overlay texture and the scale at which the patches are drawn can be specified through the overlay fraction and the overlay scale, while the shape of the domains can be controlled using a distortion factor.


   <overlay_fraction>0.5</overlay_fraction>
   <overlay_fraction>0.5</overlay_fraction>
   <overlay_scale>1000.0</overlay_scale>
   <overlay_scale>1000.0</overlay_scale>
   <rotation_flag>0</rotation_flag>
   <distortion_factor>0.3</distortion_factor>
   <rotation_scale>1000.0</rotation_scale>
 
   <distortion_factor>0.0</distortion_factor>
This results in the overlay texture superimposed in irregular patches.
 
[[File:Domains_agro03.jpg|400px|center|Overlay de-tiling in agriculture]]
 
 
De-tiling can also be achieved by rotating the texture coordinates inside patches. This is controlled by a rotation flag which can be set to 1 (random rotation) or 2 (rotation by multiples of 90 degrees only) in addition to a rotation scale. In case of very regular textures which should be rotated by multiples of 90 degrees only, uv texture coordinate offsets are provided to align texture and rotated domain.
 
   <rotation_flag>1/rotation_flag>
   <rotation_scale>2000.0</rotation_scale>
   <uv_xoffset>0.0</uv_xoffset>
   <uv_xoffset>0.0</uv_xoffset>
   <uv_yoffset>0.0</uv_yoffset>
   <uv_yoffset>0.0</uv_yoffset>


Using domain rotation also leads to a reasonable de-tiling while keeping the color impression.
[[File:Domains_agro02.jpg|400px|center|Overlay de-tiling in agriculture]]
Both rotation and overlay can be combined. Neither of the effects is compatible with patterns of random trees of buildings created by placement masks, as these are used at tile loading time and can not be changed runtime like shader effects.


=== Pixel color postprocessing ===
=== Pixel color postprocessing ===
1,360

edits

Navigation menu