This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
Using Editor Tools for Specific Tasks
Extending Editor Functionality
Built-in Node Types
Nodes
Objects
Effects
Decals
Light Sources
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
Programming
Fundamentals
Setting Up Development Environment
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Generating Buildings

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.

Sandworm allows the procedural generation of buildings based on shapes stored in the vector data sources. This article reviews the general workflow. To customize the autogenerated buildings, prepare and use your assets, see the article on Buildings Customization.

1. Adding a Vector Data Source#

Currently, Sandworm allows using only offline vector data sources for the generation.

  1. In the Sources panel, add a new vector data layer.

    • Clicking on Vector opens the window for adding slots. Slots are designed to organize data.

      Slots

    • Clicking on + Add Layer provides the toolset for uploading vector data.
  2. In the Parameters panel, define the type of Data Source to be used: Assets or External Files. Currently, only *.shp and *.geojson are supported as assets. Therefore, if you have other types of files, you can try to add them as External Files.

    Click Import.

  3. In the window that opens, select the set of files to be used as vector data.

When the vector data source is added, its image is displayed atop all the layers in the Preview panel (you may change the order of layers display), and the Vector layer parameters become available.

2. Specifying Filters for Buildings#

A Filter is a set of rules used to pick the specific data from the list of all available vector data. The rules are created using Attributes: only the objects that fit the requirements of every Attribute are generated based on this Filter.

Filters are created as follows:

  1. Click the Add button in the Filters window of the Parameters panel.

    Double-click on the Filter to specify its name. To remove a Filter, use the Remove button. You can add as many Filters as necessary.

    The Share button allows shared use of the Filter among vector data layers. Select the vector data layer that will share this Filter in the pop-up window. Changes in a shared Filter will affect it in every vector data layer.

  2. Select a slot from those created by you (Sources -> Vector).
  3. Set an Attribute (or Attributes) for each Filter to filter specific data from the vector source. The required data is filtered using the Attribute values and a suitable operator. Autocomplete is available, and you can type in Attribute names and values.

  4. The available operators are: =, !=, >, <, ANY. ANY generates all the objects that have any value assigned for the selected Attribute.

    Warning
    When using > and <, make sure that the selected Attribute type is a number. String comparison may cause issues.

    You can also select Attribute values from the Attributes table. The table opens using the sign on the right of the Attribute expression.

    Double-clicking on a value in the table adds it to the Attribute value field.

  5. To add more Attributes, use the Plus button. You can add as many Attributes for one Filter as necessary. It is possible to set AND and OR relations between Attributes in the Filter.

    To remove a Filter, use the button to the right of the Attribute expression.

3. Specifying Parameters of Buildings#

In this step, we will set the parameters for buildings to be generated on the terrain according to the filtered data.

  1. On the Sources panel, click + Add Object.

  2. In the drop-down, select the type of object you want to generate according to the slot data. In our case, it is Buildings. Click Import.

Set the following object parameters:

Vector Slot

A slot that you created to organize data using Filters.

Object Name The name of the object that will be displayed in the Sources panel and used in the World Nodes hierarchy after the generation.
Generation Mode

Buildings' generation mode. Two options are available:

  • Auto — materials and roof types are assigned automatically, the set of materials available in the /core/materials/buildings/ folder is applied.
  • Manual — allows configuring materials and roof types. Selecting this mode enables additional parameters.
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.

Floor Attributes

The name of the column where the number of floors is specified, in the source data Attributes table.

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.

Notice
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.

4. Generating Buildings#

Now you need to configure the output settings and generate (or regenerate) the terrain that contains these buildings by clicking the Generate button.

If the terrain has already been generated and you made no changes to it, you can regenerate only the vector data. In the corresponding settings, disable the data types you don't need to be regenerated.

Generated buildings
Last update: 2021-12-13
Build: ()