Returns the maximum number of instances that can be rendered for each of the following node types:
Field Animation
Field Height
Field Shoreline
Field Spacer
Returned value depends on the graphics API used.

Arguments

floatgetBentNormalRayTracingThreshold(
)

Returns the current threshold value for the ray-traced bent normals calculation.

Notice

Ray-traced bent normals calculation available only when the SSRTGI technique is enabled.

Return value

Bent normal ray tracing threshold value. The default value is 1.0f.

Ptr<Texture>getBlack2DArrayTexture(
)

Returns black 2D array texture.

Return value

Black 2D array texture.

Ptr<Texture>getBlack2DTexture(
)

Returns black 2D texture.

Return value

Black 2D texture.

Ptr<Texture>getBlack3DTexture(
)

Returns black 3D texture.

Return value

Black 3D texture.

Ptr<Texture>getBlackCubeTexture(
)

Returns black Cube texture.

Return value

Black Cube texture.

voidsetBloom(
intbloom
)

Enables or disables the bloom effect.

Arguments

intbloom - 1 value to enable the bloom effect, 0 to disable.

intisBloom(
)

Returns a value indicating if the bloom effect is enabled.

Return value

1 if the bloom effect is enabled; otherwise, 0.

voidsetBloomPasses(
intpasses
)

Sets the number of passes for the bloom effect. During the pass a bloom texture is generating. Up to 8 bloom textures can be generated: each texture has lower resolution (original size, original size /2, original size /4, so forth) with bloom effect. After that, all these bloom textures with the different resolution are composed for the final bloom texture.

Arguments

intpasses - Number of bloom passes. The default value is 8. The higher the value the smoother is the effect. However, this option significantly affects performance.

intgetBloomPasses(
)

Returns the current number of passes for the bloom effect. During the pass a bloom texture is generating. Up to 8 bloom textures can be generated: each texture has lower resolution (original size, original size /2, original size /4, so forth) with bloom effect. After that, all these bloom textures with the different resolution are composed for the final bloom texture.

Return value

Number of bloom passes.

voidsetBloomPower(
floatpower
)

Sets the power of the bloom effect.

At the minimum value of 0.0f, the bloom effect is blurred.

At the maximum value of 1.0f, the bloom effect is more contrast.

Arguments

floatpower - Bloom power value within the [0.0f; 1.0f] range. The default value is 0.7f.

floatgetBloomScale(
)

Return value

voidsetBudget(
floatbudget
)

Sets the render budget value, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.

Arguments

floatbudget - Budget value in seconds. The default value is 1/60.

floatgetBudget(
)

Returns current render budget value, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.

Return value

Budget value in seconds. The default value is 1/60.

voidsetCameraEffectsThreshold(
floatthreshold
)

Sets the threshold, which is used to detect if an object should be blurred in the HDR mode.

Arguments

floatthreshold - HDR threshold. If a negative value is provided, 0 will be used instead.

floatgetCameraEffectsThreshold(
)

Returns the brightness threshold, which is used to detect if an object should be blurred in the HDR mode.

Return value

HDR threshold.

voidsetClearBufferMask(
intmask
)

Sets the buffer cleanup mask. This mask determines which buffers are to be cleared next time the Engine::render() is called. Thus, you can determine the contents of which buffers is to be kept, avoiding situations, when necessary data is cleared.

Source code (C++)

auto render = Render::get();
render->setClearBufferMask(RenderState::BUFFER_ALL); // color, depth & stencil buffers will be cleared
render->setClearBufferMask(RenderState::BUFFER_NONE); // no buffers will be cleared (useful if you want to embed the engine somewhere)
render->setClearBufferMask(RenderState::BUFFER_DEPTH); // only the depth buffer will be cleared
// masks can be combined:
render->setClearBufferMask(BUFFER_COLOR | BUFFER_STENCIL); // color and stencil buffer will be cleared
// there is a separate BUFFER_DEPTH_STENCIL mask for convenience
render->clearBuffer(BUFFER_DEPTH_STENCIL);

Arguments

intgetClearBufferMask(
)

Returns current buffer cleanup mask. This mask determines which buffers are to be cleared next time the Engine::render() is called. This method can be used to save current buffer cleanup mask to restore it later.

Return value

voidsetCloudsDownsamplingRendering(
intrendering
)

Sets downsampling rendering for clouds. This parameter determines clouds resolution based on current screen resolution. It has a significant impact on performance.

Arguments

intrendering - One of the following values:

0 - full.

1 - half (by default).

2 - quarter.

intgetCloudsDownsamplingRendering(
)

Returns current downsampling rendering setting for clouds. This parameter determines clouds resolution based on current screen resolution. It has a significant impact on performance.

Return value

One of the following values:

0 - full.

1 - half (by default).

2 - quarter.

voidsetCloudsDynamicCoverageArea(
floatarea
)

Sets dynamic coverage area for clouds. This parameter determines visibility distance for coverage of FieldWeather objects.

Notice

Increasing dynamic coverage area leads to reduction of quality of FieldWeather coverage texture and loss of details. This effect can be mitigated by increasing dynamic coverage resolution using setCloudsDynamicCoverageResolution() method.

Arguments

floatgetCloudsDynamicCoverageArea(
)

Returns current dynamic coverage area for clouds. This parameter determines visibility distance for coverage of FieldWeather objects.

