Unigine.LightVoxelProbe Class
Inherits: | Light |
LightVoxelProbe Class
Members
LightVoxelProbe()
Constructor. Creates a new voxel probe with default parameters.static LightVoxelProbe cast(Node node)
Casts a LightVoxelProbe out of the Node instance.Arguments
- Node node - Node instance.
Return value
LightVoxelProbe instance.static LightVoxelProbe cast(Light base)
Casts a LightVoxelProbe out of the Light instance.Arguments
- Light base - Light instance.
Return value
LightVoxelProbe instance.void setBakeCaustic(int caustic)
Enables or disables caustics calculation for the voxel probe.It is recommended to increase sampling resolution and number of rays when enabling this option. Enabling caustics calculation may result in increased noise.
Arguments
- int caustic - 1 to enable caustics calculation for the voxel probe; 0 to disable it.
int isBakeCaustic()
Returns a value indicating if caustics calculation for the voxel probe is enabled.Return value
1 if caustics calculation for the voxel probe is enabled; otherwise, 0.void setBakeNumRays(int rays)
Sets the number of rays used in light baking.Arguments
- int rays - Number of rays.
int getBakeNumRays()
Returns number of rays used in light baking.Return value
Number of rays.void setBakeZNear(float znear)
Sets the distance to the near clipping plane used for every voxel during light baking.Arguments
- float znear - Distance to the near clipping plane.
float getBakeZNear()
Returns the distance to the near clipping plane used for every voxel during light baking.Return value
Distance to the near clipping plane.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 setBakeFullResolutionBounces(int bounces)
Enables or disables calculation of bounces at full resolution. Defines whether indirect light bounces are computed at the same full resolution as the last one or the resolution should increase from the lowest to full with each bounce iteration.Arguments
- int bounces - 1 to enable light bounces computing at full resolution; 0 to disable it.
int isBakeFullResolutionBounces()
Returns a value defining if all light bounces are calculated at full resolution.Return value
1 if full resolution baking for all light bounces is enabled; otherwise, 0void 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 setBakeFixLightBleedingIntensity(float intensity)
Sets the value of the Fix Light Bleeding Intensity parameter.Arguments
- float intensity - fix light bleeding intensity in the [0.0f, 1.0f] range.
float getBakeFixLightBleedingIntensity()
Returns the value of the Fix Light Bleeding Intensity parameter which defines a strength of light bleeding correction.Return value
The value of the Fix Light Bleeding Intensity parameter in the [0.0f, 1.0f] range.void setBakeInternalVolume(int volume)
Enables or disables internal volume baking.If internal volume baking is disabled, the voxels covering geometry are baked only and the empty ones are skipped.
Arguments
- int volume - 1 to enable internal volume baking; 0 to disable it.
int isBakeInternalVolume()
Returns a value indicating if light is baked for voxels that don't touch geometry.Return value
1 if internal volume baking is enabled; otherwise, 0.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 setBakeFixLightBleedingRadius(float radius)
Sets the radius of light bleeding correction.Arguments
- float radius - radius of light bleeding correction.
float getBakeFixLightBleedingRadius()
Returns the value of the Fix Light Bleeding Radius parameter which defines a radius of light bleeding correction.Return value
The value of the Fix Light Bleeding Radius parameter.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.
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 setAmbientIntensity(float intensity)
Sets ambient lighting intensity.Arguments
- float intensity - Ambient lighting intensity.
float getAmbientIntensity()
Returns ambient intensity of the LightEnvironment Probe.Return value
Ambient intensity value.void setAmbientColor(vec4 color)
Sets given ambient color to the voxel probe.Arguments
- vec4 color - Ambient color value.
vec4 getAmbientColor()
Returns ambient color value of the LightEnvironment Probe.Return value
Ambient color value.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 setBakeSamplingResolution(int resolution)
Sets the bake sampling resolution defining the size of one baked voxel side inside the lighting texture.Arguments
- int resolution - Bake sampling resolution.
int getBakeSamplingResolution()
Returns a value defining the bake sampling resolution.Return value
Bake sampling resolution.void setBakeSamplingMipOffset(int offset)
Sets the mip offset of bake sampling.Arguments
- int offset - Mip offset.
int getBakeSamplingMipOffset()
Returns the mip offset of bake sampling.Return value
Bake sampling mip offset.void setUseSunColor(int enable)
Enables or disables sun color modulation for the voxel probe (the light of the environment probe changes as the sun color changes).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 enable - 1 to enable sun color modulation for the environment probe, 0 to disable it. The default value is 0.
int isUseSunColor()
Returns a value indicating if sun color modulation for the voxel probe is enabled.Return value
1 if sun 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 setBakeFixLightBleedingBounce(int bounce)
Enables or disables light bleeding bounce correction by setting the Fix Light Bleeding Bounce parameter.Arguments
- int bounce - 1 to enable light bleeding bounce correction; 0 to disable.
int isBakeFixLightBleedingBounce()
Returns a value indicating if the Fix Light Bleeding Bounce is enabled.Return value
1 if the Fix Light Bleeding Bounce is enabled; otherwise, 0.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 setReflectionColor(vec4 color)
Sets given reflection color to the voxel probe.Arguments
- vec4 color - Color value.
vec4 getReflectionColor()
Returns a reflection color of the voxel probe.Return value
Reflection color value.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.
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 setReflectionIntensity(float intensity)
Sets given reflection intensity value to the voxel probe.Arguments
- float intensity - Reflection intensity value.
float getReflectionIntensity()
Returns reflection intensity of the LighVoxel Probe.Return value
Reflection intensity value.void setReflectionVisibilityRoughnessMin(float min)
Sets the lower bound of the roughness range within which the reflections of the voxel probe are visible.Arguments
- float min - 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 max)
Sets the higher bound of the roughness range within which the reflections of the voxel probe are visible.Arguments
- float max - 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).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).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 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.Last update: 2018-08-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)