Unigine::LightVoxelProbe Class
Header: | #include <UnigineLights.h> |
Inherits: | Light |
LightVoxelProbe Class
Members
LightVoxelProbe()
Constructor. Creates a new voxel probe with default parameters.static Ptr<LightVoxelProbe> cast(const Ptr<Node> & node)
Casts a LightVoxelProbe out of the Node instance.Arguments
- const Ptr<Node> & node - Pointer to Node.
Return value
Pointer to LightVoxelProbe.static Ptr<LightVoxelProbe> cast(const Ptr<Light> & base)
Casts a LightVoxelProbe out of the Light instance.Arguments
- const Ptr<Light> & base - Pointer to Light.
Return value
Pointer to LightVoxelProbe.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 setReflectionColor(const Math::vec4 & color)
Sets given reflection color to the LightVoxel Probe.Arguments
- const Math::vec4 & color - Color value.
Math::vec4 getReflectionColor()
Returns a reflection color of the LightVoxel Probe.Return value
Reflection color value.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.void setReflectionVisibilityRoughnessMin(float min)
Sets the lower bound of the roughness range within which the reflections of the LightVoxel 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 LightVoxel 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 LightVoxel 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 LightVoxel Probe are visible.Return value
The higher roughness value within the [0.0f, 1.0f] range.void setReflectionCubicFiltering(int filtering)
Enables or disables cubic filtering for reflections of the LightVoxel 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.int setTextureImage(const Ptr<Image> & image)
Sets the given image as the 3D texture of the voxel probe.Arguments
- const Ptr<Image> & image - 3D texture to set.
Return value
1 if the cube texture is set successfully; otherwise, 0.int getTextureImage(const Ptr<Image> & image)
Bakes lighting and saves into the given Image instance.Arguments
- const Ptr<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 setReflectionIntensity(float intensity)
Sets given reflection intensity value to the LightVoxel Probe.Arguments
- float intensity - Reflection intensity value.
float getReflectionIntensity()
Returns reflection intensity of the LighVoxel Probe.Return value
Reflection intensity value.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 LightVoxel Probe.Arguments
- float size - Voxel Size value, in units.
float getVoxelSize()
Returns voxel size of the LightVoxel 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(const char * path)
Sets a path to a light texture.Arguments
- const char * path - Path to a light texture.
const char * getTexturePath()
Returns the path to the lighting texture used for the voxel probe.Return value
Path to the texture.void setBoxSize(const Math::vec3 & size)
Sets the box size for the voxel probe.Arguments
- const Math::vec3 & size - Box size along X, Y and Z axes.
Math::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 LightVoxel 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 LightVoxel Probe ambient lighting.Return value
1 if the cubic filtering is applied to LightVoxel 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(const Math::vec4 & color)
Sets given ambient color to the LightVoxel Probe.Arguments
- const Math::vec4 & color - Ambient color value.
Math::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 LightVoxel 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(const Math::vec3 & distance)
Sets the distance from the light source shape, at which the light source doesn't illuminate anything.Arguments
- const Math::vec3 & distance - Distance from the light source shape, in units along X, Y and Z axis.
Math::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(const Ptr<Texture> & texture)
Sets the given texture as the lighting texture of the voxel probe.Arguments
- const Ptr<Texture> & texture - 3D texture pointer to set.
Ptr<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).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.Math::ivec3 getResolution()
Returns the resolution of the LightVoxel Probe according to the voxel size.Return value
Resolution of the LightVoxel 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 setReflectionBias(float bias)
Sets the bias for reflections of the LightVoxel Probe.Arguments
- float bias - Reflection bias value, in voxels.
float getReflectionBias()
Returns the bias of reflections.Return value
Reflection bias value, in voxels.static int type()
Returns the type of the node.Return value
LightVoxelProbe type identifier.long 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.Last update: 2018-04-26
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)