Return value

Dynamic coverage area, in units.

voidsetCloudsDynamicCoverageResolution(
intresolution
)

Sets dynamic coverage resolution for clouds. This parameter determines the quality of dynamic coverage texture for FieldWeather objects. Higher values make it possible to preserve texture details at high distances.

Notice

Increased resolution significantly affects performance.

Arguments

intresolution - One of the following values:

0 - 128 x 128.

1 - 256 x 256 (by default).

2 - 512 x 512.

3 - 1024 x 1024.

4 - 2048 x 2048.

intgetCloudsDynamicCoverageResolution(
)

Returns current dynamic coverage resolution setting for clouds. This parameter determines the quality of dynamic coverage texture for FieldWeather objects. Higher values make it possible to preserve texture details at high distances.

Return value

One of the following values:

0 - 128 x 128.

1 - 256 x 256 (by default).

2 - 512 x 512.

3 - 1024 x 1024.

4 - 2048 x 2048.

voidsetCloudsGroundShadows(
intshadows
)

Enables or disables rendering of shadows from the clouds on the ground.

Arguments

intshadows - 1 to enable rendering of shadows from the clouds on the ground, 0 to disable it. The default value is 1.

intisCloudsGroundShadows(
)

Returns a value indicating if rendering of shadows from the clouds on the ground is enabled.

Return value

1 if rendering of shadows from the clouds on the ground is enabled; otherwise, 0.

voidsetCloudsInterleavedRendering(
intrendering
)

In cases when clouds are viewed from the ground, or from above (at significant distance) and viewer's velocities are less than 200 units per second, this parameter can be used to provide a significant gain in performance.

Arguments

floatgetCloudsLightingTraceLength(
)

Returns the current lighting trace length for clouds. This parameter determines the maximum length of a sun ray inside a cloud.

Return value

Lighting trace length, in units.

voidsetCloudsNoiseIterations(
floatiterations
)

Sets the value of the noise iterations parameter for clouds. This parameter determines the amount of jitter, that is used to reduce banding effect due to insufficient number of steps.

Arguments

floatiterations - New value of the noise iterations parameter for clouds. The default value is 0.1f.

floatgetCloudsNoiseIterations(
)

Returns the current value of the noise iterations parameter for the clouds. This parameter determines the amount of jitter, that is used to reduce banding effect due to insufficient number of steps.

Return value

Current value of the noise iterations parameter for clouds. The default value is 0.1f.

voidsetCloudsNoiseLighting(
floatlighting
)

Sets the value of the noise lighting parameter for clouds. This parameter determines the amount of jitter for tracing steps of lighting calculation, that is used to reduce banding effect due to insufficient number of steps.

Arguments

floatlighting - New value of the noise lighting parameter for clouds. The default value is 0.3f.

floatgetCloudsNoiseLighting(
)

Returns the current value of the noise lighting parameter for the clouds. This parameter determines the amount of jitter for tracing steps of lighting calculation, that is used to reduce banding effect due to insufficient number of steps.

Return value

Current value of the noise lighting parameter for clouds. The default value is 0.3f.

voidsetCloudsNoiseStep(
floatstep
)

Sets the value of the noise step parameter for clouds. This parameter determines the amount of jitter in the areas within clouds, that is used to reduce banding effect due to insufficient number of steps.

Arguments

floatstep - New value of the noise step parameter for clouds. The default value is 0.3f.

floatgetCloudsNoiseStep(
)

Returns the current value of the noise step parameter for clouds. This parameter determines the amount of jitter in the areas within clouds, that is used to reduce banding effect due to insufficient number of steps.

Return value

Current value of the noise step parameter for clouds. The default value is 0.3f.

voidsetCloudsNoiseStepSkip(
floatskip
)

Sets the value of the noise step skip parameter for clouds. This parameter determines the amount of jitter in the areas between clouds, that is used to reduce banding effect due to insufficient number of steps.

Arguments

floatskip - New value of the noise step skip parameter for clouds. The default value is 0.3f.

floatgetCloudsNoiseStepSkip(
)

Returns the current value of the noise step skip parameter for clouds. This parameter determines the amount of jitter in the areas between clouds, that is used to reduce banding effect due to insufficient number of steps.

Return value

Current value of the noise step skip parameter for clouds. The default value is 0.3f.

voidsetCloudsSamplesCount(
intcount
)

Sets the number of samples used for clouds rendering. The higher the value, the less noise in clouds rendering.

Arguments

intcount - Number of samples:

0 - low.

1 - medium.

2 - high (by default).

3 - ultra.

intgetCloudsSamplesCount(
)

Returns the current number of samples used for clouds rendering. The higher the value, the less noise in clouds rendering.

Return value

One of the following values:

0 - low.

1 - medium.

2 - high (by default).

3 - ultra.

voidsetCloudsSamplingQuality(
intquality
)

Sets sampling quality for clouds. This parameter sets the number of noise samples that affects the cloud shape processing quality. The higher the value, the less visual artifacts.

Notice

Visual difference between low and ultra quality is not significant. Therefore, it is recommended to use low settings, when possible, to gain performance.

Arguments

intquality - Sampling quality:

0 - low quality (higher cloud density).

1 - medium quality (by default).

2 - high quality.

3 - ultra quality (lower density, the clouds are softer).

intgetCloudsSamplingQuality(
)

