This page has been translated automatically.
Видеоуроки
Интерфейс
Основы
Продвинутый уровень
Подсказки и советы
Основы
Программирование на C#
Рендеринг
Профессиональный уровень (SIM)
Принципы работы
Свойства (properties)
Компонентная Система
Рендер
Режимы вывода изображения
Физика
Браузер SDK 2
Лицензирование и типы лицензий
Дополнения (Add-Ons)
Демонстрационные проекты
API Samples
Редактор UnigineEditor
Обзор интерфейса
Работа с ассетами
Контроль версий
Настройки и предпочтения
Работа с проектами
Настройка параметров ноды
Setting Up Materials
Настройка свойств
Освещение
Sandworm
Использование инструментов редактора для конкретных задач
Расширение функционала редактора
Встроенные объекты
Ноды (Nodes)
Объекты (Objects)
Эффекты
Декали
Источники света
Geodetics
World-ноды
Звуковые объекты
Объекты поиска пути
Player-ноды
Программирование
Основы
Настройка среды разработки
Примеры использования
C++
C#
UnigineScript
Унифицированный язык шейдеров UUSL (Unified UNIGINE Shader Language)
Плагины
Форматы файлов
Материалы и шейдеры
Rebuilding the Engine Tools
Интерфейс пользователя (GUI)
Двойная точность координат
API
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

Unigine.LandscapeLayerMap Class

Inherits from: Node

This class is used to manage landscape layer maps of the Landscape Terrain object. Landscape layer map data (height, albedo, masks, settings) is stored in a .lmap file (see the LandscapeMapFileCreator and LandscapeMapFileSettings classes). A landscape map has a single resolution and density, and cannot have insets. Insets are created by adding a high-resolution landscape layer map above the low-resolution one.

Several maps can be blended with each other. Blending parameters for the landscape layer map are controlled via the corresponding methods of the LandscapeMapFilesettings class.

Maximum and Minimum Terrain Height#

This example demonstrates how to obtain minimum and maximum height values for the whole Landscape Terrain (all layer maps) along with the enclosing bounding box. For this puprose we should find all LandscapeLayerMap objects in the World, extend a bounding box to enclose all of them, and use the getExtremumHeight() method to get minimum and maximum height values.

Source code (C++)
WorldBoundBox b;
float min = 99999, max = -9999;
Vector<NodePtr> v;
World::getNodes(v);
for (auto & it : v)
{
	if (it->getType() == Node::LANDSCAPE_LAYER_MAP)
	{
		b.expand(it->getWorldBoundBox());
		auto ext = checked_ptr_cast<LandscapeLayerMap>(it)->getExtremumHeight();
		if (ext.x < min)
			min = ext.x;
		if (ext.y > max)
			max = ext.y;
	}
}
vec3 minp = vec3(b.getMin());
vec3 maxp = vec3(b.getMax());
minp.z = min;
maxp.z = max;
BoundBox bb = BoundBox(minp, maxp);
Visualizer::renderBoundBox(bb, Mat4_identity, vec4_red);

LandscapeLayerMap Class

Properties

string Path#

The path to the *.lmap file containing landscape map data.

bool Collision#

The value indicating if collision detection is enabled for the landscape layer map.

bool Intersection#

The value indicating if intersection detection is enabled for the landscape layer map.

bool IntersectionBicubicFilter#

The value indicating if bicubic filtering is enabled for height texture (collision and intersection detection and fetch requests) and normals texture (intersection detection and fetch requests).

bool Culling#

The value indicating if heights data of the layer map is to be used for culling precalculation. In order to define which parts of the terrain are to be rendered a culling test is required. This test is performed on the basis of a precalculated low-detail height map, combining heights data of all landscape layer maps having a significant impact on the result. Precalculation is performed on the CPU side, so processing a large number of landscape layer maps may reduce performance. Moreover, some layer maps may be used as decals (i.e. their impact on the resulting height map is insignificant). For such cases you can simply disable this option to avoid unnecessary calculations.

int Order#

The current rendering order for the landscape layer map. A map with a higher order value shall be rendered above the ones with lower ones.

vec2 Size#

The two-component vector (X, Y) defining the size of the landscape layer map along X and Y axes, in units.

float HeightScale#

The scale factor used for heights data.

vec2 TexelSize#

The two-component vector (X, Y) defining the size of the texel of the landscape layer map textures along X and Y axes.

bool IsInit#

The value indicating if the landscape layer map is initialized.

ivec2 Resolution#

The two-component vector (X, Y) representing landscape map resolution along X and Y axes, in pixels.

vec2 FadeAttenuation#

The two-component vector (X, Y) defining the fade attenuation of the landscape layer map along X and Y axes.

bool IsCompressed#

The value indicating if the landscape layer map is compressed.

vec2 AlbedoFadeAttenuation#

The two-component vector (X, Y) defining the fade attenuation of the albedo data along X and Y axes.

vec2 HeightFadeAttenuation#

The two-component vector (X, Y) defining the fade attenuation of the height data along X and Y axes.

Landscape.BLENDING_MODE AlbedoBlending#

The blending mode, one of the Landscape.BLENDING_MODE values.

Landscape.BLENDING_MODE HeightBlending#

The blending mode, one of the Landscape.BLENDING_MODE values.

bool IsEnabledOpacityAlbedo#

The value specifying if albedo data with an additional opacity mask applied is enabled for the landscape layer map.

bool IsEnabledOpacityHeight#

The value specifying if heightmap with an additional opacity mask applied is enabled for the landscape layer map.

bool IsEnabledAlbedo#

The value specifying if albedo data is enabled for the landscape layer map.

bool IsEnabledHeight#

The value specifying if height data is enabled for the landscape layer map.

Members


LandscapeLayerMap ( ) #

The LandscapeLayerMap constructor.

UGUID GetGUID ( ) #

Returns the GUID of the LandscapeLayerMap node.

Return value

GUID of the LandscapeLayerMap node.

vec2 GetExtremumHeight ( float precision = 1.0f ) #

Returns the minimum and maximum height of the landscape layer map as a two-component vector.

Arguments

  • float precision - Precision value in the [0.0f, 1.0f] range. The default value is 1.0f (maximum).

Return value

The two-component vector (X, Y) defining the minimum (X) and maximum (Y) height of the landscape layer map.

static int type ( ) #

Returns the type of the node.

Return value

LandscapeLayerMap type identifier.
Last update: 13.12.2024
Build: ()