Howto:Adding Cliffs To Terrain: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
(Added before/after images of cliffs)
mNo edit summary
Line 5: Line 5:
Terrain generated from elevation data on a grid (e.g. Shuttle mission SRTM data) will tend to smooth out abrupt changes in height, such as cliffs. This is because each point on the grid records the average height in the region of the point, and TerraGear will, by default, smoothly interpolate between these points. So even if the grid elevation points were true point heights, the change in elevation is spread over the distance to the next grid point and cliffs become steep (or not-so-steep) slopes.  The procedure below describes how to avoid these smoothing effects and properly texture the resulting near-vertical surfaces.
Terrain generated from elevation data on a grid (e.g. Shuttle mission SRTM data) will tend to smooth out abrupt changes in height, such as cliffs. This is because each point on the grid records the average height in the region of the point, and TerraGear will, by default, smoothly interpolate between these points. So even if the grid elevation points were true point heights, the change in elevation is spread over the distance to the next grid point and cliffs become steep (or not-so-steep) slopes.  The procedure below describes how to avoid these smoothing effects and properly texture the resulting near-vertical surfaces.


[[File:Sydney North Heads before including cliffs.png|thumb|North entrance to Sydney harbour constructed from SRTM-3 data without including information about cliff location.]]
[[File:Sydney North Heads before including cliffs.png|thumb|North side of entrance to Sydney harbour constructed from SRTM-3 data without including information about cliff location.]]
[[File:Sydney North Heads with cliffs included.png|thumb|North entrance to Sydney harbour constructed from SRTM-3 data after providing cliff location information to TerraGear.]]
[[File:Sydney North Heads with cliffs included.png|thumb|North side of entrance to Sydney harbour constructed from SRTM-3 data after providing cliff location information to TerraGear.]]


The following instructions assume that you are familiar with the [[TerraGear]] toolchain, extracting data from OpenStreetMaps, and creating shapefiles. In the commands below, <code><scenery_top></code> refers to a directory with a conventional layout for scenery construction, that is, containing shapefile and height data in <code>data</code>, intermediate files in <code>work</code>, and output in <code>output</code>. Other files are placed in <code>scenery_top/rawdata</code>
The following instructions assume that you are familiar with the [[TerraGear]] toolchain, extracting data from OpenStreetMaps, and creating shapefiles. In the commands below, <code><scenery_top></code> refers to a directory with a conventional layout for scenery construction, that is, containing shapefile and height data in <code>data</code>, intermediate files in <code>work</code>, and output in <code>output</code>. Other files are placed in <code>scenery_top/rawdata</code>
Line 26: Line 26:
===Step 2: add cliff data to height data===
===Step 2: add cliff data to height data===


Tool <code>cliff-decode</code> distributed with TerraGear (version "next" as of early 2019) takes a cliff shapefile for an area and divides it up amongst the height tiles ("buckets") that make up that area, so that elevation calculations can use these cliff lines as known discontinuities in the topography. The first argument is the location of the directory tree containing height files, and the second is the shapefile generated in the previous step:
Tool <code>cliff-decode</code> distributed with TerraGear (from version 2019.2) takes a cliff shapefile for an area and divides it up amongst the height tiles ("buckets") that make up that area, so that elevation calculations can use these cliff lines as known discontinuities in the topography. The first argument is the location of the directory tree containing height files, and the second is the shapefile generated in the previous step:


  cliff-decode <scenery_top>/work/SRTM-3 <scenery_top>/data/cs_cliffs
  cliff-decode <scenery_top>/work/SRTM-3 <scenery_top>/data/cs_cliffs
Line 34: Line 34:
===Step 3: rectify heights (optional but desirable)===
===Step 3: rectify heights (optional but desirable)===


The <code>rectify_height</code> tool supplied with Terragear (version "next" as of early 2019) uses any <code>cliffs</code> files found in the elevation directories to improve the elevation information. The argument <code>--min-dist</code> specifies how far away from a cliff a point must be in order for its height to be trustworthy. Any points closer than this distance will be interpolated from the trustworthy points. If no trustworthy points can be found (for example, the top of a small butte), the elevations are not changed. A suitable value should be at least 1 elevation grid spacing.
The <code>rectify_height</code> tool supplied with Terragear (in versions starting from 2019.2) uses any <code>cliffs</code> files found in the elevation directories to improve the elevation information. The argument <code>--min-dist</code> specifies how far away from a cliff a point must be in order for its height to be trustworthy. Any points closer than this distance will be interpolated from the trustworthy points. If no trustworthy points can be found (for example, the top of a small butte), the elevations are not changed. A suitable value should be at least 1 elevation grid spacing.


  rectify_height --work-dir=<scenery_top>/work/ --height-dir=SRTM-3 --min-lon=151.0 --max-lon=152.0 --min-lat=-34.0 --max-lat=-33.0 --min-dist=100
  rectify_height --work-dir=<scenery_top>/work/ --height-dir=SRTM-3 --min-lon=151.0 --max-lon=152.0 --min-lat=-34.0 --max-lat=-33.0 --min-dist=100
Line 56: Line 56:
==Texturing cliffs==
==Texturing cliffs==


Refer to the [[Howto:Regional Texturing]] page for general information on setting up regional materials. A cliff Effect is supplied with Flightgear (in "next" from early 2019). To use this, simply add the following at the top of the material definition file for the region:
Refer to the [[Howto:Regional Texturing]] page for general information on setting up regional materials. A cliff Effect is supplied with Flightgear (version 2019.2 onwards). To use this, simply add the following at the top of the material definition file for the region:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">
29

edits

Navigation menu