User Tools

Site Tools


hpl3:engine:terrain

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
hpl3:engine:terrain [2012/02/17 16:30]
thomas
hpl3:engine:terrain [2012/04/24 13:17]
thomas [Texturing]
Line 26: Line 26:
 If you have a height map that is a 64x64 pixels and unit size of 1 meter, that means you have a 64x64 meter large terrain. If the texture patch size is 64 then that means that a single texture will cover the entire terrain, meaning the max number of pixels per meter is 2048 (max cache size) divided by 64, which is 32. This is the same as a 32x32 texture covering a 1x1 meter polygon square. In order to boost this quality, the texture patch size, and most likely the geometry too (remember, texture patch size cannot be lower than that for geometry). If we instead decrease texture patch size to 32, we get 2048/64 = 64 pixels per meter. \\ If you have a height map that is a 64x64 pixels and unit size of 1 meter, that means you have a 64x64 meter large terrain. If the texture patch size is 64 then that means that a single texture will cover the entire terrain, meaning the max number of pixels per meter is 2048 (max cache size) divided by 64, which is 32. This is the same as a 32x32 texture covering a 1x1 meter polygon square. In order to boost this quality, the texture patch size, and most likely the geometry too (remember, texture patch size cannot be lower than that for geometry). If we instead decrease texture patch size to 32, we get 2048/64 = 64 pixels per meter. \\
 This is very important for the visual fidelity and like geoemtry patch size it should be determined at an early stage and be the same for all maps. This is very important for the visual fidelity and like geoemtry patch size it should be determined at an early stage and be the same for all maps.
 +
 +=== Blend Layer Material ===
 +
 +Terrain blend layers must use material of the type "​Terrain"​.\\
 +Note: This material cannot be placed on models, but can only be used on terrain!
 +
 +== Diffuse ==
 +
 +**Channels:​** RGB / RGBA\\
 +**Type:** 2D\\
 +**File format:** dds, dxt1 or dxt5 (if using alpha).\\
 +**Suffix:** None.\\
 +This is simply the color and is needed for as good any blend layer\\
 +If Alpha is used it see [[hpl3:​engine:​terrain#​blending|blending]] below for instructions on how it is used.
 +
 +== Normal Map ==
 +**Channels:​** G and Alpha (must use special exporter for this!)\\
 +**Type:** 2D\\
 +**File format:** dds, 3dc.\\
 +**Suffix:** “nrm”.\\
 +The normal map for the material and uses the standard format rgb = xyz and is in tangent space. Note that this needs to be converted to a format of XY only though! ​
 +
 +== Specular ==
 +**Channels:​** RGB\\
 +**Type:** 2D\\
 +**File format:** dds, dxt1.\\
 +**Suffix:** “spec”.\\
 +The specular map handles the specular intensity for each pixel. ​
 +Intensity sets the amount of specularity (for each color channel) applied to a pixel, the higher value of the channel, the higher intensity.\\
 +Power cannot be set on a pixel basis, but is set as a global property for the terrain. This sets the sharpness of the specular highlight, a low value give a dull and diffuse look, while a high value give a wet/shiny look. 
 +
 +=== Detail textures ===
 +
 +Detail textures are set sepperatly from the blend textures and while the normal terrain material is rendered into cache textures, deail textures are drawn ontop of the cache texture every frame (when the actual terrain is rendered). This makes it possible to have a much higher resolution for the detail textures which is only limted by the screen size (apart from blend layer textures that are limited by the size of the cache textures).
 +
 +Fileformat should be **dds**, of type **dxt1**.\\
 +
 +The way it mixes, Grey (127) means that nothing is changed, darker (126 or below) makes the result darker, and brighter (128 or above) makes the result brighter.
 +
 +There is a variable for fading this out at a distance, but in some special cases this might not look good. In that case use dxt5 and have custom mipmaps that fade to gray in an appropriate way. Only use this if really needed though!
  
 === Blending === === Blending ===
-If the diffuse texture of a sublayer in a blendlayer as an alpa channel then this will determine how fast that part fades when blending with the layer below it. This can be used for fading things in chunks, fort instance simulating gravels that decrease in density. Example:\\+If the diffuse texture of a sublayer in a blendlayer as an alpa channel then this will determine how fast that part fades when blending with the layer below it. This can be used for fading things in chunks, fort instance simulating gravels that decrease in density. ​Note in many cases this is not needed though and default blend fading works best.\\ 
 +Example:\\
 {{:​hpl3:​engine:​terrain_texture_blend_alpha_usage.jpg?​direct&​600|}} {{:​hpl3:​engine:​terrain_texture_blend_alpha_usage.jpg?​direct&​600|}}
- 
 ==== Undergrowth ==== ==== Undergrowth ====
  
 Important notes:\\ Important notes:\\
   * The undergrowth base mesh must have a 0 - 1 uvmapping!   * The undergrowth base mesh must have a 0 - 1 uvmapping!
hpl3/engine/terrain.txt · Last modified: 2014/11/27 16:53 by nebej