This page has been translated automatically.
Video Tutorials
Interface
Essentials
Advanced
How To
Professional (SIM)
UnigineEditor
Interface Overview
Assets Workflow
Settings and Preferences
Working With Projects
Adjusting Node Parameters
Setting Up Materials
Setting Up Properties
Lighting
Landscape Tool
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
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.

LightVoxelProbe 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.
Inherits from: Light

This class allows creating and managing voxel probes.

LightVoxelProbe Class

Members


static LightVoxelProbe ( ) #

Constructor. Creates a new voxel probe with default parameters.

int setTextureImage ( Image image ) #

Sets the given image as the 3D texture of the voxel probe.

Arguments

  • Image image - 3D texture to set.

Return value

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

int getTextureImage ( Image image ) #

Bakes lighting and saves into the given Image instance.

Arguments

  • Image image - Image into which the light will be baked.

Return value

1 if the light has been baked successfully; otherwise, 0.

void setAttenuationPower ( float power ) #

Sets the power of light attenuation used to simulate intensity gradual fading. This parameter determines how fast the intensity decreases up to the attenuation distance set for the light source.

Arguments

  • float power - Attenuation power value.

float getAttenuationPower ( ) #

Returns the power of light attenuation used to simulate intensity gradual fading.

Return value

Attenuation power value.

void setBakeInternalVolume ( int volume ) #

