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
Objects-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.FieldHeight Class

Inherits from: Field

This class is used to create and modify a field height. The field is applied to global water and specifies areas where height of waves should be changed.

Notice
The maximum number of the rendered FieldHeight objects per frame/bit mask is 8.

Creating a Height Field

Notice
When creating a FieldHeight object you should specify a heightmap texture for it as this object doesn't have any default texture.
Source code (C#)
// create a new instance of the FieldHeight class and set its transformation
FieldHeight height = new FieldHeight();
height.setTransform(Mat4(1));
// set the size of the field
height.setSize(vec3(4096.0f, 4096.0f, 512.0f));
// set the heightmap texture
height.setTexturePath("unigine_project/textures/fh_static.png");

See also#

UnigineScript API sample <UnigineSDK>/data/samples/fields/height_00

FieldHeight Class

Properties

Texture Texture#

The heightmap texture (from gpu) and saves it into the given texture instance.

string TexturePath#

The path to the fieldheight's heightmap texture.

int BlendMode#

The current field height blending mode.
Notice
Attenuation parameter is interpreted depending on the selected blending mode:
  • is used as a mulpiplier for the additive mode
  • lerp(1.0f, value, attenuation) is used for the multiplicative mode

int Order#

The current field height rendering order.
Notice
This parameter is used to properly apply fields with mixed blend modes.

float Power#

The fieldheight's power value. the power is a multiplier for loaded heightmap texture values.

float Attenuation#

The fieldheight's attenuation factor value. the attenuation factor indicates the rate of filedheight influence attenuation from the center of the object to its edges.

vec3 Size#

The vec3 size vector of the fieldheight's object.

Members


FieldHeight ( ) #

The default constructor. Creates a FieldHeight instance with the default size vec3(1.0f, 1.0f, 1.0f).
Notice
By default, a heightmap texture is empty. Specify it after creating the FieldHeight by using an appropriate function.

int SetTextureImage ( Image image ) #

Sets the given image as the heightmap texture of the FieldHeight.

Arguments

  • Image image - Image instance with heightmap for FieldHeight.

Return value

1 if the texture is set successfully; otherwise, 0.

int GetTextureImage ( Image image ) #

Grabs the texture for the FieldHeight (already loaded to GPU) and saves it into the given Image instance.

Arguments

  • Image image - Image instance into which the texture will be saved.

Return value

1 if the texture has been grabbed successfully; otherwise, 0.

static int type ( ) #

Returns the type of the object.

Return value

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