Difference between revisions of "Scenery:Texmapper.cfg File"

From Silent Wings Wiki
Jump to: navigation, search
Line 107: Line 107:
  
 
=== Texture mapper section ===  
 
=== Texture mapper section ===  
 +
 +
This section contains parameters relevant to the generation of the image files. The most important parameter is the texture size
 +
 +
tex_size = 1024
 +
 +
This size must be a power of 2, and a size that is usable on most graphics cards, i.e not higher than 2048. The texture resolution will be tile_size/tex_size, so in our example it will be approximately 3.5m/pixel.
 +
 +
You can also control some memory cache parameters here:
 +
 +
shd_cache_sz = 200
 +
img_cache_sz = 200
 +
 +
These are given in megabytes and controls how much imagery you can hold in memory at a time when producing the textures. Set this as high as you can to avoid having to reload imagery all the time. The shd_cache_sz controls the amount of elevation data kept in  memory for shading, and img_cache_sz is the amount of imagery for the actual texture maps.
 +
  
 
=== Flags ===
 
=== Flags ===

Revision as of 21:24, 9 January 2010

This is the main configuration file for the texture map generator. It is very similar to the terrain config file and some of the parameters are the same.

Example

#----------------
# Common section
#----------------
tile_size_n = 3648
tile_size_e = 3648
start_n = 45.0974
start_e = 7.26291
ref_lat = 50
num_tiles_n = 32
num_tiles_e = 32

#------------------------
# Texture mapper section
#------------------------

# Texture resolution (tile_size/tex_size = Approx 3.5m/pixel)
tex_size = 1024

# Image format (DXT1/gzip compressed)
out_pixel_fmt = DXT1
out_file_ext = .dds.gz

# Work cache sizes (in Mb)
shd_cache_sz = 200
img_cache_sz = 200

#-------
# Flags
#-------
# Generate mipmaps yes/no (recommended)
mipmaps = true

# Generate shadows (Only if you have elevation data)
shadows = false

# Always overwrite existing files in the output directory
overwrite = true

#---------------
# Input section
#---------------
#Input images
image_dir {
  path = /data/geodata/images/aerial/
  recursive = true
  ext  = .tif
  pri  = 2
  coosys = +proj=utm +zone=30 +datum=WGS84
}

image_dir {
  path = /data/geodata/images/lores/
  recursive = true
  ext  = .tif
  pri  = 1
}

# Elevation data for shading

dem_dir {
  path   = /data/geodata/srtm
  ext    = .tif
  pri    = 1
}

dem_dir {
  path   = /data/geodata/srtm30
  ext    = .DEM.gz
  pri    = 0
}

Common section

This is where we define the area of the world covered by this scenery block. You need to either specify the number of tiles, a tile size and a start point, or alternatively the start/end points of the area. In this example we have chosen tile size and start point.

The tile size is given in meters in north- and east direction.

tile_size_n = 3648
tile_size_e = 3648

Now, since the tiles are parallell with the longitude lines, the width varies over the tile. This means that the tile_size_e parameter is only correct at the given reference latiude, ref_lat.

ref_lat = 50

In this case, the tile width is correct at 50 degrees latitude. Further north, the tile will be narrower, further south the tile will be wider.

The tile start location (south east corner) is given by:

start_n = 45.0974
start_e = 7.26291

And the number of tiles:

num_tiles_n = 32
num_tiles_e = 32

The number of tiles should always be the same in north- and east-direction, and it should always be a power of 2, i.e 2, 4, 8, 16, 32, 64, etc.

For performance, we recommend keeping the tile size around 4km.

Texture mapper section

This section contains parameters relevant to the generation of the image files. The most important parameter is the texture size

tex_size = 1024

This size must be a power of 2, and a size that is usable on most graphics cards, i.e not higher than 2048. The texture resolution will be tile_size/tex_size, so in our example it will be approximately 3.5m/pixel.

You can also control some memory cache parameters here:

shd_cache_sz = 200
img_cache_sz = 200

These are given in megabytes and controls how much imagery you can hold in memory at a time when producing the textures. Set this as high as you can to avoid having to reload imagery all the time. The shd_cache_sz controls the amount of elevation data kept in memory for shading, and img_cache_sz is the amount of imagery for the actual texture maps.


Flags

Input data section