Changes between Version 15 and Version 16 of OsgTerrainData


Ignore:
Timestamp:
Oct 30, 2011, 11:32:08 AM (13 years ago)
Author:
Torben Dannhauer
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • OsgTerrainData

    v15 v16  
    6666To shift system load from HDD to CPU, compress all textures lossless with LZW. This will decrease rendering time a lot, because usually the HDD ist the bottleneck.
    6767
     68If you have texture data with void pixels, skip this step and cover the compression in the next script.
     69
    6870This is an example bash script to process the images:
    6971{{{
     
    8082}}}
    8183
    82 == create overviews ==
     84== Mark void Pixel as NODATA ==
     85
     86If you have textures which are not completely filled with data, GDAL has to detect which part of the texture is void and which is regular texture data. Therefore you can save the NODATA placeholder into the file so the reader knows how to interpret this data.
     87Usually nodata Pixels in textures are saved as black pixel (RBG=0,0,0). This works fine even without a valid NODATA entry, because VPB/GDAL checks for the black texture pixels, which are unlikely to be a valid texture part.
     88The situation is different if you want to add overviews to reduce the compile time of your database: If the pixels are not marked as void pixel by setting the NODATA flag, the overview interpolation algorithm will include the black pixels into the calculation.
     89This causes the valid pixels on the edge to the NODATA pixels to be interpolated with the black (the NODATA) pixels and they are darken. Because they are not completely black they won't be excluded by VPB/Gdal and your Hi-Res inlay to be surrounded with a thin black line.
     90
     91If you zoom into the scene near enough to see a VPB-tile created from the original image and not from an overview the black border will disappear.
     92
     93To avoid the described problem, you should ensure that all void data in your textures has a well defined value which you can set as NODATA value.
     94This is an example script to set the NODATA value to black (0,0,0):
     95{{{
     96cat compressNdefineNODATA.sh
     97
     98#!/bin/bash
     99cd /home/user/your/path/to/imagery
     100for file in `dir -d *` ; do
     101echo "$file :"
     102/usr/bin/gdal_translate -of GTiff -co "COMPRESS=LZW" -a_nodata 0 $file nodata/$file
     103done
     104}}}
     105
     106== create Overviews ==
    83107
    84108To reduce system load to resize the terrain textures on the fly multiple times, you should consider to create overviews embedded into your imagery.
     
    88112
    89113Average interpolation has the advantage that is does not involve a 3x3 or 4x4 matrix, but only the adjacent pixels itself. So it does not lead to black edges on curved imagery edges with adjacent NODATA pixels.
    90 Gauss interpolation is only suitable on tiles without NOTDATA values, gut it smoothes the image which leads to better results in images with sharp edges or high frequency content.
     114Gauss interpolation is only suitable on tiles without NOTDATA values, gut it smooths the image which leads to better results in images with sharp edges or high frequency content.
    91115
    92116This is an example bash script to process the images:
     
    101125done
    102126}}}
    103 
    104127
    105128== Moon Data ==