Heightfield and Heightmaps

This page will explain the parameters of a heightfield map. A tutorial on how to create a heightfield map is also included.

Heightfield Map and Customization

The heightmap is built from different heightfield maps files.

A basic heightfield map is already included with Ürban PAD, but you will need to create your own maps if you wish to customize the heightfield. You will need to create these files using graphic design software like GIMP or CrazyBump.

You can add a custom heightfield map to your City Project from a directory by clicking on the Properties tab and selecting Heightfield under the World settings menu. You can also change the size of the zones as well as the altitude of the terrain within this interface.

The following parameters are present within the heightfield settings:

  • Map Folder: refers to the folder which contains these heightmap files (the tutorial will explain the different files that need to exist in the heightmap folder).
  • Min Height: the height of the lowest point of heightmap (might be negative if it’s the bottom of a body of water)
  • Max Height: the height of the highest point of heightmap (top of a mountain)
  • Min Altitude: minimum altitude for object placement (to be compared to sea level altitude)

Note: Changing the heightfield to include altitude fluctuations (hills, valleys, bodies of water) may result in needing to use special Positioning Policies in order to place your content correctly. (See Follow Support Policy for an explanation of the The “Mesh Sink” Problem.)

Heightfield Map Description

A heightfield is composed of four different kind of maps:

  • Relief
  • Shadow
  • Texture
  • Global buildable zone

Relief

The relief map allows a positive or negative relief to be applied to the generated city. Its format is .pgm. The relief map could be created with graphic design software like GIMP.

This relief map must be named map_dem.pgm. If it is not, Ürban PAD will not recognize the heightmap and the city generator will not function.

Shadow

The shadow map can be used to apply graduated light effects to make the relief map more authentic.

Its format is .ppm: heightmap shadow. It could be created from a .pgm file with CrazyBump or similar software.

This map must be named map_norm.ppm. If it is not, Ürban PAD will not recognize the heightmap and the city generator will not function.

Texture

The texture map allocates a blending of textures according to the RGB colorimetric system.

It has to be named map.png and refers to the following 6 other files:

  • map1.jpg: texture map R
  • map1_normal.jpg: texture map R shadow (created from .jpg with CrazyBump for instance)
  • map2.jpg: texture map G
  • map2_normal.jpg: texture map G shadow
  • map3.jpg: texture map B
  • map3_normal.jpg: texture map B shadow

Global Buildable Zone

An accessibility map can specify the authorized areas for parcel construction in the city simulation.

This map must be named accessibility.jpg and should contain white (= buildable zones) and black (= unbuildable zones).

You could also add a file named forbidden.txt to define a polygon describing unbuildable areas.

Heightmap Creation Tutorial

Here is a brief tutorial on how to custom-create a heightmap using graphic design software.

Step 1

_images/hmap_12.png _images/hmap_13.png

Create or select an existing heightmap using your preferred software in BW mode.

In this example, a heightmap was created with a design application, then converted into a grayscale .pgm file for use as the relief map.

As stated in Relief, this map must be named map_dem.pgm.

Step 2

_images/hmap_14.png

You will now edit the .pgm map with RGB values corresponding to relief features. Save the result as a .png texture map.

Next, assign a texture to each RGB value by naming the each texture map_1.png (for example), and a corresponding normal file (map_1_normal.jpg, for example):

_images/hmap_5.png _images/normal_1.png

Figure: map_1.png and its corresponding normal map, map_1_normal.jpg.

Step 3

Create an accessibility map in .jpg format. Use black and white values to mark off areas where building cannot occur. White areas can be built upon, while black areas cannot.

If you wish to make all of the city accessible, create a plain white accessibility map.

Name your accessibility map accessibility.jpg.

See Optional Step II for more information about accessibility constraints and environment layer maps.

Step 4

Put all maps and associated textures in one folder.

_images/hmap_6.png

Step 5

Import your heightfield map into your City Project by clicking on the Heightfield option in Settings and selecting this folder.

Optional Step

You may also create a black-and-white .png map defining buildable and non-buildable zones. You may build in white zones, but not in black zones.

Optional Step II

You may also create a black-and-white map defining buildable and non-buildable zones and use this map as an environment layer map, defining areas where certain activities can and cannot be constructed in your world.

_images/hmap_8.png

The map shown above was built to restrict the placement of factories to the upper right-hand corner of the map.

_images/hmap_9.png

The render shows that factory placement is confined to this area of the map:

_images/hmap_10.png

This was made possible by defining the map as an environment layer map in the City Designer city specification field and creating a relation between the environment layer and the factory in the Influences parameter:

_images/hmap_15.png
  • Right-click on the Environment Layer parameter in the specification interface to add a map.
  • Select the environment layer map in the map folder that you have created for your city project.
  • Left-click on the Influences parameter in the specification interface, then on the advanced menu at right to display the Influences interface.
  • Create a relation between the environment layer map and the activity that you want it to control.
  • Specify a numerical value for the intensity between the layer map and the activity.

Note: You must specify a numerical value for the intensity between the layer map and the activity. However, the numerical value is not important, as it would be in a relationship between two activities. This is because the relationship created by the imposition of a layer map is absolute.

For this same reason, you do not need to specify a range for the intensity.