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
VR-Related Classes
Работа с контентом
Оптимизация контента
Материалы
Визуальный редактор материалов
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Учебные материалы

EngineExpression Class

Warning
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.

This class is used to implement Scriptable Material expressions in UnigineScript. You should only use it to write materials-related logic.

See Also#

EngineExpression Class

Members


float noise ( float pos, float size, int frequency ) #

Returns a noise value calculated using a Perlin noise function.

Arguments

  • float pos - Float position.
  • float size - Size of the noise.
  • int frequency - Noise frequency.

Return value

Noise value.

float random ( float from, float to ) #

Returns a pseudo-random float number.

Arguments

  • float from - The initial point of the range.
  • float to - The end point of the range.

Return value

Random float number.

Node getNode ( ) #

Returns the current node.

Return value

The current node.

Node getParent ( ) #

Returns the parent node of the current node.

Return value

The parent node of the current node, if it exists; otherwise, NULL.

int getNumChildren ( ) #

Returns the number of node’s children.

Return value

The number of children for the node, if it exists; otherwise, 0.

Node getChild ( int num ) #

Returns the child node by its index.

Arguments

  • int num - Index of the child node to return.

Return value

The child node of the current node, if it exists; otherwise, 0.

Material getMaterial ( ) #

Returns the current material.

Return value

The pointer to the current material.

int getState ( string name ) #

Returns the value of the state.

Arguments

  • string name - Name of the state.

Return value

The value of the state for the material, if it exists; otherwise, 0.

void setState ( string name, int value ) #

Sets the value to the state by its name.

Arguments

  • string name - Name of the state.
  • int value - Value of the state.

Variable getParameter ( string param ) #

Returns the parameter of the material by its name.

Arguments

  • string param - Name of the parameter.

Return value

The value of the parameter for the material, if it exists; otherwise, 0.

void setParameter ( string param, Variable value ) #

Sets the value to the parameter by its name.

Arguments

  • string param - Name of the parameter.
  • Variable value - Value to set.

void getParameterArray ( Variable param, int value_id ) #

Returns a value of the array parameter (type: PARAMETER_ARRAY_FLOAT4) with the specified number and puts it to the specified buffer array.

Arguments

  • Variable param - Material parameter identifier. Can be of the following:
  • int value_id - ID of the buffer array to store parameter values.

void setParameterArray ( Variable param, int value_id ) #

Sets a value of the array parameter (type: PARAMETER_ARRAY_FLOAT4) with the specified number using the specified array.

Arguments

  • Variable param - Material parameter identifier. Can be of the following:
  • int value_id - ID of the array of values to be set.

Texture getTexture ( string name ) #

Returns the texture by its name.

Arguments

  • string name - Name of the texture.

void setTexture ( string name, Texture texture ) #

Sets the new texture to the specified texture slot of the material.

Arguments

  • string name - Name of the texture slot.
  • Texture texture - Pointer to the new texture.

void renderPassCompute ( string pass, int w, int h ) #

Calls the specified compute shader dispatch.

Arguments

  • string pass - Name of the pass.
  • int w - The number of thread groups dispatched in the X direction.
  • int h - The number of thread groups dispatched in the Y direction.

void renderPassCompute ( string pass, int w, int h, int d ) #

Calls the specified compute shader dispatch.

Arguments

  • string pass - Name of the pass.
  • int w - The number of thread groups dispatched in the X direction.
  • int h - The number of thread groups dispatched in the Y direction.
  • int d - The number of thread groups dispatched in the Z direction.

void renderPass ( string pass ) #

Renders the pass to the manually set render target.

Arguments

  • string pass - Name of the pass.

void renderPassToTexture ( string pass, Texture texture ) #

Renders the pass to the texture (render target initialization and realease is done automatically).

Arguments

  • string pass - Name of the pass.
  • Texture texture - Target texture for the pass rendering.
Last update: 16.08.2024
Build: ()