This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Basics
Rendering
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Version Control
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Sandworm
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
Materials and Shaders
Rebuilding the Engine Tools
GUI
Double Precision Coordinates
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
Content Creation
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

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: 2024-12-13
Build: ()