Unigine.LightEnvironmentProbe Class
Inherits from: | Light |
This class allows creating and managing environment probes.
LightEnvironmentProbe Class
Перечисления (Enums)
GRAB_DYNAMIC_FACES_PER_FRAME#
GRAB_SUPERSAMPLING#
Имя | Описание |
---|---|
MODE_1 = 0 | One sample per pixel. |
MODE_2 = 1 | Two samples per pixel. |
MODE_4 = 2 | Four samples per pixel. |
MODE_8 = 3 | Eight samples per pixel. |
GRAB_RESOLUTION#
GRAB_MODE#
Имя | Описание |
---|---|
BAKED = 0 | Reflections are static (the cubemap is pre-baked). |
DYNAMIC = 1 | Reflections are updated in realtime (the cubemap is generated dynamically). |
SPECULAR_BRDF_MODE#
Имя | Описание |
---|---|
BLINN = 0 | Blinn-Phong reflection model. |
GGX = 1 | GGX light distribution model. |
PROJECTION_MODE#
Имя | Описание |
---|---|
SPHERE = 0 | The spherical shape of projection. |
BOX = 1 | The box shape of projection. |
RAYMARCHING = 2 | The raymarching mode used to calculate reflections from the surrounding surfaces. |
LAST_STEP_MODE#
Имя | Описание |
---|---|
ENVIRONMENT_PROBE = 0 | The cubemap used for the last step is the same as for all previous steps. |
ONLY_SKY = 1 | The cubemap contains the sky and clouds only. |
SECONDARY_BOUNCE_PROJECTION_MODE#
Имя | Описание |
---|---|
SPHERE = 0 | Sphere projection. |
RAYMARCHING = 1 | Raymarching. |
Properties
LightEnvironmentProbe.GRAB_MODE GrabMode#
string TextureFilePath#
float AmbientContrast#
bool AmbientEnabled#
bool SpecularEnabled#
float SphereReflectionParallax#
float GrabZFar#
float GrabZNear#
int GrabViewportMask#
Render.GGX_MIPMAPS_QUALITY GrabGGXMipmapsQuality#
LightEnvironmentProbe.GRAB_SUPERSAMPLING GrabSupersampling#
LightEnvironmentProbe.GRAB_RESOLUTION GrabResolution#
LightEnvironmentProbe.GRAB_DYNAMIC_FACES_PER_FRAME GrabDynamicFacesPerFrame#
vec3 BoxSize#
float BoxGlossCorners#
float BoxAmbientParallax#
bool LocalSpace#
bool CutoutByShadow#
bool SkyCutout#
bool AdditiveBlending#
bool MultiplyBySkyColor#
LightEnvironmentProbe.PROJECTION_MODE ProjectionMode#
bool GrabByBakeLighting#
float GrabDistanceScale#
vec3 AttenuationDistance#
bool GrabBakeVisibilityLightmap#
bool GrabBakeVisibilityVoxelProbe#
bool GrabBakeVisibilityEnvironmentProbe#
bool GrabBakeVisibilityLightProj#
bool GrabBakeVisibilityLightOmni#
bool GrabBakeVisibilityLightWorld#
bool GrabBakeVisibilitySky#
bool GrabBakeVisibilityEmission#
float GrabEnvironmentReflectionIntensity#
float GrabEnvironmentAmbientIntensity#
LightEnvironmentProbe.SPECULAR_BRDF_MODE RaymarchingSpecularBRDF#
float RaymarchingSpecularReplaceWithDiffuseRoughnessThreshold#
float RaymarchingSpecularInformationLostRaysMultiplier#
float RaymarchingSpecularMipOffset#
float RaymarchingSpecularThresholdOcclusion#
float RaymarchingSpecularThreshold#
float RaymarchingSpecularNumStepsRoughnessThreshold#
int RaymarchingSpecularNumSteps#
int RaymarchingSpecularNumRays#
float RaymarchingSpecularStepSize#
float RaymarchingDiffuseTranslucenceAnisotropy#
- 0 — light does not penetrate through surfaces.
- 0.5 — light is distributed equally on both sides of the surface (along the ray direction and towards the light source)
- 1.0 — all light passes through the surface along the ray direction.
float RaymarchingDiffuseInformationLostRaysMultiplier#
float RaymarchingDiffuseMipOffset#
float RaymarchingDiffuseThresholdOcclusion#
float RaymarchingDiffuseThreshold#
int RaymarchingDiffuseNumSteps#
int RaymarchingDiffuseNumRays#
float RaymarchingDiffuseStepSize#
int RaymarchingNoiseFramesNumber#
float RaymarchingSpecularNonLinearStepSize#
float RaymarchingSpecularPerspectiveCompensation#
int RaymarchingSpecularReconstructionSamples#
float RaymarchingSpecularThresholdBinarySearch#
float RaymarchingDiffuseNonLinearStepSize#
float RaymarchingDiffusePerspectiveCompensation#
int RaymarchingDiffuseReconstructionSamples#
float RaymarchingDiffuseThresholdBinarySearch#
float RaymarchingAmbientOcclusionRadius#
float RaymarchingAmbientOcclusionIntensity#
LightEnvironmentProbe.LAST_STEP_MODE RaymarchingLastStepMode#
- Environment Probe — the cubemap used for the last step is the same as for all previous steps.
- Only Sky — the cubemap contains the sky and clouds only. This option is designed to fix the incorrect parallax that may occur in reflections due to the infinite length of the last step.
LightEnvironmentProbe.SECONDARY_BOUNCE_PROJECTION_MODE RaymarchingSecondaryBounceProjectionMode#
bool ReflectionCubicFiltering#
This option may be combined with SrgbModified to achieve a better gradient between pixels.
- Enabling this option affects performance, thus it is recommended to enable it only for Environment Probes affecting a big number of reflective/mirror pixels, especially if it is a realtime low-resolution Probe.
- For this option to have an effect on a transparent sufrace, the Reflection Cubic Filtering state should be enabled for the material (for non-transparent materials the option is applied automatically).
- The option does not affect Impostors.
bool SrgbModified#
This option may be combined with ReflectionCubicFiltering to achieve a better gradient between pixels.
Members
LightEnvironmentProbe ( vec4 color, vec3 attenuation_distance, string name = 0 ) #
Constructor. Creates a new environment probe with cubemap modulation based on given parameters.Arguments
- vec4 color - Color of the environment probe.
- vec3 attenuation_distance - Radii of the environment probe.
- string name - Path to a cube texture of the environment probe.
static int type ( ) #
Returns the type of the node.Return value
LightEnvironmentProbe type identifier.void SetRaymarchingLastStepMode ( LightEnvironmentProbe.LAST_STEP_MODE mode ) #
Sets the cubemap to be used for the last raymarching step. The following modes are available:- Environment Probe — the cubemap used for the last step is the same as for all previous steps.
- Only Sky — the cubemap contains the sky and clouds only. This option is designed to fix the incorrect parallax that may occur in reflections due to the infinite length of the last step.
Arguments
- LightEnvironmentProbe.LAST_STEP_MODE mode - The cubemap for the last step. One of the LAST_STEP_MODE values.
LightEnvironmentProbe.LAST_STEP_MODE GetRaymarchingLastStepMode ( ) #
Returns the cubemap used for the last raymarching step. The following modes are available:- Environment Probe — the cubemap used for the last step is the same as for all previous steps.
- Only Sky — the cubemap contains the sky and clouds only. This option is designed to fix the incorrect parallax that may occur in reflections due to the infinite length of the last step.
Return value
The cubemap for the last step. One of the LAST_STEP_MODE values.void SetRaymarchingAmbientOcclusionIntensity ( float intensity ) #
Sets the ambient occlusion intensity. Keep in mind that ambient occlusion doesn't exist in the real world, this is a method to imitate shadows between objects. For photorealistic visualization, we recommend keeping this value equal to 0.Arguments
- float intensity - Ambient occlusion intensity.
float GetRaymarchingAmbientOcclusionIntensity ( ) #
Returns the ambient occlusion intensity. Keep in mind that ambient occlusion doesn't exist in the real world, this is a method to imitate shadows between objects. For photorealistic visualization, we recommend keeping this value equal to 0.Return value
Ambient occlusion intensity.void SetRaymarchingAmbientOcclusionRadius ( float radius ) #
Sets the radius of sample pixels used in the Ambient Occlusion effect, controlling the extent of the darkened area.Arguments
- float radius - Ambient occlusion radius.
float GetRaymarchingAmbientOcclusionRadius ( ) #
Returns the radius of sample pixels used in the Ambient Occlusion effect, controlling the extent of the darkened area.Return value
Ambient occlusion radius.void SetRaymarchingDiffuseThresholdBinarySearch ( float search ) #
Sets the threshold value used for the intersection detection that defines the depth of the ray penetration under the surface. Higher values may cause more false intersections, but make the process of intersection detection easier.Arguments
- float search - Threshold value.
float GetRaymarchingDiffuseThresholdBinarySearch ( ) #
Returns the threshold value used for the intersection detection that defines the depth of the ray penetration under the surface. Higher values may cause more false intersections, but make the process of intersection detection easier.Return value
Threshold value.void SetRaymarchingDiffuseReconstructionSamples ( int samples ) #
Sets the number of iterations required for a more accurate detection of the ray-surface intersection for the indirect diffuse. Higher values define the intersection more precisely, however significantly affect performance.Arguments
- int samples - Number of iterations for the intersection detection.
int GetRaymarchingDiffuseReconstructionSamples ( ) #
Retuns the number of iterations required for a more accurate detection of the screen-space ray-surface intersection for the indirect diffuse. Higher values define the intersection more precisely, however significantly affect performance.Return value
Number of iterations for the intersection detection.void SetRaymarchingDiffusePerspectiveCompensation ( float compensation ) #
Sets the perspective compensation for the raymarching step size. 0 means that the raymarching step size is bound to the World Space, and 1 means that it is bound to the Screen Space. As a result, at the value of 1, the ray length at the distance from the camera will be more than at a closer distance, which makes sense for large objects, but the details on small objects in the distance may will be lost.Arguments
- float compensation - Compensation value.
float GetRaymarchingDiffusePerspectiveCompensation ( ) #
Returns the perspective compensation for the raymarching step size. 0 means that the raymarching step size is bound to the World Space, and 1 means that it is bound to the Screen Space. As a result, at the value of 1, the ray length at the distance from the camera will be more than at a closer distance, which makes sense for large objects, but the details on small objects in the distance may will be lost.Return value
Compensation value.void SetRaymarchingDiffuseNonLinearStepSize ( float size ) #
Sets the raymarching step size adjustment value. The value of 0 means that the step size is the same for each step, and at the value of 1 each subsequent raymarching step is twice wider than the previous one.Arguments
- float size - Step size.
float GetRaymarchingDiffuseNonLinearStepSize ( ) #
Returns the raymarching step size adjustment value. The value of 0 means that the step size is the same for each step, and at the value of 1 each subsequent raymarching step is twice wider than the previous one.Return value
Step size.void SetRaymarchingSpecularThresholdBinarySearch ( float search ) #
Sets the threshold value used for the intersection detection that defines the depth of the ray penetration under the surface. Higher values may cause more false intersections, but make the process of intersection detection easier.Arguments
- float search - Threshold for the intersection detection.
float GetRaymarchingSpecularThresholdBinarySearch ( ) #
Returns the threshold value used for the intersection detection that defines the depth of the ray penetration under the surface. Higher values may cause more false intersections, but make the process of intersection detection easier.Return value
Threshold for the intersection detection.void SetRaymarchingSpecularReconstructionSamples ( int samples ) #
Sets the number of iterations required for a more accurate detection of the ray-surface intersection for the indirect specular. Higher values define the intersection more precisely, however significantly affect performance.Arguments
- int samples - Number of iterations for the intersection detection.
int GetRaymarchingSpecularReconstructionSamples ( ) #
Returns the number of iterations required for a more accurate detection of the ray-surface intersection for the indirect specular. Higher values define the intersection more precisely, however significantly affect performance.Return value
Number of iterations for the intersection detection.void SetRaymarchingSpecularPerspectiveCompensation ( float compensation ) #
Sets the perspective compensation for the raymarching step size. 0 means that the raymarching step size is bound to the World Space, and 1 means that it is bound to the Screen Space. As a result, at the value of 1, the ray length at the distance from the camera will be more than at a closer distance, which makes sense for large objects, but the details on small objects in the distance may will be lost.Arguments
- float compensation - Compensation value.
float GetRaymarchingSpecularPerspectiveCompensation ( ) #
Returns the perspective compensation for the raymarching step size. 0 means that the raymarching step size is bound to the World Space, and 1 means that it is bound to the Screen Space. As a result, at the value of 1, the ray length at the distance from the camera will be more than at a closer distance, which makes sense for large objects, but the details on small objects in the distance may will be lost.Return value
Compensation value.void SetRaymarchingSpecularNonLinearStepSize ( float size ) #
Sets the raymarching step size adjustment value. The value of 0 means that the step size is the same for each step, and at the value of 1 each subsequent raymarching step is twice wider than the previous one.Arguments
- float size - Step size.
float GetRaymarchingSpecularNonLinearStepSize ( ) #
Returns the raymarching step size adjustment value. The value of 0 means that the step size is the same for each step, and at the value of 1 each subsequent raymarching step is twice wider than the previous one.Return value
Step size.void SetRaymarchingSecondaryBounceProjectionMode ( LightEnvironmentProbe.SECONDARY_BOUNCE_PROJECTION_MODE mode ) #
Sets the secondary bounce projection mode.Arguments
- LightEnvironmentProbe.SECONDARY_BOUNCE_PROJECTION_MODE mode - Secondary bounce projection mode. One of the SECONDARY_BOUNCE_PROJECTION_MODE values.
LightEnvironmentProbe.SECONDARY_BOUNCE_PROJECTION_MODE GetRaymarchingSecondaryBounceProjectionMode ( ) #
Returns the secondary bounce projection mode.Return value
Secondary bounce projection mode. One of the SECONDARY_BOUNCE_PROJECTION_MODE values.void SetGrabEnvironmentAmbientIntensity ( float intensity ) #
Sets the intensity of the environment ambient lighting.Arguments
- float intensity - Intensity of the environment ambient lighting.
float GetGrabEnvironmentAmbientIntensity ( ) #
Returns the intensity of the environment ambient lighting.Return value
Intensity of the environment ambient lighting.void SetGrabEnvironmentReflectionIntensity ( float intensity ) #
Sets the intensity of the environment reflection.Arguments
- float intensity - Intensity of the environment reflection.
float GetGrabEnvironmentReflectionIntensity ( ) #
Returns the intensity of the environment reflection.Return value
Intensity of the environment reflection.void SetSrgbModified ( bool modified ) #
Sets the value indicating if the baked cubemap or realtime calculation is converted to sRGB color space and modified to a lower dynamic range. Applying this option makes transition between the neighboring probe pixels smoother, which visually improves low-resolution probes or probes containing bright or constant pixels. Enabing or disabling this option requires rebaking of the static cubemap, otherwise lighting will be visually incorrect. If a static Environment Probe reuses a cubemap that has been baked with this option enabled, it should be enabled for this probe as well.
This option may be combined with ReflectionCubicFiltering to achieve a better gradient between pixels.
Arguments
- bool modified - true to conversion to sRGB and a lower dynamic range for cubemap or realtime calculation, false to disable it.
bool IsSrgbModified ( ) #
Returns the value indicating if the baked cubemap or realtime calculation is converted to sRGB color space and modified to a lower dynamic range. Applying this option makes transition between the neighboring probe pixels smoother, which visually improves low-resolution probes or probes containing bright or constant pixels. Enabing or disabling this option requires rebaking of the static cubemap, otherwise lighting will be visually incorrect. If a static Environment Probe reuses a cubemap that has been baked with this option enabled, it should be enabled for this probe as well.
This option may be combined with ReflectionCubicFiltering to achieve a better gradient between pixels.
Return value
true if conversion to sRGB and a lower dynamic range for cubemap or realtime calculation is enabled, otherwise false.void SetReflectionCubicFiltering ( bool filtering ) #
Sets the value indicating if bicubic interpolation for the Enviropment Probe cubemap is enabled instead of the standard bilinear interpolation. This effect is only applicable to reflected lighting and calculated if a pixel has a low Roughness value. Modifications are applied only to the first mip of the cubemap. The effect visually represents slight blurring of neighboring pixels. However, this is not antialiasing and might affect the visual quality of high-resolution probes.
This option may be combined with SrgbModified to achieve a better gradient between pixels.
- Enabling this option affects performance, thus it is recommended to enable it only for Environment Probes affecting a big number of reflective/mirror pixels, especially if it is a realtime low-resolution Probe.
- For this option to have an effect on a transparent sufrace, the Reflection Cubic Filtering state should be enabled for the material (for non-transparent materials the option is applied automatically).
- The option does not affect Impostors.
Arguments
- bool filtering - true to enable bicubic interpolation for Enviropment Probe, false to disable it.
bool IsReflectionCubicFiltering ( ) #
Returns the value indicating if bicubic interpolation for the Enviropment Probe cubemap is enabled instead of the standard bilinear interpolation. This effect is only applicable to reflected lighting and calculated if a pixel has a low Roughness value. Modifications are applied only to the first mip of the cubemap. The effect visually represents slight blurring of neighboring pixels. However, this is not antialiasing and might affect the visual quality of high-resolution probes.
This option may be combined with SrgbModified to achieve a better gradient between pixels.
- Enabling this option affects performance, thus it is recommended to enable it only for Environment Probes affecting a big number of reflective/mirror pixels, especially if it is a realtime low-resolution Probe.
- For this option to have an effect on a transparent sufrace, the Reflection Cubic Filtering state should be enabled for the material (for non-transparent materials the option is applied automatically).
- The option does not affect Impostors.