Sets internal volume baking mode for the voxel probe (voxels that don't touch geometry.
Notice
If internal volume baking is disabled, only the voxels covering geometry are baked while empty ones are skipped.

Arguments

int getBakeInternalVolume ( ) #

Returns the current internal volume baking mode for the voxel probe (voxels that don't touch geometry).
Notice
If internal volume baking is disabled, only the voxels covering geometry are baked while empty ones are skipped.

Return value

Current internal volume baking. One of the LIGHT_VOXEL_PROBE_BAKE_INTERNAL_VOLUME_* values.

void setVoxelSize ( float size ) #

Sets the size of a voxel of the voxel probe.

Arguments

  • float size - Voxel Size value, in units.

float getVoxelSize ( ) #

Returns voxel size of the voxel probe.

Return value

Voxel Size value.

void setBakeViewportMask ( int mask ) #

Sets a mask that specifies materials to take part in light baking.

Arguments

  • int mask - Bake viewport mask (integer, each bit of which is used to represent a mask).

int getBakeViewportMask ( ) #

Returns the mask that specifies materials taking part in baking.

Return value

The bake viewport mask (integer, each bit of which is used to represent a mask).

void setTexturePath ( string path ) #

Sets a path to a light texture.

Arguments

  • string path - Path to a light texture.

string getTexturePath ( ) #

Returns the path to the lighting texture used for the voxel probe.

Return value

Path to the texture.

void setBoxSize ( vec3 size ) #

Sets the box size for the voxel probe.

Arguments

  • vec3 size - Box size along X, Y and Z axes.

vec3 getBoxSize ( ) #

Returns the current box size for the environment probe.

Return value

Box size along X, Y and Z axes.

void setBakeZFar ( float zfar ) #

Sets the distance to the far clipping plane used for every voxel during the light baking.

Arguments

  • float zfar - Distance to the far clipping plane, in units.

float getBakeZFar ( ) #

Returns the distance to the far clipping plane used for every voxel during light baking.

Return value

Distance to the far clipping plane.

void setAmbientCubicFiltering ( int filtering ) #

Enables or disables cubic filtering for ambient lighting of voxel probe.

Arguments

  • int filtering - 1 to enable cubic filtering of ambient lighting; 0 to disable it.
    Notice
    If cubic filtering is disabled, linear texture filtering is used.

int isAmbientCubicFiltering ( ) #

Returns a value indicating if cubic filtering is applied to voxel probe ambient lighting.

Return value

1 if the cubic filtering is applied to voxel probe ambient lighting; otherwise, 0.

void setAmbientBias ( float bias ) #

Sets the bias for ambient lighting for the voxel probe.

Arguments

  • float bias - Ambient bias value, in voxels.

float getAmbientBias ( ) #

Returns the bias of ambient lighting.

Return value

Ambient bias value, in voxels.

void setAttenuationDistance ( vec3 distance ) #

Sets the distance from the light source shape, at which the light source doesn't illuminate anything.

Arguments

  • vec3 distance - Distance from the light source shape, in units along X, Y and Z axis.

vec3 getAttenuationDistance ( ) #

Returns the distance from the light source shape, at which the light source doesn't illuminate anything.

Return value

Distance from the light source shape, in units.

void setTexture ( Texture texture ) #

Sets the given texture as the lighting texture of the voxel probe.

Arguments

  • Texture texture - 3D texture pointer to set.

Texture getTexture ( ) #

Returns the Texture instance containing the baked lighting.

Return value

Texture instance.

void setUseSkyColor ( int color ) #

Enables or disables sky color modulation for the voxel probe (the light of the environment probe changes as the sky color changes).
Notice

To bake lighting from the sky separately with this option enabled, it is recommended to enable baking visibility for the sky only, while disabling it for other light sources.

Changing this option requires the lighting to be re-baked.

Arguments

  • int color - 1 to enable sky color modulation for the environment probe, 0 to disable it. The default value is 0.

int isUseSkyColor ( ) #

Returns a value indicating if sky color modulation for the voxel probe is enabled.

Return value

1 if sky color modulation for the environment probe is enabled; otherwise, 0.

ivec3 getResolution ( ) #

Returns the resolution of the voxel probe according to the voxel size.

Return value

Resolution of the voxel probe along X, Y and Z axis, in voxels.

void setReflectionEnabled ( int enabled ) #

Enables or disables reflections for the voxel probe.

Arguments

  • int enabled - 1 to enable reflections for the voxel probe; 0 to disable it.

int isReflectionEnabled ( ) #

Returns a value indicating if reflections are enabled for the voxel probe.

Return value

1 if reflections are enabled for the voxel probe; otherwise, 0.

void setReflectionBias ( float bias ) #

Sets the bias for reflections of the voxel probe.

Arguments

  • float bias - Reflection bias value, in voxels.

float getReflectionBias ( ) #

Returns the bias of reflections.

Return value

Reflection bias value, in voxels.

void setReflectionCubicFiltering ( int filtering ) #

Enables or disables cubic filtering for reflections of the voxel probe.

Arguments

  • int filtering - 1 to enable cubic filtering for reflections; 0 to disable it.
    Notice
    If cubic filtering is disabled, linear texture filtering is used.

int isReflectionCubicFiltering ( ) #

Returns a value indicating if cubic filtering is applied to reflections textures.

Return value

1 if the cubic filtering is applied to reflections textures; otherwise, 0.

void setReflectionVisibilityRoughnessMin ( float val ) #

Sets the lower bound of the roughness range within which the reflections of the voxel probe are visible.

Arguments

  • float val - The lower roughness value within the [0.0f, 1.0f] range.

float getReflectionVisibilityRoughnessMin ( ) #

Returns the lower bound of the roughness range within which the reflections of the voxel probe are visible.

Return value

Lower material roughness value within the [0.0f, 1.0f] range.

void setReflectionVisibilityRoughnessMax ( float val ) #

Sets the higher bound of the roughness range within which the reflections of the voxel probe are visible.

Arguments

  • float val - Higher roughness value within the [0.0f, 1.0f] range.

float getReflectionVisibilityRoughnessMax ( ) #

Returns the higher bound of the roughness range within which the reflections of the voxel probe are visible.

Return value

The higher roughness value within the [0.0f, 1.0f] range.

static int type ( ) #

Returns the type of the node.

Return value

LightVoxelProbe type identifier.

long getVideoMemoryUsage ( ) #

Returns a value defining how much memory the light texture takes according to its size. The memory is calculated in accordance to the following formula: Memory = SizeX × SizeY × SizeZ × Sides × FormatMemory
  • SizeX, SizeY, SizeZ - the dimensions of the 3D light texture, in voxels.
  • Sides - number of sides of each voxel, equal to 6.
  • FormatMemory - a memory usage amount for the texture in RGBA16 format, equal to 8.

Return value

A texture memory usage, in bytes.

void setAdditiveBlending ( int blending ) #

Enables or disables additive blending mode for the voxel probe. This option offers more flexibility in lighting control. You can use it to blend lighting of several voxel probes together and control them separately (e.g. make a separate voxel probe for an indoor emissive light source and blend it with another voxel probe with lighting baked from the sky, having the ability to enable and disable them separately).
Notice
Voxel probes with additive blending enabled cannot be used to add lighting details (e.g. creating a small high-detail voxel probe inside a large low-detail one). Such probes do not replace each other, as they are blended instead.

Arguments

  • int blending - 1 to enable additive blending mode for the voxel probe; 0 to disable it.

int isAdditiveBlending ( ) #

Returns a value indicating if the additive blending mode for the voxel probe is enabled. This option offers more flexibility in lighting control. You can use it to blend lighting of several voxel probes together and control them separately (e.g. make a separate voxel probe for an indoor emissive light source and blend it with another voxel probe with lighting baked from the sky, having the ability to enable and disable them separately).
Notice
Voxel probes with additive blending enabled cannot be used to add lighting details (e.g. creating a small high-detail voxel probe inside a large low-detail one). Such probes do not replace each other, as they are blended instead.

Return value

1 if the additive blending mode for the voxel probe; otherwise, 0.

void setBakeVisibilityEmission ( int emission ) #

Enables or disables baking of emission light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int emission - 1 to enable baking of emission light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityEmission ( ) #

Returns a value indicating if emission light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if emission light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilitySky ( int sky ) #

Enables or disables baking of lighting from the sky to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int sky - 1 to enable baking of lighting from the sky to the voxel probe; 0 to disable it.

int isBakeVisibilitySky ( ) #

Returns a value indicating if lighting from the sky is to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if lighting from the sky is to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityLightWorld ( int world ) #

Enables or disables baking of world light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int world - 1 to enable baking of world light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityLightWorld ( ) #

Returns a value indicating if world light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if world light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityLightOmni ( int omni ) #

Enables or disables baking of omni light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int omni - 1 to enable baking of omni light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityLightOmni ( ) #

Returns a value indicating if omni light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if omni light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityLightProj ( int proj ) #

Enables or disables baking of projected light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int proj - 1 to enable baking of projected light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityLightProj ( ) #

Returns a value indicating if projected light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if the projected light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityVoxelProbe ( int probe ) #

Enables or disables baking of other voxel probe light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int probe - 1 to enable baking of other voxel probe light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityVoxelProbe ( ) #

Returns a value indicating if other voxel probe light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if other voxel probe light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityLightmap ( int lightmap ) #

Enables or disables baking of lightmapped surfaces to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int lightmap - 1 to enable baking of lightmapped surfaces to the voxel probe; 0 to disable it.

int isBakeVisibilityLightmap ( ) #

Returns a value indicating if lightmapped surfaces are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if lightmapped surfaces are to be baked to the voxel probe; otherwise, 0.

void setBakeVisibilityEnvironmentProbe ( int probe ) #

Enables or disables baking of environment probe light sources to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Arguments

  • int probe - 1 to enable baking of environment probe light sources to the voxel probe; 0 to disable it.

int isBakeVisibilityEnvironmentProbe ( ) #

Returns a value indicating if environment probe light sources are to be baked to the voxel probe. You can use this option together with additive blending to provide more flexibility in light baking. Thus, you can make voxel probes independent of each other and combine them to produce some sort of dynamic GI effect.

Return value

1 if environment probe light sources are to be baked to the voxel probe; otherwise, 0.

void setBakeQuality ( int quality ) #

Sets the baking quality for the light probe.

Arguments

int getBakeQuality ( ) #

Returns the current baking quality for the voxel probe.

Return value

One of BAKE_QUALITY values.
Last update: 2022-03-10
Build: ()