Procedural texturing: Difference between revisions

Jump to navigation Jump to search
Line 191: Line 191:
   <texture n="13">gradient_texture.png</texture>
   <texture n="13">gradient_texture.png</texture>
  </texture-set>
  </texture-set>
==== The grain texture ====
The grain texture adds a grainy pattern to the terrain at close distances, giving the appearance of better resolution. The grain texture parses the texture alpha channel as transparency (since it just superimposes a pattern), so here the alpha channel can not be used to encode vegetation effects, and the grain texture may not have a strong color.
[[File:grain_texture.jpg|300px|The grain overlay texture]]
To allow fine-tuning of the grain effect, the texture can be multiplied with the <grain_strength> parameter which sets the overall alpha of the grain effect - a low value works best on bright base textures whereas dark base textures may require a stronger grain.
The default grain texture is grain_texture.png which adds a vegetation-like grain. This can be replaced with other grain patterns or void.png for no grain where appropriate.
* declaration:
<texture-set>
  <texture>base_texture.png</texture>
  <texture n="11">hires_texture.png</texture>
  <texture n="12">overlay_texture.png</texture>
  <texture n="13">gradient_texture.png</texture>
  <texture n="14">grain_texture.png</texture>
</texture-set>
* parameters:
<parameters>
  <grain_strength> 0.5</grain_strength>
</parameters>
The default value is 0.5 and the parameter range is 0 (completely transparent) to 1 (completely opaque).


==== An example ====
==== An example ====
1,360

edits

Navigation menu