Returns the current sampling quality set for clouds. This parameter sets the number of noise samples that affects the cloud shape processing quality. The higher the value, the less visual artifacts.

Return value

User data. The data can contain an XML formatted string.

voidsetDebug(
intdebug
)

Enables or disables rendering of debug materials (the debug_materials material). Debug materials can be used for debugging of image generation stages. For example, you can render only SSR, or only cubemaps and so on.

Arguments

floatgetDirtScale(
)

Returns the scale of lens dirt effect modulating the pattern of lens flares.

Return value

Dirt scale value within the [0.0f; 1.0f] range.

voidsetDirtTextureName(
const char *name
)

Sets the texture that modulates the pattern of lens flares. For example, it can be used to create an effect of unclean optics when the camera looks at the sun.

Arguments

const char *name - Name of the lens flares modulation texture.

const char *getDirtTextureName(
)

Returns the name of the current texture that modulates the pattern of lens flares. For example, it can be used to create an effect of light reflections or unclean optics when the camera looks at the sun.

floatgetDOFChromaticAberration(
)

Return value

voidsetDOFFarDistance(
floatdistance
)

Sets the far DOF limit of the camera: the distance between the camera and the furthest element that is considered to be acceptably sharp. Black zone on the DOF mask means in-focus zone.

Arguments

floatdistance - Far DOF limit value in units.

floatgetDOFFarDistance(
)

Returns the far DOF limit of the camera: the distance between the camera and the furthest element that is considered to be acceptably sharp. Black zone on the DOF mask means in-focus zone.

Return value

Far DOF limit value in units.

voidsetDOFFarFocalOffset(
floatoffset
)

Sets the offset from the focal to the farthest blurred zone for the DOF effect. In other words, the distance when background (far) is in focus.

Arguments

floatoffset - Far DOF focal offset value in units.

floatgetDOFFarFocalOffset(
)

Returns the offset from the focal to the farthest blurred zone. In other words, the distance when background (far) is in focus.

Return value

Far DOF focal offset value in units.

voidsetDOFFocalDistance(
floatdistance
)

Sets the focal distance of the camera, i.e. a point where objects are in-focus and visible clearly.

Arguments

floatdistance - Focal distance in units. If a negative value is provided, 0 will be used instead.

floatgetDOFFocalDistance(
)

Returns the focal distance of the camera, i.e. a point where objects are in-focus and visible clearly.

Return value

Focal distance in units.

voidsetDOFFocusImprovement(
intimprovement
)

Enables or disables focus improvement for the DOF (Depth Of Field) effect. When enabled, transitions between the focused and unfocused parts of the scene become more accurate.

Arguments

intimprovement - 1 to enable focus improvement for the DOF effect, 0 to disable it. The default value is 0.

intisDOFFocusImprovement(
)

Returns a value indicating if the focus improvement option is enabled for the DOF (Depth Of Field) effect. When enabled, transitions between the focused and unfocused parts of the scene become more accurate.

Return value

1 if focus improvement is enabled for the DOF effect; otherwise, 0.

voidsetDOFIncreasedAccuracy(
intaccuracy
)

Enables or disables increased accuracy for the DOF (Depth Of Field) effect. Enabling the parameter allows for increasing accuracy of focusing calculation.

Arguments

intaccuracy - 1 to enable increased accuracy for the DOF effect, 0 to disable it. The default value is 0.

intisDOFIncreasedAccuracy(
)

Returns a value indicating if the increased accuracy option is enabled for the DOF (Depth Of Field) effect. When enabled, focusing calculation is performed with increased accuracy.

Return value

1 if increased accuracy is enabled for the DOF effect; otherwise, 0.

voidsetDOFNearDistance(
floatdistance
)

Sets the near DOF limit of the camera: the distance between the camera and the first element that is considered to be acceptably sharp. Black zone on the DOF mask means in-focus zone.

Arguments

floatdistance - Near DOF limit value in units.

floatgetDOFNearDistance(
)

Returns the near DOF limit of the camera: the distance between the camera and the first element that is considered to be acceptably sharp. Black zone on the DOF mask means in-focus zone.

Return value

Near DOF limit value in units.

voidsetDOFNearFocalOffset(
floatoffset
)

Sets the offset from the focal to the nearest blurred zone. In other words, the distance when foreground (far) is in focus.

Arguments

floatoffset - Near DOF focal offset value in units.

floatgetDOFNearFocalOffset(
)

Returns the offset from the focal to the nearest blurred zone. In other words, the distance when foreground (far) is in focus.

Return value

floatgetExposureInterpolation(
)

Returns the current exposure interpolation (the engine ifps multiplied by the exposure adaptation speed). The method can be used for automatic exposure adaptation.

Return value

Exposure interpolation.

voidsetExposureMaxLuminance(
floatluminance
)

Sets the maximum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the lower the value, the brighter the adapted image will be. The parameter can take on negative values.

Notice

If the specified value is less than the current minimum luminance, the minimum luminance value will be changed to the specified maximum luminance so that they are equal.

Arguments

floatgetExposureMaxLuminance(
)

Returns the maximum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the lower the value, the brighter the adapted image is.

Return value

Maximum luminance.

voidsetExposureMinLuminance(
floatluminance
)

Sets the minimum luminance offset relative to the default luminance of the scene used for rendering of adaptive exposure effect: the higher the value, the darker the adapted image will be. The parameter can take on negative values.

