Buildings Customization and Parameters
You should upgrade to
This article reviews the main concepts of the building composition to give a deeper understanding of how the assets should be prepared.
See Also#
- Example of creating a Building object
- Filter parameters description
- The Procedural Generation Assets add-on containing ready-to-use materials and textures to customize buildings
Main Concepts#
For the sake of the generation of buildings, we differentiate between the following two types of buildings:
- Single-story buildings, which have only one floor
- Multi-story buildings, which have two or more floors
- Underground Basement is the part of the basement that goes down under the terrain level. This part is required when a building is generated on uneven terrain and would otherwise partially hover above the ground. Its height is controlled by the Underground Basement Height value and is 3 meters down from the terrain level by default.
- The Basement height is defined by the Basement Height value and is 0.7 meter high above terrain by default.
- The Ground Floor height is defined by the Row Size value and is 3 meters high by default.
- Single-story buildings don't require any texture for upper floors, while the texture for the basement is mandatory, as it is an anchor for all other textures in a set.
Buildings Texturing#
UNIGINE provides a set of built-in materials for generated buildings: they are inherited from mesh_base and named according to the rules. You can also create your custom textures and set up materials. However, your textures should meet a set of requirements described below.
Four types of textures should be prepared for a building: a texture for the basement, a texture for the wall with windows (and sometimes doors), a texture for the solid wall, and a texture for the roof. The UV map of each part of the building depends on the size of the wall segment that is shown on the texture.
-
For Underground Basement and Basement, a single texture for a wall is applied. The texture height corresponds to the height of all these parts (in sum), and the texture is stretched vertically to fit this part of the building.
Texture for Underground Basement and Basement -
For the Ground Floor, an individual texture is applied. The texture height is applied to the building using the Row Size value as the floor height.
Texture with windows for Ground FloorSolid texture for Ground Floor -
For Upper Floors, a single texture for a wall with windows is applied.
Texture with windows for Upper FloorsSolid texture for Upper FloorsThere are two parameters — Rows per Texture and Columns per Texture — that form a grid for this texture.
The texture for the upper floors with windows is applied wherever possible along the wall from the first floor upward and from the center to the building corners horizontally and is cut according to these imaginary grid lines, creating one surface. Edges are tiled using the solid texture and form another surface.
-
For Roof, two textures should be applied — for the roof and the ridges. Ridges are used to cover the connection of two roof planes.
Roof textureRidges textureThe roof material can be used as is or change the color based on the imagery data. Enabling the corresponding option allows multiplying the material albedo by the color taken from the imagery data.
Materials Naming#
For materials to be correctly applied by Sandworm to the generated buildings, follow these rules:
-
Define a prefix that a group of materials applied to walls (basement, ground floor, and upper floors) will use.
You can use the source data material value as the prefix of the material. In this case, the material will be applied automatically to all buildings that have this value assigned.
Roof materials also can use a key value of source data as a prefix. In this case, the material will be applied automatically to all roofs that have this value assigned.
If your source data don't have material details, you can choose an arbitrary name.
-
Materials should use the following name postfixes:
- *_basement_sw — material for Basement and Underground Basement, a mandatory material which is an anchor for other building materials, except roofs.
- *_ground_sw — material for the Ground Floor wall without doors and windows
- *_ground_windows_sw — material for the Ground Floor wall with doors and windows
- *_upper_sw — materials for the Upper Floors wall with doors and windows
- *_upper_windows_sw — materials for the Upper Floors wall without doors and windows
- *_ridge_face_sw — materials for the top part of the upper wall to be applied right below the roof. This type of material is used with flat roofs only.
- *_roof_sw — material for Roof
- *_ridges_sw — material for the Roof ridges connecting the roof sections
The basic set of building materials is available in the /core/materials/buildings/ folder.
Naming Example#
Let's assume we have an area with buildings, which can be made of bricks or wood. If we use OSM data with their specific naming, we should use the following prefixes for building materials:
Building | OSM Value | Material Names |
---|---|---|
made of bricks | brick |
brick_basement_sw.mat brick_ground_sw.mat brick_ground_windows_sw.mat brick_upper_sw.mat brick_upper_windows_sw.mat brick_ridge_face_sw.mat |
made of wood | wood |
wood_basement_sw.mat wood_ground_sw.mat wood_ground_windows_sw.mat wood_upper_sw.mat wood_upper_windows_sw.mat wood_ridge_face_sw.mat |
Then, the roofs of these buildings can be covered with tiles, metal, or concrete. According to the OSM roof material naming, we should name the roof materials as follows:
Roof | OSM Value | Material Name |
---|---|---|
covered with tiles | roof_tiles |
roof_tiles_roof_sw.mat roof_tiles_ridges_sw.mat |
covered with metal | metal |
metal_roof_sw.mat metal_ridges.mat |
covered with concrete | concrete |
concrete_roof_sw.mat concrete_ridges_sw.mat |
Parameters#
The following parameters for the Buildings object generation are available:
Generation Mode | Buildings generation mode. There are two options:
|
---|---|
Base Material Attributes |
The name of the column where the building material is specified, in the source data Attributes table. By default, the corresponding OpenStreetMap key is used. You can replace it or add another key using a comma, if necessary. |
Roof Type Attributes |
The name of the column where the roof shape is specified, in the source data Attributes table. By default, the corresponding OpenStreetMap key is used. You can replace it or add another key using a comma, if necessary. |
Roof Height Attributes |
The name of the column where the roof height is specified, in the source data Attributes table. By default, the corresponding OpenStreetMap key is used. You can replace it or add another key using a comma, if necessary. |
Roof Unit Size (m) | The size of one side of the square area to which the texture is applied (i.e. one tile). |
Use Imagery Color | If disabled, the color from the roof material is used. If enabled, the color from the Imagery source is used as the roof color. To use the imagery color, the roof material should have the Vertex Color state enabled with Vertex Color Albedo set to RGB. |
Roof Material Attributes |
The name of the column where the roof material is specified, in the source data Attributes table. By default, the corresponding OpenStreetMap key is used. You can replace it or add another key using a comma, if necessary. |
Split Length (km) |
The size of the grid cell by which the generated geometry will be divided. The geometry of each cell is represented as a separate ObjectMeshStatic object. If the specified value exceeds or equals the size of the Export Area, a single Static Mesh will be generated. For example, if you specify 100 and have a 1000x1000 km area, the buildings will be generated as 10 separate Static Mesh objects, 100x100 km each. |
Min Visibility | Minimum visibility distance from the camera at which generated objects (ObjectMeshStatic) start to appear on the screen. By default, this value is -inf. |
Max Visibility | Maximum visibility distance at which generated objects (ObjectMeshStatic) are no longer fully visible: they can either disappear entirely or start to fade out. By default, this value is inf. |
Min Fade | Minimum fade distance, over which generated objects (ObjectMeshStatic) fade in until they are entirely visible. Along this distance, the engine automatically interpolates the level of detail from Alpha of 0.0 (entirely invisible) to 1.0 (entirely visible). Fading-in starts when the camera has reached the minimum visibility distance and is in the full visibility range. |
Max Fade | Maximum fade distance, over which generated objects (ObjectMeshStatic) fade out until they are entirely invisible. Fading-out starts when the camera has reached the maximum visibility distance and is out of the full visibility range. |
In addition to the basic parameters that are available for Auto generation, the following parameters become available in the Manual generation mode:
Base Parameters:
Base parameters fine-tune the look of the building walls. |
|||||||||
Base Material Distribution |
|
||||||||
---|---|---|---|---|---|---|---|---|---|
Random Material List | The list of materials that will be applied to generated buildings. Only the base material (*_basement) of each group is displayed. Other materials from this group are referred to using the prefix, which should be identical for all materials of a group. The number right to each material specifies its frequency. The toggle to the left of each material allows enabling/disabling it. | ||||||||
Column Size (m) | Width of one texture column, in meters. A texture cell is mapped to this width on the building wall. | ||||||||
Columns per Texture | Number of columns in one texture. This value allows forming a grid for a more precise texture mapping. The texture mapped to walls above the ground floor is split into a grid in order to be cut properly, avoiding such visual artifacts as a part of a window. | ||||||||
Row Size (m) | Height of one row, in meters. In fact, this is a floor height. A texture cell is mapped to this height on the building wall. | ||||||||
Rows per Texture | Number of rows in one texture. This value allows forming a grid for a more precise texture mapping. The texture mapped to walls above the ground floor is split into a grid in order to be cut properly, avoiding such visual artifacts as a part of a window. | ||||||||
Floor Number |
|
||||||||
Floor Number Range | Minimum and maximum floor number values. A random value from this range will be used as a floor number if no data is available or Floor Number is set to Random. | ||||||||
Roof Parameters:
Roof parameters fine-tune the look of roofs. |
|||||||||
Roof Type Distribution |
|
||||||||
Roof Type | Type of the roof with a probability multiplier. The following types of roofs are available:
You can delete the roof types that are not required to exclude them at all. You can add the previously deleted type by clicking the button and selecting it in the drop-down window. If the same roof type is set more that once, the value set for the line closer to the bottom will count. If a building top-down form is different from rectangular, it will be with a flat roof. Other types of roofs are unavailable for such buildings. |
||||||||
Roof Height Distribution |
|
||||||||
Roof Type Height | The height range (minimum and maximum possible height) of the corresponding roof type. A random value is taken from this range, if necessary. The height value for the flat roof defines the height of the roof parapet. If the same roof type is set more that once, the value set for the line closer to the bottom will count. |
||||||||
Roof Material Distribution | |||||||||
Roof Type Material | The material set for the corresponding roof type. You can enable or disable materials, to avoid incorrect use of a material for an unsuitable type of roof, for example, disable tiles for flat roofs because it's nonsense.
If the same roof type is set more that once, the value set for the line closer to the bottom will count. |
||||||||
Common Parameters:
Common parameters fine-tune the look of the basement, visibility of buildings, and splitting of the Buildings object into sectors. |
|||||||||
Underground Basement Height (m) | The height of the underground basement part. Used for uneven ground surfaces where buildings partially hover above the ground. The default value is 3 meters. You can set this value to 0.7 if you don't require it to be displayed. | ||||||||
Basement Height (m) | The height of the basement above the terrain level. The default value is 3 meter. You can set this value to 0 if you don't require it to be displayed. |