Buildings Customization
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.
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
- *_roof_sw — material for Roof
- *_ridge_face_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 |
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 |
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_ridge_face_sw.mat |
covered with metal | metal |
metal_roof_sw.mat metal_ridge_face_sw.mat |
covered with concrete | concrete |
concrete_roof_sw.mat concrete_ridge_face_sw.mat |
Custom Parameters#
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 figure 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 Floor Offset (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 Floor Offset (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. |
See Also#
- The Procedural Generation Assets add-on containing a pack of ready-to-use materials and textures to customize buildings