Notice

If the specified value is greater than the current maximum luminance, the maximum luminance value will be changed to the specified minimum luminance so that they are equal.

Return value

voidsetExposureMode(
intmode
)

Arguments

0 - a static exposure. The amount of luminance is determined by the setExposure().

1 - adaptive logarithmic mapping technique.

2 - adaptive quadratic mapping technique.

intgetExposureMode(
)

Returns current adaptive exposure mode:

0 - a static exposure. The amount of luminance is determined by the setExposure().

1 - adaptive logarithmic mapping technique.

2 - adaptive quadratic mapping technique.

Return value

The type of the exposure mode.

voidsetFadeColor(
const Math::vec4 &color
)

Sets the current fade color for the scene on the screen. By gradually changing this value it is possible to create "fade in" and "fade out" effects depending on the w component of the given vector. For example, when the following vectors are passed the result will be:

vec4(1,0,0,1) - R channel for all screen colors is to its maximum; G and B without changes.

vec4(0,0,0,0) - there is no fading (no color alterations are done to the screen).

vec4(1,1,1,-1) - a fully black screen. Negative w results in scene colors * (1 - RGB), where RGB is the first three components of the passed vector.

vec4(0.5,0.5,0.5,-1) - dark colors on the screen.

Arguments

const Math::vec4 &color - Fade color for the scene on the screen. The provided vector represents RGB channel values (first three components) and a fading coefficient (w component). All components are saturated in the range [-1; 1].

Math::vec4getFadeColor(
)

Returns the current fade color of the scene.

Return value

The current fade color.

voidsetFieldDistance(
floatdistance
)

Sets the distance, at which (and farther) Field nodes will not be rendered.

Arguments

floatdistance - Distance in units.

floatgetFieldDistance(
)

Returns the distance, at which (and farther) Field nodes will not be rendered.

Arguments

floatgetLensThreshold(
)

Return value

voidsetLightDistance(
floatdistance
)

Sets the distance, at which (and farther) dynamic lights will not be rendered.

Arguments

floatdistance - Distance in units.

floatgetLightDistance(
)

Returns the distance, at which (and farther) dynamic lights will not be rendered.

Return value

Distance in units.

voidsetLightsForwardPerObjectEnv(
intenv
)

Sets the maximum number of environment probes per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 environment probes per object.

Return value

Maximum number of environment probes per object within the [0; 128] range.

voidsetLightsForwardPerObjectOmni(
intomni
)

Sets the maximum number of omni lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 omni lights per object.

Return value

Maximum number of omni lights per object within the [0; 128] range.

voidsetLightsForwardPerObjectProj(
intproj
)

Sets the maximum number of projected lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 projected lights per object.

Return value

Maximum number of projected lights per object within the [0; 128] range.

voidsetLightsForwardPerObjectVoxel(
intvoxel
)

Sets the maximum number of voxel probes per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 projected lights per object.

Return value

Maximum number of voxel probes per object within the [0; 128] range.

voidsetLightsForwardPerObjectWorld(
intworld
)

Sets the maximum number of world lights per object (available only for materials rendered in the forward rendering pass). You should set the nonzero value to increase performance: it is recommended to use not more than 4 world lights per object.

intisLightsLensFlares(
)

Return value

1 if rendering of per-light lens flares is enabled; otherwise, 0.

voidsetLightsMaxPerBatch(
intbatch
)

Sets the maximum number of lights rendered by a tile per batch call.
With lights batching optimization, omni lights divided into tiles are rendered in batches: each tile renders the specified number of lights per batch. It allows decreasing the number of DIP calls and increasing performance. The optimization works only for omni lights with point shape and without shadows.

Arguments

intbatch - Maximum number of lights per batch within the [0; 1024] range. The default value is 1024.

Notice

0 disables batching optimization.

intgetLightsMaxPerBatch(
)

Returns the current maximum number of lights rendered by a tile per batch call. With lights batching optimization, omni lights divided into tiles are rendered in batches: each tile renders the specified number of lights per batch. It allows decreasing the number of DIP calls and increasing performance. The optimization works only for omni lights with point shape and without shadows.

Return value

Maximum number of lights per batch within the [0; 1024] range.

Notice

0 means batching optimization is disabled.

voidsetLightsTileGridSize(
intsize
)

Sets the number of grid tiles per axis for tiled rendering optimization. During this optimization, the screen space is divided into tiles that render lights in batches. The optimization works only for omni lights with point shape and without shadows.

Arguments

intsize - Number of grid tiles per axis within the [1; 32] range. The default value is 8.

intgetLightsTileGridSize(
)

Returns the current number of grid tiles per axis for tiled rendering optimization. During this optimization, the screen space is divided into tiles that render lights in batches. The optimization works only for omni lights with point shape and without shadows.

intisMotionBlur(
)

Return value

voidsetMotionBlurCameraVelocity(
intvelocity
)

Sets a value indicating if camera velocity contributes to the motion blur effect.

Arguments

intvelocity - 1 to take camera velocity into account in the motion blur effect; 0 to take into account velocities of objects only.

intisMotionBlurCameraVelocity(
)

Returns a value indicating if camera velocity contributes to the motion blur effect.

Return value

1 camera velocity contributes to the motion blur effect; 0 only velocities of objects are taken into account in the motion blur effect.

