Howto:Adding Cliffs To Terrain: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Switched "(Under construction)" to the {{WIP}} template.)
No edit summary
Line 26: Line 26:
  cliff-decode <scenery_top>/work/SRTM-3 <scenery_top>/data/cs_cliffs
  cliff-decode <scenery_top>/work/SRTM-3 <scenery_top>/data/cs_cliffs


The example command places multiple files with extension <code>cliff</code> in each of the area "buckets" underneath the <code>SRTM-3</code> directory, if any cliffs are present, of course! TerraGear (version 2019.1 "next") will '''not''' interpolate elevations across any of these cliff lines when constructing terrain.
The example command places multiple files with extension <code>cliffs</code> in each of the area tile subdirectories underneath the <code>SRTM-3</code> directory, if any cliffs are present, of course! TerraGear (version 2019.1 "next") will '''not''' interpolate elevations across any of these cliff lines when constructing terrain.


===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>cliff</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 (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.


  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


After running this command a series of files with extension <code>rectified</code> will be found in the height subdirectories.  TerraGear will preferentially use these files when interpolating elevations,
After running this command a series of files with extension <code>rectified</code> will be found in any elevation subdirectories within the lat/long boundaries.  TerraGear will preferentially use these files when interpolating elevations, as well as not interpolating across cliff lines. If you skip the rectification step, TerraGear with rectify on the fly for every point, potentially duplicating rectification calculations for the same group of points many times.
as well as not interpolating across cliff lines. If you skip the rectification step, TerraGear with rectify on the fly for every point, potentially duplicating rectification calculations for the same group of points many times.
 
==Adding cliff objects to the terrain==
 
The previous steps have only corrected the elevation calculations for points in the vicinity of cliffs. Unless a terrain object is created that runs along the cliff line, the cliff itself will not appear.
 
===Step 4:Adding cliff quadrilaterals to the terrain===
 
Cliffs are created from the line data created in Step 1, using the same <code>ogr-decode</code> used for other shapefiles.  Use an area type of "Cliffs" to match the type used in <code>default-priorities.txt</code>.  The line width of 5 metres means that the horizontal distance from the bottom to the top of the cliff will be 5 metres. This can be made smaller or larger as desired. The additional <code>--texture-cliffs</code> option will ensure that the texture coordinates map onto the cliff face and that neighbouring faces match; without this option the texture coordinates will be calculated from the latitude and longitude, leading to textures that are very stretched vertically.
 
ogr-decode --line-width 5 --texture-cliffs --area-type Cliffs "<scenery_top>/work/Cliffs" "<scenery_top>/data/cs_cliffs"
 
==Building the new scenery==
 
Run <code>tgconstruct</code> as usual, making sure to include the <code>Cliffs</code> directory created in step 4.
 
==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:
 
<material>
<name>Cliffs</name>
  <effect>Effects/cliffs</effect>
  ... (elided)
</material>
 
The cliff effect includes both procedural texturing at highest rendering quality settings, and normal ALS texturing otherwise. Parameters for procedural texturing are the same as those for rock: see the relevant section of the [[Procedural Texturing]] page. Proper texturing relies on cliffs that were generated with the <code>--texture-cliffs</code> option (see above).
29

edits

Navigation menu