voidsetMotionBlurMaxVelocity(
floatvelocity
)

Sets the maximum possible amount of motion blur for moving physical objects. When their body velocity exceeds the set value, they will be blurred as if they have the maximum velocity set by the parameter.
This parameter should be used:

To avoid excessive blurring of fast moving objects.

To save performance, as increasing the object's velocity leads increasing the radius of the motion blur effect that drops performance at too high values.

floatgetMotionBlurNoiseIntensity(
)

Return value

voidsetMotionBlurNumSteps(
intsteps
)

Sets the number of steps used in the motion blur. The higher the value, the more correct the motion blur effect is. At low values, moving objects may look doubled, however, performance will increase.

Arguments

intsteps - Number of steps in range [2;64]. The default value is 4.

intgetMotionBlurNumSteps(
)

Returns the current number of steps used in the motion blur. The higher the value, the more correct the motion blur effect is. At low values, moving objects may look doubled, however, performance will increase.

Return value

Number of steps.

voidsetMotionBlurVelocityScale(
floatscale
)

Sets amount of motion blur for moving physical bodies. The higher the value, the more blurred the objects will appear when moving.

Arguments

floatscale - Scale of bodies' linear and angular velocities used for the motion blur. If a negative value is provided, 0 will be used instead.

floatgetMotionBlurVelocityScale(
)

Returns the current amount of motion blur for moving physical bodies. The higher the value, the more blurred the objects will appear when moving.

Return value

Scale of bodies' linear and angular velocities used for the motion blur.

intgetNumDecals(
)

Returns the number of rendered per frame decals that can be currently seen in the viewport (during all of the rendering passes).

Return value

The number of decals.

intgetNumDips(
)

Returns the number of draw calls used in the current scene. See Rendering Profiler article for details.

Return value

The number of draw calls.

intgetNumInstances(
)

Returns the maximum number of instances that can be rendered for each of the following node types:

Return value

Maximum number of instances that can be rendered.

intgetNumLights(
)

Returns the number of light passes rendered per frame. It means that the value contains the number of all light sources that are currently seen illuminating something in the viewport and also includes additional passes for rendering lights in the reflecting surfaces (if dynamical reflections are used). See Rendering Profiler article for details.

Return value

The number of light passes.

intgetNumMaterials(
)

Returns the number of materials set per frame (during all of the rendering passes) in the current scene.

Return value

The number of materials.

intgetNumPrimitives(
)

Returns the number of geometric rendered per frame primitives that can be currently seen in the viewport. See Rendering Profiler article for details.

Return value

The number of primitives.

intgetNumProcedurals(
)

Returns the number of procedurals that can be currently seen in the viewport.

Return value

The number of procedurals.

intgetNumReflections(
)

Returns the number of reflections drawn per frame that can be currently seen in the viewport. In case of cubemap reflections, if all six faces are updated, six reflections are rendered per each frame.

Arguments

intisSSAO(
)

Return value

1 if the SSAO effect is enabled; otherwise, 0.

voidsetSSAOCavity(
intcavity
)

Enables or disables the cavity option for the SSAO (Screen Space Ambient Occlusion) effect. This option improves (sharpens) the look of junction contours at low resolutions, so it should be used for detail enhancement (small stones, bolts and so on).

Arguments

intcavity - 1 to enable the cavity option for the SSAO effect, 0 to disable. The default value is 1.

intisSSAOCavity(
)

Returns the value indicating if the cavity option for the SSAO (Screen Space Ambient Occlusion) effect is enabled. This option improves (sharpens) the look of junction contours at low resolutions, so it should be used for detail enhancement (small stones, bolts and so on).

Return value

1 if the cavity option for the SSAO effect is enabled; otherwise, 0.

voidsetSSAOCavityIntensity(
floatintensity
)

Sets the intensity of sharpening of contours for the cavity option (see the setSSAOCavity() method).

voidsetSSRDenoise(
intdenoise
)

Arguments

intisSSRDenoise(
)

Returns the value indicating if noise reduction for the SSR (Screen Space Reflections) effect is enabled.

Return value

1 if noise reduction for the SSR effect is enabled; otherwise, 0.

voidsetSSRFastTracing(
inttracing
)

Enables or disables fast tracing for the SSR (Screen Space Reflections) effect. This mode makes it possible to obtain distant reflections using low number of steps while keeping performance high. However, tiny objects may not be reflected. Disabling this mode improves quality but significantly drops performance.

Arguments

intisSSRImportanceSampling(
)

Returns the value indicating if the importance sampling mode for the SSR (Screen Space Reflections) effect is enabled. Importance sampling provides more accurate but slower calculation of SSR roughness.

Return value

1 if SSR importance sampling is enabled; otherwise, 0.

voidsetSSRIncreasedAccuracy(
intaccuracy
)

Enables or disables increased accuracy for the SSR (Screen Space Reflections). This option reduces visual artifacts around objects, which can appear at resolution lower than full, by increasing accuracy of the last step.

Arguments

intaccuracy - 1 to enable increased accuracy for the SSR, 0 to disable it. The default value is 0.

intisSSRIncreasedAccuracy(
)

Returns a value indicating if increased accuracy option is enabled for the SSR (Screen Space Reflections). This option reduces visual artifacts around objects, which can appear at resolution lower than full, by increasing accuracy of the last step.

Return value

1 if increased accuracy is enabled for the SSR; otherwise, 0.

voidsetSSRNoiseRay(
floatray
)

Sets the intensity of the ray noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect on rough reflections by using the noise.

Arguments

floatray - Ray noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

floatgetSSRNoiseRay(
)

Returns the intensity of the ray noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect on rough reflections by using the noise.

Return value

Ray noise intensity.

voidsetSSRNoiseStep(
floatstep
)

Sets the intensity of the step noise used for SSR (Screen Space Reflections) calculation. This parameter is used to reduce the banding effect of tracing by using the noise.

Arguments

floatstep - Step noise intensity. The default value is 0.3f. The higher is the value, the less pronounced is the banding effect.

floatgetSSRNoiseStep(
)

Returns the intensity of the step noise used for SSR (Screen Space Reflections) calculation.

Return value

Step noise intensity.

voidsetSSRNumRays(
intrays
)

Sets the number of rays of SSR (Screen Space Reflections) per pixel that are used to calculate rough refrections. Using more rays provides more precise SSR roughness calculation, however, it is more expensive.

intgetSSRNumRays(
)

Return value

Number of rays per pixel within the [1; 64] range.

voidsetSSRNumSteps(
intsteps
)

Sets the number of steps of SSR (Screen Space Reflections) per ray that are used for trace calculation. Defines accuracy of reflections and causes a reasonable performance impact. The higher the value, the more accurate obstacles between objects are accounted.

Arguments

intsteps - Number of steps per ray within the [1; 64] range. The default value is 16.

intgetSSRNumSteps(
)

Returns the number of steps of SSR (Screen Space Reflections) per ray that are used for trace calculation. The number of steps defines accuracy of reflections and causes a reasonable performance impact. The higher the value, the more accurate obstacles between objects are accounted.

intgetSSRRoughnessQuality(
)

Return value

Roughness quality:

0 - low quality.

1 - medium quality (by default).

2 - high quality.

3 - ultra quality.

voidsetSSRStepSize(
floatsize
)

Sets the size of the trace step used for SSR (Screen Space Reflections) calculation. The higher the value, the longer the trace. However, tiny objects may be missed. The lower the value, the more detailed will be reflections of the tiny objects.

Arguments

floatsize - Step size. The default value is 1.0f.

floatgetSSRStepSize(
)

Returns the size of the trace step used for SSR (Screen Space Reflections) calculation.

intisSSRTGIFastTracing(
)

Return value

1 if the SSRTGI fast tracing is enabled; otherwise, 0.

voidsetSSRTGIIncreasedAccuracy(
intaccuracy
)

Enables or disables increased accuracy for the SSRTGI (Screen Space Ray-Traced Global Illumination). This option reduces visual artifacts by increasing accuracy of the last step. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

intaccuracy - 1 to enable increased accuracy for the SSRTGI, 0 to disable. The default value is 1.

intisSSRTGIIncreasedAccuracy(
)

Return value

1 if increased accuracy is enabled for the SSRTGI; otherwise, 0.

voidsetSSRTGINoiseRay(
floatray
)

Sets the intensity of the ray noise used for SSRTGI calculation. This parameter is used to reduce the banding effect on the final image by using the noise: the higher is the value, the less pronounced is the banding effect. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

floatray - Ray noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

floatgetSSRTGINoiseRay(
)

Returns the intensity of the ray noise used for SSRTGI calculation.

Return value

Ray noise intensity in range [0.0f;1.0f].

voidsetSSRTGINoiseStep(
floatstep
)

Sets the intensity of the step noise used for SSRTGI calculation. This parameter is used to reduce the banding effect of tracing by using the noise: the higher is the value, the less pronounced is the banding effect. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

floatstep - Step noise intensity in range [0.0f;1.0f]. The default value is 0.5f. The higher is the value, the less pronounced is the banding effect.

floatgetSSRTGINoiseStep(
)

Returns the intensity of the step noise used for SSRTGI calculation.

Return value

Step noise intensity in range [0.0f;1.0f].

voidsetSSRTGINumRays(
intrays
)

Sets the number of rays of SSRTGI per pixel that are to calculate the final image. Using more rays provides more precise SSRTGI calculation, however, it is more expensive. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

intrays - Number of rays per pixel in range [1;1024]. The default value is 8.

intgetSSRTGINumRays(
)

Returns the number of rays of SSRTGI per pixel that are to calculate the final image in range [1;1024].

Return value

Number of rays.

voidsetSSRTGINumSteps(
intsteps
)

Sets the number of steps of SSRTGI per ray that are used for trace calculation. The higher the value, the more accurate obstacles between objects are accounted. However, this option significantly affects performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

intsteps - Number of steps in range [1;256]. The default value is 8.

intgetSSRTGINumSteps(
)

Returns the number of steps of SSRTGI per ray that are used for trace calculation.

intgetSSRTGIResolution(
)

Return value

SSRTGI resolution:

0 - quarter resolution.

1 - half resolution (by default).

2 - full resolution.

voidsetSSRTGIResolutionDepth(
intdepth
)

Sets the resolution of the depth buffer used for SSRTGI (Screen Space Ray-Traced Global Illumination) calculation. This option significantly affects performance. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

intdepth - Depth buffer resolution:

0 - quarter resolution (by default).

1 - half resolution.

2 - full resolution.

Notice

To gain performance this option can be set to lower values while enabling the increased accuracy.

intgetSSRTGIResolutionDepth(
)

Returns the resolution of the depth buffer used for SSRTGI (Screen Space Ray-Traced Global Illumination) calculation.

Return value

Depth buffer resolution:

0 - quarter resolution (by default).

1 - half resolution.

2 - full resolution.

voidsetSSRTGIStepSize(
floatsize
)

Sets the size of the trace step used for SSRTGI calculation. The higher the value, the longer the trace. However, tiny objects may be missed. The lower the value, the more detailed will be the tiny objects. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

floatsize - Step size. The default value is 1.0f.

floatgetSSRTGIStepSize(
)

Returns the size of the trace step used for SSRTGI calculation.

Return value

Step size.

voidsetSSRTGIUpscaling(
intupscaling
)

Enables or disables upscaling for the SSRTGI (Screen Space Ray-Traced Global Illumination). This option makes the quality of edges in half and quarter resolution look closer to full. The SSRTGI effect must be enabled (see the setSSRTGI() method).

Arguments

intupscaling - 1 to enable upscaling for the SSRTGI, 0 to disable it. The default value is 1.

intisSSRTGIUpscaling(
)

Returns a value indicating if the upscaling option is enabled for the SSRTGI (Screen Space Ray-Traced Global Illumination).

Return value

1 if the SSRTGI upscaling is enabled; otherwise, 0.

voidsetSSRThreshold(
floatthreshold
)

Sets the threshold used for SSR (Screen Space Reflections) calculation. The threshold limits imitation of reflections in areas where SSR cannot get information. The higher the value, the less this effect is.

Arguments

floatthreshold - SSR threshold value. The default value is 1.0f

floatgetSSRThreshold(
)

Returns the threshold used for SSR (Screen Space Reflections) calculation. The threshold limits imitation of reflections in areas where SSR cannot get information. The higher the value, the less this effect is.

Return value

SSR threshold.

voidsetSSRThresholdOcclusion(
floatocclusion
)

Sets the occlusion threshold value. The occlusion threshold limits imitation of environment cubemap occlusion in areas where SSR cannot get information. The higher the value, the less this effect is. This parameter is mainly used for indoor environment to correct false reflections on occluded areas (false reflections are replaced with black color). For outdoor environment higher values of this parameter are recommended.

Arguments

floatocclusion - SSR threshold occlusion. The default value is 1.0f

floatgetSSRThresholdOcclusion(
)

Returns the current occlusion threshold value. The occlusion threshold limits imitation of environment cubemap occlusion in areas where SSR cannot get information. The higher the value, the less this effect is. This parameter is mainly used for indoor environment to correct false reflections on occluded areas (false reflections are replaced with black color). For outdoor environment higher values of this parameter are recommended.

Return value

SSR threshold occlusion.

voidsetSSRVisibilityRoughnessMax(
floatmax
)

Sets the maximum roughness value, starting from which the SSR (Screen Space Reflections) effect is not rendered.

voidsetSSS(
intsss
)

Arguments

intsss - 1 to enable the SSS effect, 0 to disable. The default value is 0.

intisSSS(
)

Returns a value indicating if the SSS (subsurface scattering) effect is enabled.

Notice

To get the value via the console, use the
render_sss console variable.

Return value

1 if the SSS effect is enabled; otherwise, 0.

voidsetSSSColor(
const Math::vec4 &color
)

Sets a subsurface scattering color used to simulate the subsurface component of skin lighting, i.e. the light that bounces inside of the subsurface tissue layers (epidermis and dermis) before exiting. For skin, subsurface color is reddish, due to blood circulating in skin tissues.

intgetSSSQuality(
)

Return value

SSS quality:

0 - low quality.

1 - medium quality (by default).

2 - high quality.

3 - ultra quality.

voidsetSSSRadius(
floatradius
)

Sets the subsurface scattering radius: distance in the screen space, within which colors will be sampled. It controls how much wrinkles, pores and cavities will be blurred and highlighted. The higher the value, the farther subsurface scattering reaches. Too high values result in the ghosting effect. By the minimum value of 0, no subsurface scattering is rendered.

intgetSSSResolution(
)

Return value

SSS resolution:

0 - half resolution (by default).

1 - full resolution.

voidsetStereo(
intstereo
)

Sets the stereo rendering mode.

Notice

To set the value via the console, use the
render_stereo console command. It is not possible to set a stereo mode via a console if the default system script is used; it allows for setting it only on the start-up.

Arguments

intstereo - Stereo rendering mode:

0 - disabled (by default).

1 - enabled anaglyph stereo.

2 - enabled interlaced stereo.

3 - enabled horizontal stereo.

4 - enabled vertical stereo.

intgetStereo(
)

Returns the current stereo rendering mode.

Notice

To get the value via the console, use the
render_stereo console variable.

Return value

Stereo rendering mode:

0 - disabled (by default).

1 - enabled anaglyph stereo.

2 - enabled interlaced stereo.

3 - enabled horizontal stereo.

4 - enabled vertical stereo.

voidsetStereoDistance(
floatdistance
)

Sets the focal distance for stereo rendering (distance in the world space to the point where two views line up, i.e. to the zero parallax plane).

Arguments

floatdistance - Focal distance for stereo rendering, in units.

floatgetStereoDistance(
)

Returns the focal distance for stereo rendering (distance in the world space to the point where two views line up).

floatgetSupersampling(
)

Return value

Number of samples per pixel.

voidsetTAAColorClamping(
intclamping
)

Enables or disables the TAA color clamping option. When enabled, the pixel color of the current and the previous frames is clamped. The image becomes more sharp, however, flickering can appear. Clamping is available only when TAA is enabled.

Return value

1 if TAA color clamping is enabled; otherwise, 0.

voidsetTAAFixFlicker(
intflicker
)

Enables or disables the TAA fix flicker option. This option fixes flickering edges caused by TAA: it removes bright pixels by using the pixel brightness information from the previous frame. It is recommended to enable the option for bright thin ropes, wires and lines. The option is available only when TAA is enabled.

Arguments

intisTAAFixFlicker(
)

Returns a value indicating if the TAA fix flicker option is enabled. This option fixes flickering edges caused by TAA: it removes bright pixels by using the pixel brightness information from the previous frame. It is recommended to enable the option for bright thin ropes, wires and lines. The option is available only when TAA is enabled.

Return value

1 if the TAA fix flicker option is enabled; otherwise, 0.

voidsetTAAFrameCount(
floatcount
)

Sets the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frames combined for pixels. The higher the value, the more frames are combined into the final image and the better anti-aliasing.

Arguments

floatcount - TAA frame count value. The default value is 30.0f.

floatgetTAAFrameCount(
)

Returns the frame count of TAA (Temporal Anti-Aliasing). Specifies the number of frames combined for pixels. The higher the value, the more frames are combined into the final image and the better anti-aliasing.

Return value

TAA detail level value.

voidsetTAAVelocityClamping(
intclamping
)

Enables or disables the TAA velocity clamping option. This option controls the number of frames combined for pixels depending on the velocity in the fragment: the number of frames is clamped to the [Min frame count;Max frame count]. It reduces blurring in dynamic scenes with a lot of moving objects.

Arguments

intisTAAVelocityClamping(
)

Returns a value indicating if the TAA velocity clamping option is enabled. T This option controls the number of frames combined for pixels depending on the velocity in the fragment: the number of frames is clamped to the [Min frame count;Max frame count]. It reduces blurring in dynamic scenes with a lot of moving objects.

Return value

TAA velocity threshold value.

voidsetTerrainAnisotropy(
intanisotropy
)

Sets the terrain texture anisotropy level (degree of anisotropic filtering). Anisotropy for terrain has a huge impact for the performance if terrain has a lot of tiled detail materials as anisotropy filtering for the terrain is much slower than for the other objects.

Math::vec4getWireframeColor(
)

Return value

Converts the image to a specified compressed format. If compression by the GPU is not supported, the Image::compress() method will be called instead.

Arguments

Ptr<Image> &image - Image to compress.

intquality - Compression quality:

0 - fast compression, low compressed image quality.

1 - high compressed image quality, slow compression (by default).

intnew_image_format - Compressed texture format: one of the Texture::FORMAT_* variables. This is an optional argument. If no format is specified, default conversion will be performed (depending on the type of the source image).

intuse_mip_maps - Flag indicating whether texture mipmaps should be generated for the compressed image: 1 to generate mipmaps, 0 not to generate. This is an optional argument. If no value is specified, mipmaps will be generated only if the source image has the mipmaps.

Arguments

Ptr<Image> &destination - Image into which the compressed texture will be saved.

intquality - Compression quality:

0 - fast compression, low compressed image quality.

1 - high compressed image quality, slow compression (by default).

intnew_texture_format - Compressed texture format: one of the Texture::FORMAT_* variables. This is an optional argument. If no format is specified, default conversion will be performed (depending on the type of the source image).

intuse_mip_maps - Flag indicating whether texture mipmaps should be generated for the compressed image: 1 to generate mipmaps, 0 not to generate. This is an optional argument. If no value is specified, mipmaps will be generated only if the source image has the mipmaps.

Renders the given node into a 2D image in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class. The node can be rendered using the specific type of lighting and environment cubemap.

Arguments

intskip_flags - Skip the effects. One of the SKIP_* variables should be specified. 0 enables all the effects.

intlight_usage - Sets the light sources that will affect the node (one of the USAGE_*_LIGHTING Viewport class variables.)

const char *environment_texture_name - Path to the environment cubemap to be used. Takes effect if the first (auxiliary light) or second (node light) lighting mode is used (see the light_usage argument above). In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.

Renders the 2D image of the given node in accordance with the specified parameters. The viewport position is taken from the camera created via Camera class. The node can be rendered using the specific type of lighting and environment cubemap.

inthdr - HDR flag. This parameter determines the format of the 2D image:

1 - image format will be set to RGBA16F. It means that the HDR image buffer will store pixel values outside the [0;1] range (i.e. both negative and positive values).

0 - image format will be set to RGBA8.

intskip_flags - Skip the effects. One of the SKIP_* variables should be specified. 0 enables all the effects.

intlight_usage - Sets the light sources that will affect the node (one of the USAGE_*_LIGHTING Viewport class variables).

const char *environment_texture_name - Path to the environment cubemap to be used. Takes effect if the first (auxiliary light) or second (node light) lighting mode is used (see the light_usage argument above). In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.