engine.render Functions
This set of functions and predefined variables exposes a number of renderer settings.
See Also
- Article on UnigineScript Migration
int API_DIRECT3D11
Description
DIRECT3D 11 API.int API_NULL
Description
Null API name.int API_OPENGL
Description
OpenGL API.int API_OPENGLES
Description
OpenGL ES API.int API_UNKNOWN
Description
Unknown API.int GPU_AMD
Description
AMD GPU.int GPU_APPLE
Description
Apple GPU.int GPU_ARM
Description
ARM GPU.int GPU_IMGTEC
Description
Imagination Technologies GPU.int GPU_INTEL
Description
Intel GPU.int GPU_NVIDIA
Description
NVIDIA GPU.int GPU_QUALCOMM
Description
Qualcomm GPU.int GPU_UNKNOWN
Description
Unknown GPU.int RENDER_DEFERRED_DISABLED
Description
Rendering of the simplified deferred lighting is disabled.int RENDER_DEFERRED_LIGHTING
Description
Lighting is rendered as deferred (simplified).int RENDER_DEFERRED_SHADING
Description
Lighting is rendered with deferred shading (super simplified).int RENDER_ENVIRONMENT_NUM_PRESETS
Description
The number of environment presets.int RENDER_EXPOSURE_DISABLED
Description
Rendering of the adaptive exposure effect is disabled.int RENDER_EXPOSURE_LOGARITHMIC
Description
The adaptive exposure effect is rendered using logarithmic function.int RENDER_EXPOSURE_QUADRATIC
Description
The adaptive exposure effect is rendered using quadratic function.int RENDER_HAZE_DISABLED
Description
Disables the haze effect.int RENDER_HAZE_SCATTERING
Description
The mode when the haze is colored the current scattering color.int RENDER_HAZE_SOLID
Description
The mode when the haze is colored the specified color.int RENDER_QUALITY_HIGH
Description
High quality of textures and shaders.int RENDER_QUALITY_LOW
Description
Low quality of textures and shaders. 1/16 of the original texture will be used.int RENDER_QUALITY_MEDIUM
Description
Medium quality of textures and shaders. 1/4 of the original texture will be used.int RENDER_STEREO_DISABLED
Description
Stereo rendering is disabled.int RENDER_STEREO_ENABLED
Description
Stereo rendering is enabled.int RENDER_STEREO_HORIZONTAL
Description
Horizontal stereo mode is enabled (it is used on mobile devices with 3D displays).int RENDER_STEREO_VERTICAL
Description
Vertical stereo mode is enabled (it is used on mobile devices with 3D displays).int engine.render.getAPI ()
Returns the current Graphics API, or API_UNKNOWN if API cannot be identified.Return value
The Graphics API flag (see API_* variables).int engine.render.getAlphaFade ()
Returns a value indicating if alpha fading between object LODs is enabled.Return value
1 if alpha fading is enabled; otherwise, 0.float engine.render.getAnimationLeaf ()
Returns the current scale for rotation angle of vegetation leaves. It scales the Leaf offset parameter for mesh_leaf_base material.Return value
Global leaf rotation angle.float engine.render.getAnimationScale ()
Returns the current global scale for rotation speed of vegetation leaves. It scales the Leaf scale parameter for mesh_leaf_base material.Return value
Global leaf rotation speed.float engine.render.getAnimationStem ()
Returns the current global scale for movement amplitude of vegetation stems. It scales Stem offset parameter for both mesh_leaf_base and mesh_stem_base materials.Return value
Global stem amplitude scale.float engine.render.getAnimationTime ()
Returns the render animation time for vegetation.Return value
Animation time in milliseconds.vec3 engine.render.getAnimationWind ()
Returns the current direction of wind for all vegetation (grass and trees). It is a multiplier for the stem offset (in grass, stem and leaves materials).Return value
Offset for vegetation under wind by X, Y and Z axes.int engine.render.getAuxiliary ()
Returns a value indicating if auxiliary buffer is used.Return value
1 if auxiliary buffer is used; otherwise, 0.vec4 engine.render.getBokehColor ()
Returns the current color for the bokeh effect.Return value
Bokeh color.float engine.render.getBokehFarPower ()
Returns the current power controlling how close to the focal point the bokeh effect comes into action (across the far blur range of DOF). The higher the value, the further (and smaller) bokeh effect starts to be rendered.Return value
Far bokeh power.float engine.render.getBokehFarSize ()
Returns the size of the bokeh effect across the far blur range of DOF.Return value
Far bokeh effect size.float engine.render.getBokehNearPower ()
Returns the current power controlling how close to the focal point the bokeh effect comes into action (across the near blur range of DOF). Decreasing this value allows to render the bokeh effect closer to the focal point. It also means that the bokeh appears in its full size right near the focal point rather than gradually getting smaller up to the in-focus area.Return value
Near bokeh power.float engine.render.getBokehNearSize ()
Returns the size of the bokeh effect across the near blur range of DOF.Return value
Near bokeh effect size.float engine.render.getBokehScale ()
Returns the multiplier for color of HDR lens flares.Return value
Bokeh color scale.string engine.render.getBokehTextureName ()
Returns a custom texture used for the bokeh effect.Return value
Texture name.float engine.render.getBokehThreshold ()
Returns the brightness threshold for the bokeh effect. Increasing this value allows for rendering bokeh only for bright enough light points.Return value
Bokeh threshold.float engine.render.getBudget ()
Returns the value of the render budget, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.Return value
The budget value in seconds.float engine.render.getCameraEffectsThreshold ()
Returns the brightness threshold, which is used to detect if an object should be blurred in the HDR mode.Return value
HDR threshold.vec3 engine.render.getCameraOffset ()
Returns an offset vector of the camera.Return value
Offset of the camera, X, Y and Z axes.float engine.render.getCameraThreshold ()
Returns a current camera threshold value.Return value
Camera threshold value.float engine.render.getClutterDistance ()
Returns a distance, at which (and farther) objects with "clutter" flag on will not be rendered.Return value
Distance in units.float engine.render.getColorBrightness ()
Returns the current overall brightness of the scene.Return value
Current brightness.float engine.render.getColorContrast ()
Returns the current overall contrast of the scene.Return value
Current contrast.float engine.render.getColorGamma ()
Returns the current overall gamma of the scene.Return value
Current gamma.float engine.render.getColorSaturation ()
Returns the current overall saturation of the scene.Return value
Current saturation.int engine.render.getColorTextureImage (Image image)
Return the current color transformation image (LUT).Arguments
- Image image - Image to store the color transformation texture in.
Return value
1 if an image is successfully received; otherwise, 0.string engine.render.getColorTextureName ()
Returns the name of the current color transformation texture (LUT).Return value
Name of the current color transformation texture.vec4 engine.render.getColorWhite ()
Returns the current white balance of the scene.Return value
Current white balance.string engine.render.getCompositeMaterial ()
Returns a name of the current composite material that specifies a custom shader used for the final composition of the full-screen image instead of the default one.Return value
Name of the current composite material.float engine.render.getCrossAngle ()
Returns the angle between flare shafts of a cross flare.Return value
Angle between flare shafts in degrees.vec4 engine.render.getCrossColor ()
Returns the color of a cross flare.Return value
Color of a cross flare.float engine.render.getCrossLength ()
Returns the length of a cross flare.Return value
Length of a cross flare relative to the screen width.float engine.render.getCrossScale ()
Returns the current multiplier for color of HDR cross flares.Return value
Cross color scale.int engine.render.getCrossShafts ()
Returns the number of cross flares.Return value
Number of cross flares.float engine.render.getCrossThreshold ()
Returns the current brightness threshold for cross flares.Return value
Cross flares threshold.int engine.render.getDOF ()
Returns a value indicating if depth of field is enabled.Return value
1 if depth of field is enabled; otherwise, 0.float engine.render.getDOFFarBlurPower ()
Returns the current depth of field power that controls the rate with which objects become blurred across the far blur range.Return value
Blurring power.float engine.render.getDOFFarBlurRadius ()
Returns the the blur factor used for out-of-focus objects across the far blur range.Return value
Far blur factor.float engine.render.getDOFFarBlurRange ()
Returns the current range from the focal point and away from the camera, within which objects are unfocused from. To the end of this distance, objects are blurred according to the blur radius.Return value
Distance in units for defocusing from objects.float engine.render.getDOFFarFocalPower ()
Returns the current focal power that controls the smoothness of transition between in-focus and blurred areas (both the rate and intensity with which objects become blurred) across the far blur range.Return value
Focal power.float engine.render.getDOFFarFocalRange ()
Returns the current area from the focal point and further away from the camera for objects in crisp focus (not blurred).Return value
Far focal range in units.float engine.render.getDOFFarFocalScale ()
Returns a scale that shifts the far blur range closer to the camera. (This is an interpolation coefficient between a non-blurred screen image and a blurred one.) The higher the value, the smaller is the far blur range and the closer to the camera the blurring starts.Return value
Far scale.float engine.render.getDOFFocalDistance ()
Returns a distance to objects in focus.Return value
Distance to the camera focus in units.float engine.render.getDOFNearBlurPower ()
Returns the current depth of field power that controls the rate with which objects become blurred across the near blur range.Return value
Blurring power.float engine.render.getDOFNearBlurRadius ()
Returns the the blur factor used for out-of-focus objects across the near blur range.Return value
Near blur factor.float engine.render.getDOFNearBlurRange ()
Returns the current range from the focal point towards the camera, within which objects are focused on (become clear). At the beginning of this distance, objects are blurred according to the blur radius.Return value
Distance in units for focusing on objects.float engine.render.getDOFNearFocalPower ()
Returns the current focal power that controls the smoothness of transition between in-focus and blurred areas (both the rate and intensity with which objects become blurred) across the near blur range.Return value
Focal power.float engine.render.getDOFNearFocalRange ()
Returns the current area from the camera to the focal point for objects in crisp focus (not blurred).Return value
Near focal range in units.float engine.render.getDOFNearFocalScale ()
Returns a scale that shifts the near blur range further from the camera. (This is an interpolation coefficient between a non-blurred screen image and a blurred one.) The higher the value, the wider is the near blur range and the further from the camera the blurring ends.Return value
Near scale.string engine.render.getData ()
Returns user data associated with the render. This string is written directly into a *.world file. Namely, into the data child tag of the render tag, for example:<world version="1.21">
<render>
<data>User data</data>
</render>
</world>
Return value
User data. Data can contain an XML formatted string.float engine.render.getDecalDistance ()
Returns the distance, at which (and farther) decals will not be rendered.Return value
Distance in units.string engine.render.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.Return value
Name of the lens flares modulation texture.float engine.render.getDistanceScale ()
Returns the current global distance scale for all distance parameters: shadow distance, world lights shadows, LOD distances, etc.Return value
Global distance scale.vec4 engine.render.getEnvironmentHazeColor (int num)
Returns the current haze color set for the given preset.Arguments
- int num - Preset number.
Return value
Haze color.float engine.render.getEnvironmentHazeDensity (int num)
Returns the current haze density set for the given preset.Arguments
- int num - Preset number.
Return value
Haze density.float engine.render.getEnvironmentHazeMaxDistance (int num)
Returns the current distance at which the haze effect appears for the given preset.Arguments
- int num - Preset number.
Return value
Haze maximum distance.int engine.render.getEnvironmentHazeMode ()
Returns the current mode set for the haze effect.Return value
One of the RENDER_HAZE_* variables.float engine.render.getEnvironmentPresetIntensity (int num)
Returns the intensity of the given preset.Arguments
- int num - Preset number.
Return value
Intensity of the preset.string engine.render.getEnvironmentScatteringBaseLUTName (int num)
Returns the path to the base LUT texture (the texture defining the base color of the sky) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.vec4 engine.render.getEnvironmentScatteringGroundColor (int num)
Returns the current color set for the imitated landscape (ground).Arguments
- int num - Preset number.
Return value
Ground color.string engine.render.getEnvironmentScatteringGroundLUTName (int num)
Returns the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.string engine.render.getEnvironmentScatteringLightColorLUTName (int num)
Returns the path to the light color texture (the texture defining the color of the LightWorld for different times of the day).Arguments
- int num - Preset number.
Return value
Path to the texture.string engine.render.getEnvironmentScatteringMieLUTName (int num)
Returns the path to the Mie LUT texture (the texture for setting the Mie light) set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the texture.vec4 engine.render.getEnvironmentTextureColor (int num)
Returns the environment color multiplier set for the given preset.Arguments
- int num - Preset number.
Return value
The environment color multiplier.string engine.render.getEnvironmentTextureName (int num)
Returns the path to the cubemap defining the environment color set for the given preset.Arguments
- int num - Preset number.
Return value
Path to the cubemap defining the environment color.float engine.render.getExposure ()
Returns the current exposure.Return value
Current exposure in seconds.float engine.render.getExposureAdaptation ()
Returns the current period of exposure adaptation.Return value
Period of exposure adaptation in seconds.float engine.render.getExposureBright ()
Returns the current coefficient for decreasing the brightness of all HDR flares (lens, shaft ans cross ones). This function can be used in addition to overall HDR exposure.Return value
Coefficient for normalizing flares brightness.float engine.render.getExposureMaxLuminance ()
Returns the maximum luminance used for HDR rendering.Return value
Maximum luminance.float engine.render.getExposureMinLuminance ()
Returns the minimum luminance used for HDR rendering.Return value
Minimum luminance.int engine.render.getExposureMode ()
Returns current adaptive exposure mode:- 0 - exposure is not used
- 1 - logarithmic adaptive exposure used
- 2 - quadratic adaptive exposure used
Return value
The type of exposure mode.float engine.render.getFXAASampleOffset ()
Returns the current FXAA fragment sample offset.Return value
FXAA fragment sample offset.vec4 engine.render.getFadeColor ()
Returns the current fade color of the scene.Return value
Current fade color.float engine.render.getFieldDistance ()
Returns the distance, at which (and farther) Field nodes will not be rendered.Return value
Distance in units.float engine.render.getFilmicLinearAngle ()
Returns the current Linear Angle filmic tone mapping parameter value.Return value
Liner Angle value.float engine.render.getFilmicLinearScale ()
Returns the current Linear Strength filmic tone mapping parameter value.Return value
Linear Strength value.float engine.render.getFilmicShoulderScale ()
Returns the current Shoulder Strength filmic tonemapping parameter value.Return value
Shoulder Strength value.float engine.render.getFilmicToeDenominator ()
Returns the current Toe Denominator filmic tonemapping parameter value.Return value
Toe Denominator value.float engine.render.getFilmicToeNumerator ()
Sets the Toe Numerator filmic tonemapping parameter value.Return value
Toe Numerator value.float engine.render.getFilmicToeScale ()
Returns the current Toe Strength filmic tonemapping parameter value.Return value
Toe Strength value.float engine.render.getFilmicWhiteLevel ()
Returns the current Linear White Point filmic tonemapping parameter value.Return value
Linear White Point value.int engine.render.getGPUMemory ()
Returns an amount of memory provided by the current GPU.Return value
Amount of memory in Mbytes.int engine.render.getGPUName ()
Returns the name of the current GPU.Return value
GPU name flag.int engine.render.getGeometryShader ()
Returns a value indicating if geometry shader is used.Return value
1 if geometry shader is used; otherwise, 0.vec4 engine.render.getLensColor ()
Returns the color of a lens flare.Return value
Color of a lens flare.vec3 engine.render.getLensDispersion ()
Returns the current color displacement for red, greed and blue channels of the lens flares. Can be used to create light dispersion (chromatic aberrations).Return value
Lens dispersion displacement per channel.float engine.render.getLensLength ()
Returns the current length indicating if the whole radial lens flare is rendered on the screen or only a part of it. This option controls how lens flares pattern is distributed.Return value
Length of the lens flare.float engine.render.getLensRadius ()
Returns the current radius of the spherical lens flares on the screen.Return value
Radius of the spherical lens flares.float engine.render.getLensScale ()
Returns the current multiplier for color of HDR lens flares.Return value
Lens color scale.float engine.render.getLensThreshold ()
Returns the current brightness threshold for lens flares.Return value
Lens flares threshold.float engine.render.getLightDistance ()
Returns the distance, at which (and farther) dynamic lights will not be rendered.Return value
Distance in units.int engine.render.getMotionBlur ()
Returns a value indicating if motion blur is enabled.Return value
1 if motion blur is enabled; otherwise, 0.float engine.render.getMotionBlurDepthFalloff ()
Returns the motion blur falloff depending on depth.Return value
Depth fallofffloat engine.render.getMotionBlurMaxVelocity ()
Returns the current maximum amount of motion blur for moving physical bodies.Return value
Maximum scaled velocity of bodies used for the motion blur.float engine.render.getMotionBlurVelocityScale ()
Returns the current amount of motion blur for moving physical bodies.Return value
Scale of bodies' linear and angular velocities used for the motion blur.int engine.render.getNumDecals ()
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.int engine.render.getNumDips ()
Returns the number of draw calls used in the current scene. See Rendering Profiler article for details.Return value
The number of draw calls.int engine.render.getNumLights ()
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.int engine.render.getNumMaterials ()
Returns the number of materials set per frame (during all of the rendering passes) in the current scene.Return value
The number of materials.int engine.render.getNumPrimitives ()
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.int engine.render.getNumProcedurals ()
Returns the number of procedurals that can be currently seen in the viewport.Return value
The number of procedurals.int engine.render.getNumReflections ()
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.Return value
The number of reflections.int engine.render.getNumShaders ()
Returns the number of shaders set per frame. See Rendering Profiler article for details.Return value
The number of shaders.int engine.render.getNumShadows ()
Returns the number of shadow passes rendered per frame. See Rendering Profiler article for details.Return value
The number of shadow passes.int engine.render.getNumSurfaces ()
Returns the number of rendered per frame surfaces that can be currently seen in the viewport (in all rendering passes). See Rendering Profiler article for details.Return value
Number of surfaces.int engine.render.getNumTriangles ()
Returns the number of rendered per frame triangles that can be currently seen in the viewport. See Rendering Profiler article for details.Return value
Number of triangles.float engine.render.getObjectDistance ()
Returns a distance, at which (and farther) objects will not be rendered.Return value
Distance in units.int engine.render.getParallax ()
Returns a value indicating if parallax occlusion mapping is enabled.Return value
1 if parallax occlusion mapping is enabled; otherwise, 0.string engine.render.getPostMaterials ()
Returns names of the current post postprocess materials that are applied after all other postprocess (such as HDR, DOF, etc.) are rendered. Materials are applied in the order of listing.
They are used together with Player::getPostMaterials(), if any.
Return value
Name of the current post postprocess materials.int engine.render.getReflection ()
Returns a value indicating if reflections are enabled.Return value
1 if reflections are enabled; otherwise, 0.vec4 engine.render.getReflectionColor ()
Returns the color that allows to adjust reflections of all meshes with reflective materials, i.e.:- mesh_reflection_2d_base
- mesh_reflection_cube_base
- mesh_paint_reflection_cube_base
- mesh_tessellation_reflection_2d_base
- mesh_tessellation_reflection_cube_base
- mesh_tessellation_paint_reflection_cube_base
Return value
Reflection color for reflective mesh materials.float engine.render.getReflectionDistance ()
Returns the distance, at which (and farther) reflections will not be rendered.Return value
Distance in units.int engine.render.getRefraction ()
Returns a value indicating if refraction is enabled.Return value
1 if refraction is enabled; otherwise, 0.vec4 engine.render.getRefractionDispersion ()
Returns the refraction displacement for red, greed and blue channels (according to the refraction texture of refractive materials). It can be used to create light dispersion (chromatic aberrations).Return value
Dispersion displacement.string engine.render.getRenderMaterials ()
Returns names of the current postprocess materials that are applied before all other postprocess (such as HDR, DOF, etc.) are rendered. Materials are applied in the order of listing.Return value
Name of the current render materials.float engine.render.getSSAOBlur ()
Returns SSAO blur valueReturn value
SSAO blur value.float engine.render.getSSAOCavityScale ()
Returns SSAO cavity intensity.Return value
SSAO cavity intensity.float engine.render.getSSAORadius ()
Returns the radius of ambient occlusion.Return value
Radius of ambient occlusion shadowing.float engine.render.getSSAOScale ()
Returns the current multiplier for ambient occlusion providing darker shadows.Return value
Scale of ambient occlusion shadowing.string engine.render.getShaderDefines ()
Returns an additional shader defines.Return value
Additional shader defines.int engine.render.getShadersQuality ()
Returns the quality of shaders.Return value
One of the RENDER_QUALITY_* pre-defined variables.float engine.render.getShadowDistance ()
Returns the distance, at which (and farther) shadows will not be rendered.Return value
Distance in units.int engine.render.getShadowShafts ()
Returns a value indicating if volumetric shadows are enabled.Return value
1 if volumetric shadows are enabled; otherwise, 0.float engine.render.getShadowShaftsAttenuation ()
Returns the current power of fading for volumetric shadows across their length.Return value
Fading power.float engine.render.getShadowShaftsExposure ()
Returns the contrast used for volumetric shadows.Return value
Shadow contrast.float engine.render.getShadowShaftsLength ()
Returns the length of volumetric shadows.Return value
Shadow length.float engine.render.getSharpenIntensity ()
Returns intensity of the sharpening effect.Return value
Intensity of the sharpening effect.int engine.render.getStereo ()
Returns a value indicating if stereo rendering is enabled.Return value
1 if dual stereo rendering is used; 2 if wide stereo rendering is used; otherwise, 0.float engine.render.getStereoDistance ()
Returns the focal distance for stereo rendering (distance in the world space to the point where two views line up).Return value
Focal distance in units.float engine.render.getStereoOffset ()
Returns the virtual camera offset (an offset after the perspective projection).Return value
Virtual camera offset in units.float engine.render.getStereoRadius ()
Returns the current radius for stereo (the half of the separation distance between the cameras).Return value
Stereo radius in units.float engine.render.getSunShaftsAttenuation ()
Returns the current power of fading for HDR shaft flare across its length.Return value
Fading power.vec4 engine.render.getSunShaftsColor ()
Returns the current color of the lens shafts.Return value
Color of lens shafts.float engine.render.getSunShaftsLength ()
Returns the length of a flare shaft.Return value
Length of a flare shaft relative to the screen width.float engine.render.getSunShaftsScale ()
Returns the current multiplier for color of HDR shaft flares.Return value
Shaft color scale.float engine.render.getSunShaftsThreshold ()
Returns the current brightness threshold for flare shafts.Return value
Flare shafts threshold.int engine.render.getTessellation ()
Returns a value indicating if tessellation is enabled.Return value
1 if tessellation is enabled; otherwise, 0.float engine.render.getTessellationDistance ()
Returns the multiplier for the corresponding material parameter, that controls the distance after which surfaces are not tessellated.Return value
Tessellation distance multiplier.float engine.render.getTessellationFactor ()
Returns the multiplier for the corresponding material parameter that controls subdivision of triangles into smaller ones.Return value
Tessellation factor multiplier.float engine.render.getTessellationScale ()
Returns the multiplier for the corresponding material parameter that determines displacement factor for the tessellated surfaces (to what extent geometry is extruded).Return value
Tessellation scale multiplier.int engine.render.getTexturesQuality ()
Returns the quality of textures.Return value
One of the RENDER_QUALITY_* pre-defined variables.vec4 engine.render.getWireframeColor ()
Returns the color of the wireframe.Return value
Wireframe color.int engine.render.isBloomEnabled ()
Returns a value indicating if the bloom effect is enabled.Return value
1 if the bloom effect is enabled; otherwise, 0.int engine.render.isBokehEnabled ()
Sets a value indicating if a bokeh effect is rendered for bright lights across the DOF-blurred range. Both HDR and DOF should be enabled to render this effect.Return value
Positive integer if bokeh flares are enabled; otherwise, 0.int engine.render.isCrossEnabled ()
Returns a value indicating if cross flares are enabled.Return value
Positive integer if cross flares are enabled; otherwise, 0.int engine.render.isEnabled ()
Returns a value indicating if the loaded world is rendered.Return value
Positive value if the world is rendered; otherwise, 0.int engine.render.isFirstFrame ()
Returns a value indicating if the first frame is enabled over the current frame.Return value
1 if the first frame flag is enabled; otherwise, 0.int engine.render.isLensEnabled ()
Returns a value indicating if lens flares are enabled.Return value
Positive integer if lens flares are enabled; otherwise, 0.int engine.render.isSunShaftsEnabled ()
Returns a value indicating if flare shafts are enabled.Return value
Positive integer if flare shafts are enabled; otherwise, 0.int engine.render.loadSettings (string file)
Loads renderer settings from a given file.Arguments
- string file - Path to an XML file with desired settings.
Return value
1 if the settings are loaded successfully; otherwise, 0.int engine.render.loadWorld (Xml xml)
Load a render state from the given Xml node.Arguments
- Xml xml - Xml node.
Return value
1 if the state is loaded successfully; otherwise, 0.void engine.render.renderImage2D (mat4 projection, mat4 modelview, Image image, int width, int height, string materials, int hdr)
Renders the 2D image with specified settings.Arguments
- mat4 projection - Projection matrix.
- mat4 modelview - Model-view matrix.
- Image image - Texture image.
- int width - Width of the projected image in units.
- int height - Height of the projected image in units.
- string materials - Comma-separated list of material names used for postprocessing visual effects.
- int hdr - HDR rendering mode flag (see RENDER_HDR_* variables).
void engine.render.renderImageCube (mat4 projection, vec3 position, Image image, int size, string materials, int hdr)
Renders the cube map with specified settings.Arguments
- mat4 projection - Projection matrix.
- vec3 position - Position from where to grab the cube map.
- Image image - Texture image.
- int size - Texture dimensions (cube map edge size).
- string materials - Comma-separated list of material names used for postprocessing visual effects.
- int hdr - HDR rendering mode flag: 1 to grab with HDR, 0 - without.
void engine.render.renderProcedurals (int materials = [])
Renders post-process materials with procedural textures (calculated on GPU using custom shaders) that are assigned to surfaces.Arguments
- int materials - ID of surface post-process materials array.
int engine.render.restoreState (Stream stream)
Restore a render state from the stream.Arguments
- Stream stream - Stream to restore a state from.
Return value
1 if the state is restored successfully; otherwise, 0.int engine.render.saveSettings (string file)
Saves the current renderer settings to a given file.Arguments
- string file - Path to a target file.
Return value
1 if the settings are saved successfully; otherwise, 0.int engine.render.saveState (Stream stream)
Save a render state into the stream.Arguments
- Stream stream - Stream to save a state into.
Return value
1 if the state is saved successfully; otherwise, 0.int engine.render.saveWorld (Xml xml)
Saves the render state into the given Xml node.Arguments
- Xml xml - Xml node.
Return value
1 if the state is saved successfully; otherwise, 0.void engine.render.setAnimationLeaf (float angle)
Updates the global scale for rotation angle of vegetation leaves. It scales the Leaf offset parameter for mesh_leaf_base material.Arguments
- float angle - Global leaf rotation angle. If a negative value is provided, 0 will be used instead.
void engine.render.setAnimationScale (float scale)
Updates the global scale for rotation speed of vegetation leaves. It scales the Leaf scale parameter for mesh_leaf_base material.Arguments
- float scale - Global leaf rotation speed.
void engine.render.setAnimationStem (float offset)
Updates the global scale for movement amplitude of vegetation stems. It scales Stem offset parameter for both mesh_leaf_base and mesh_stem_base materials.Arguments
- float offset - Global stem amplitude scale. If a negative value is provided, 0 will be used instead.
void engine.render.setAnimationTime (float time)
Updates the render animation time for vegetation.Arguments
- float time - Animation time in milliseconds.
void engine.render.setAnimationWind (vec3 offset)
Sets the direction of wind for all vegetation (grass and trees). It is a multiplier for the stem offset (in grass, stem and leaves materials).Arguments
- vec3 offset - Offset for vegetation under wind by X, Y and Z axes.
void engine.render.setBloomEnabled (int enable)
Sets a value indicating if the bloom effect should be rendered.Arguments
- int enable - 1 value to enable the bloom effect, 0 to disable.
void engine.render.setBokehColor (vec4 color)
Sets the color for the bokeh effect.Arguments
- vec4 color - Bokeh color.
void engine.render.setBokehEnabled (int enable)
Sets a value indicating if a bokeh effect should be rendered for bright lights across the DOF-blurred range. Both HDR and DOF should be enabled to render this effect.Arguments
- int enable - Positive value to enable bokeh effect, 0 to disable.
void engine.render.setBokehFarPower (float power)
Sets the power controlling how close the bokeh effect comes into action (across the far blur range of DOF). Decreasing this value enables to start rendering the bokeh effect closer to the camera. It means that the bokeh appears at once rather than gradually getting bigger.Arguments
- float power - Far bokeh power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setBokehFarSize (float size)
Sets the size of the bokeh effect across the far blur range of DOF.Arguments
- float size - Far bokeh effect size. The provided value is clamped to the range [0;1].
void engine.render.setBokehNearPower (float power)
Sets the power controlling how close to the focal point the bokeh effect comes into action (across the near blur range of DOF). Decreasing this value allows to render the bokeh effect closer to the focal point. It also means that the bokeh appears in its full size right near the focal point rather than gradually getting smaller up to the in-focus area.Arguments
- float power - Near bokeh power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setBokehNearSize (float size)
Sets the size of the bokeh effect across the near blur range of DOF.Arguments
- float size - Near bokeh effect size. The provided value is clamped to the range [0;1].
void engine.render.setBokehScale (float scale)
Sets the multiplier for color of HDR lens flares.Arguments
- float scale - Bokeh color scale. If a negative value is provided, 0 will be used instead.
int engine.render.setBokehTextureName (string name)
Sets a custom texture for the bokeh effect.Arguments
- string name - Texture name.
Return value
Positive integer if a texture is successfully set; otherwise, 0.void engine.render.setBokehThreshold (float threshold)
Sets the brightness threshold for the bokeh effect. Increasing this value allows for rendering bokeh only for bright enough light points.Arguments
- float threshold - Bokeh threshold. If a negative value is provided, 0 is used instead.
void engine.render.setBudget (float budget)
Sets the render budget value, which limits the number of loaded/created graphics resources during a frame according to loading/creation time.Arguments
- float budget - The budget value in seconds. The default value is 1/60.
void engine.render.setCameraEffectsThreshold (float threshold)
Updates the threshold, which is used to detect if an object should be blurred in the HDR mode.Arguments
- float threshold - HDR threshold. If a negative value is provided, 0 will be used instead.
void engine.render.setCameraOffset (vec3 offset)
Sets an offset vector for the camera.Arguments
- vec3 offset - Offset of the camera, X, Y and Z axes.
void engine.render.setCameraThreshold (float threshold)
Sets a camera threshold value.Arguments
- float threshold - Camera threshold value.
void engine.render.setClutterDistance (float distance)
Updates the distance, at which (and farther) objects with "clutter" flag on will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setColorBrightness (float brightness)
Updates the current brightness of the scene.Arguments
- float brightness - Brightness. The provided value is saturated in the range [-1; 1].
void engine.render.setColorContrast (float contrast)
Updates the current contrast of the scene.Arguments
- float contrast - Contrast. The provided value is saturated in the range [-1; 1].
void engine.render.setColorGamma (float gamma)
Updates the current gamma of the scene.Arguments
- float gamma - Gamma. The provided value is saturated in the range [0.5; 1.5].
void engine.render.setColorSaturation (float saturation)
Updates the current saturation of the scene.Arguments
- float saturation - Saturation. The provided value is saturated in the range [0; 2].
int engine.render.setColorTextureImage (Image image)
Sets a new color transformation image (LUT). This function resets a LUT texture name to null if it has been previously set via setColorTextureName().Arguments
- Image image - Color transformation image.
Return value
1 if the image is set successfully; otherwise, 0.int engine.render.setColorTextureName (string filename)
Sets the name of a new color transformation texture (LUT).Arguments
- string filename - Name of the file with the texture. If NULL (0) is passed, the texture is cleared.
Return value
1 if the texture is set or cleared successfully; otherwise, 0.void engine.render.setColorWhite (vec4 white)
Updates the current white balance of the scene.Arguments
- vec4 white - White balance. The provided value is saturated in the range [vec4_epsilon;vec4_one].
void engine.render.setCompositeMaterial (string material)
Sets a custom composite material that specifies a custom shader used for the final composition of the full-screen image instead of the default one.Arguments
- string material - Composite material name.
void engine.render.setCrossAngle (float angle)
Updates the angle between flare shafts of a cross flare.Arguments
- float angle - Angle in degrees.
void engine.render.setCrossColor (vec4 color)
Updates the color of a cross flares.Arguments
- vec4 color - Color of cross flares.
void engine.render.setCrossEnabled (int mode)
Enables or disables cross flares.Arguments
- int mode - Positive integer to enable cross flares, 0 to disable.
void engine.render.setCrossLength (float length)
Updates the length of a cross flare.Arguments
- float length - Length of a cross flare relative to the screen width. The provided value is saturated in the range [0; 1].
void engine.render.setCrossScale (float scale)
Sets the multiplier for color of HDR cross flares.Arguments
- float scale - Cross color scale. If a negative value is provided, 0 will be used instead.
void engine.render.setCrossShafts (int amount)
Updates the number of cross flares.Arguments
- int amount - The number of a cross flares. The provided value is saturated in the range [2; 32].
void engine.render.setCrossThreshold (float threshold)
Returns the brightness threshold for cross flares.Arguments
- float threshold - Cross flares threshold.
void engine.render.setDOFFarBlurPower (float power)
Updates the depth of field power that controls the rate with which objects become blurred across the far blur range.Arguments
- float power - Blurring power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFFarBlurRadius (float radius)
Updates the the blur factor used for out-of-focus objects across the far blur range.Arguments
- float radius - Far blur factor. (It is calculated as a number of pixels relative to the resolution of 720p.) If a negative value is provided, 0 will be used instead.
void engine.render.setDOFFarBlurRange (float range)
Updates the range from the focal point and away from the camera, within which objects are unfocused from. To the end of this distance, objects are blurred according to the blur radius.Arguments
- float range - Defocusing from objects distance (in units). If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFFarFocalPower (float power)
Updates the focal power that controls the smoothness of transition between in-focus and blurred areas (both the rate and intensity with which objects become blurred) across the far blur range.Arguments
- float power - Focal power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFFarFocalRange (float range)
Sets an area from the focal point and further away from the camera for objects in crisp focus (not blurred).Arguments
- float range - Far focal range in units. If a negative value is provided, 0 will be used instead.
void engine.render.setDOFFarFocalScale (float scale)
Shifts the far blur range closer to the camera. (This is an interpolation coefficient between a non-blurred screen image and a blurred one.)Arguments
- float scale - Far scale. The higher the value, the less is the far blur range and the closer to the camera the blurring starts. The value can be >=1.
void engine.render.setDOFFocalDistance (float distance)
Updates the focal distance of the camera (in units), i.e. a point where objects are in-focus and clear. Used as a reference point to set the near and far blur range.Arguments
- float distance - Focal distance in units. If a negative value is provided, 0 will be used instead.
void engine.render.setDOFNearBlurPower (float power)
Updates the depth of field power that controls the rate with which objects become blurred across the near blur range.Arguments
- float power - Blurring power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFNearBlurRadius (float radius)
Updates the the blur factor used for out-of-focus objects across the near blur range.Arguments
- float radius - Near blur factor. (It is calculated as a number of pixels relative to the resolution of 720p.) If a negative value is provided, 0 will be used instead.
void engine.render.setDOFNearBlurRange (float range)
Updates the range from the focal point towards the camera, within which objects are focused on (become clear). At the beginning of this distance, objects are blurred according to the blur radius.Arguments
- float range - Distance (in units) for focusing on objects. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFNearFocalPower (float power)
Updates the focal power that controls the smoothness of transition between in-focus and blurred areas (both the rate and intensity with which objects become blurred) across the near blur range.Arguments
- float power - Focal power. If a too small or a negative value is provided, 1E-6 will be used instead.
void engine.render.setDOFNearFocalRange (float range)
Sets an area from the camera to the focal point for objects in crisp focus (not blurred).Arguments
- float range - Near focal range in units. If a negative value is provided, 0 will be used instead.
void engine.render.setDOFNearFocalScale (float scale)
Shifts the near blur range further from the camera. (This is an interpolation coefficient between a non-blurred screen image and a blurred one.)Arguments
- float scale - Near scale. The higher the value, the wider is the near blur range and the further from the camera the blurring ends. The value can be >=1.
void engine.render.setData (string data)
Updates user data associated with the render. This string is written directly into a *.world file. Namely, into the data child tag of the render tag, for example:<world version="1.21">
<render>
<data>User data</data>
</render>
</world>
Arguments
- string data - User data. Data can contain an XML formatted string.
void engine.render.setDecalDistance (float distance)
Updates the distance, at which (and farther) decals will not be rendered.Arguments
- float distance - Distance in units.
int engine.render.setDirtTextureName (string name)
Updates the 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.Arguments
- string name - Name of the lens flares modulation texture.
Return value
1 if the texture is successfully set; otherwise, 0.void engine.render.setDistanceScale (float scale)
Updates the global distance scale for all distance parameters: shadow distance, light distance, LOD distances, etc.Arguments
- float scale - Global distance scale.
void engine.render.setEnabled (int enable)
Sets a value indicating if the loaded world should be rendered.Arguments
- int enable - Positive value to render the world, 0 not to render.
void engine.render.setEnvironmentHazeColor (int num, vec4 color)
Sets the color of the haze for the given preset. This function will take effect only if the RENDER_HAZE_SOLID mode is used.Arguments
- int num - Preset number.
- vec4 color - Haze color.
void engine.render.setEnvironmentHazeDensity (int num, float haze_density)
Sets the density of the haze for the given preset.Arguments
- int num - Preset number.
- float haze_density - Haze density.
void engine.render.setEnvironmentHazeMaxDistance (int num, float haze_max_distance)
Sets the distance at which the haze appears for the given preset.Arguments
- int num - Preset number.
- float haze_max_distance - Haze maximum visibility distance.
void engine.render.setEnvironmentHazeMode (int mode)
Sets the mode for the haze effect.Arguments
- int mode - One of the RENDER_HAZE_* variables.
void engine.render.setEnvironmentPresetIntensity (int num, float intensity)
Sets the intensity of the given preset.Arguments
- int num - Preset number.
- float intensity - Intensity of the preset.
void engine.render.setEnvironmentScatteringBaseLUTName (int num, string name)
Sets the path to the base LUT texture (the texture defining the base color of the sky) for the given preset.Arguments
- int num - Preset number.
- string name - Path to the texture.
void engine.render.setEnvironmentScatteringGroundColor (int num, vec4 color)
Sets the color set for the imitated landscape (ground) for the given preset.Arguments
- int num - Preset number.
- vec4 color - Ground color.
void engine.render.setEnvironmentScatteringGroundLUTName (int num, string name)
Sets the path to the ground LUT texture (the texture imitating lighting and reflections from the landscape) for the given preset.Arguments
- int num - Preset number.
- string name - Path to the texture.
void engine.render.setEnvironmentScatteringLightColorLUTName (int num, string name)
Sets the path to the light color texture (the texture defining the color of the LightWorld for different times of the day) for the given preset.Arguments
- int num - Preset number.
- string name - Path to the texture.
void engine.render.setEnvironmentScatteringMieLUTName (int num, string name)
Sets the path to the Mie LUT texture (the texture for setting the Mie light) for the given preset.Arguments
- int num - Preset number.
- string name - Path to the texture.
void engine.render.setEnvironmentTextureColor (int num, vec4 color)
Sets the environment color multiplier for the given preset.Arguments
- int num - Preset number.
- vec4 color - The environment color multiplier.
void engine.render.setEnvironmentTextureName (int num, string name)
Sets the path to the cubemap defining the environment color for the given preset.Arguments
- int num - Preset number.
- string name - Path to the cubemap defining the environment color.
void engine.render.setExposureAdaptation (float period)
Updates the current period of exposure adaptation.Arguments
- float period - Period of adaptation in seconds. If a too small or even negative value is provided, 1E-6 will be used instead.
void engine.render.setExposureBright (float exposure)
Sets a coefficient for decreasing the brightness of all flares (lens, shaft ans cross ones). This function can be used in addition to overall HDR exposure.Arguments
- float exposure - Coefficient for normalizing flares brightness.
void engine.render.setExposureMaxLuminance (float luminance)
Sets the maximum luminance used for rendering of adaptive exposure effect.Arguments
- float luminance - Maximum luminance. The provided value is saturated in the range [-10; 10].
void engine.render.setExposureMinLuminance (float luminance)
Sets the minimum luminance used for rendering of adaptive exposure effect.Arguments
- float luminance - Minimum luminance. The provided value is saturated in the range [-10; 10].
void engine.render.setExposure (float exposure)
Updates the current exposure.Arguments
- float exposure - Exposure in seconds. The provided value is saturated in the range [0; 4].
void engine.render.setFXAASampleOffset (float offset)
Sets the FXAA fragment sample offset.Arguments
- float offset - FXAA fragment sample offset.
void engine.render.setFadeColor (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,1,1,1) - a fully white screen. Positive w results in additive blending.
- vec4(0.5,0.5,0.5,1) - light colors on the screen.
- 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
- 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].
void engine.render.setFieldDistance (float distance)
Sets the distance, at which (and farther) Field nodes will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setFilmicLinearAngle (float angle)
Sets the Linear Angle filmic tonemapping parameter value.Arguments
- float angle - Liner Angle value.
void engine.render.setFilmicLinearScale (float scale)
Sets the Linear Strength filmic tonemapping parameter value.Arguments
- float scale - Linear Strength value.
void engine.render.setFilmicShoulderScale (float scale)
Sets the Shoulder Strength filmic tonemapping parameter value.Arguments
- float scale - Shoulder Strength value.
void engine.render.setFilmicToeDenominator (float scale)
Sets the Toe Denominator filmic tonemapping parameter value.Arguments
- float scale - Toe Denominator value.
void engine.render.setFilmicToeNumerator (float scale)
Sets the Toe Numerator filmic tonemapping parameter value.Arguments
- float scale - Toe Numerator value.
void engine.render.setFilmicToeScale (float scale)
Sets the Toe Strength filmic tonemapping parameter value.Arguments
- float scale - Toe Strength value.
void engine.render.setFilmicWhiteLevel (float scale)
Sets the Linear White Point filmic tonemapping parameter value.Arguments
- float scale - Linear White Point value.
void engine.render.setFirstFrame (int first)
Sets a value indicating if the first frame should be enabled over the current frame.Arguments
- int first - 1 to enable the first frame flag, 0 - to disable.
void engine.render.setLensColor (vec4 color)
Updates the color of a lens flares.Arguments
- vec4 color - Color of lens flares.
void engine.render.setLensDispersion (vec3 dispersion)
Sets the color displacement for red, greed and blue channels of the lens flares. Can be used to create light dispersion (chromatic aberrations).Arguments
- vec3 dispersion - Lens dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.
void engine.render.setLensEnabled (int mode)
Enables or disables lens flares.Arguments
- int mode - Positive integer to enable lens flares, 0 to disable.
void engine.render.setLensLength (float length)
Sets a length indicating if the whole radial lens flare is rendered on the screen or only a part of it. This option controls how lens flares pattern is distributed.Arguments
- float length - Length of the radial lens flare. The provided value is saturated in the range [0;1].
void engine.render.setLensRadius (float radius)
Sets a radius of the spherical lens flares on the screen.Arguments
- float radius - Radius of the spherical lens flares. The provided value is saturated in the range [0;1], where 1 is a screen-wide radius (a lens flare is not visible).
void engine.render.setLensScale (float scale)
Sets the multiplier for color of HDR lens flares.Arguments
- float scale - Lens color scale. If a negative value is provided, 0 will be used instead.
void engine.render.setLensThreshold (float threshold)
Updates the brightness threshold for lens flares.Arguments
- float threshold - Lens flares threshold.
void engine.render.setLightDistance (float distance)
Updates the distance, at which (and farther) dynamic lights will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setMotionBlurDepthFalloff (float depth)
Sets motion blur falloff dependeing on depth.Arguments
- float depth - Depth falloff.
void engine.render.setMotionBlurMaxVelocity (float velocity)
Updates the maximum amount of motion blur for moving physical bodies.Arguments
- float velocity - Maximum scaled velocity of bodies used for the motion blur.
void engine.render.setMotionBlurVelocityScale (float scale)
Updates amount of motion blur for moving physical bodies.Arguments
- float scale - Scale of bodies' linear and angular velocities used for the motion blur. If a negative value is provided, 0 will be used instead.
void engine.render.setObjectDistance (float distance)
Updates the distance, at which (and farther) objects will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setPostMaterials (string material)
Sets post postprocess materials that are applied after all other postprocess (such as HDR, DOF, etc.) are rendered. Materials are applied in the order of listing.
They are used together with Player::setPostMaterials(), if any.
Arguments
- string material - Comma-separated list of post postprocess material names.
void engine.render.setReflectionColor (vec4 color)
Color that allows to adjust reflections of all meshes with reflective materials, i.e.:- mesh_reflection_2d_base
- mesh_reflection_cube_base
- mesh_paint_reflection_cube_base
- mesh_tessellation_reflection_2d_base
- mesh_tessellation_reflection_cube_base
- mesh_tessellation_paint_reflection_cube_base
Arguments
- vec4 color - Reflection color for reflective mesh materials.
void engine.render.setReflectionDistance (float distance)
Updates the distance, at which (and farther) reflections will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setRefractionDispersion (vec3 dispersion)
Updates the refraction displacement for red, greed and blue channels (according to refraction texture of refractive materials). Can be used to create light dispersion (chromatic aberrations).Arguments
- vec3 dispersion - Dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.
void engine.render.setRenderMaterials (string material)
Sets render postprocess materials that are applied before all other postprocess (such as HDR, DOF, etc.) are rendered. Materials are applied in the order of listing.Arguments
- string material - List of comma-separated postprocess material names.
void engine.render.setSSAOBlur (float blur)
Sets SSAO blurArguments
- float blur - SSAO blur value.
void engine.render.setSSAOCavityScale (float intensity)
Sets the SSAO cavity scaleArguments
- float intensity - Cavity intensity
void engine.render.setSSAORadius (float radius)
Sets a radius of ambient occlusion.Arguments
- float radius - Radius of ambient occlusion shadowing.
void engine.render.setSSAOScale (float scale)
Sets a multiplier for ambient occlusion shadows.Arguments
- float scale - Scale of ambient occlusion shadowing. The provided value is saturated in the range [0;1].
void engine.render.setShaderDefines (string defines)
Sets an additional shader defines.Arguments
- string defines - Additional shader defines.
void engine.render.setShadowDistance (float distance)
Updates the distance, at which (and farther) shadows will not be rendered.Arguments
- float distance - Distance in units.
void engine.render.setShadowShaftsAttenuation (float value)
Sets the power of fading for volumetric shadows across their length.Arguments
- float value - Fading power. The provided value is clamped to range [0;1].
void engine.render.setShadowShaftsExposure (float exposure)
Sets the contrast used for volumetric shadows.Arguments
- float exposure - Shadow contrast. The provided value will be saturated in the range [0; 1]. 0 means that the shadows are not seen at all.
void engine.render.setShadowShaftsLength (float length)
Sets the length of volumetric shadows.Arguments
- float length - Shadow length. The provided value will be saturated in the range [0; 1]. 0 means that there are no shadows. 0 means that the shadows are long enough to occupy the whole screen.
void engine.render.setSharpenIntensity (float intensity)
Sets intensity of the sharpening effect.Arguments
- float intensity - Intensity of the sharpening effect.
void engine.render.setStereoDistance (float distance)
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
- float distance - Focal distance in units.
void engine.render.setStereoOffset (float offset)
Updates the virtual camera offset (an offset after the perspective projection).Arguments
- float offset - Virtual camera offset in units.
void engine.render.setStereoRadius (float radius)
Updates the radius for stereo (the half of the separation distance between the cameras).Arguments
- float radius - Stereo radius in units. If a negative value is provided, 0 will be used instead.
void engine.render.setSunShaftsAttenuation (float value)
Sets the power of fading for HDR shaft flare across its length.Arguments
- float value - Fading power. The provided value is clamped to range [0;1].
void engine.render.setSunShaftsColor (vec4 color)
Updates the color of the lens shafts.Arguments
- vec4 color - Color of lens shafts.
void engine.render.setSunShaftsEnabled (int enable)
Enables or disables lens shafts.Arguments
- int enable - Positive integer to enable lens shafts, 0 to disable.
void engine.render.setSunShaftsLength (float length)
Updates the length of flare shafts.Arguments
- float length - Length of flare shafts relative to the screen width. The provided value is saturated in the range [0; 1].
void engine.render.setSunShaftsScale (float scale)
Sets the multiplier for color of HDR shaft flares.Arguments
- float scale - Shaft color scale. If a negative value is provided, 0 will be used instead.
void engine.render.setSunShaftsThreshold (float threshold)
Updates the brightness threshold for flare shafts.Arguments
- float threshold - Flare shafts threshold.
void engine.render.setTessellationDistance (float distance)
Sets the multiplier for the corresponding material parameter. Tessellation distance sets the distance after which the surfaces are not tessellated.Arguments
- float distance - Tessellation distance multiplier. If a negative value is provided, 0 will be used instead.
void engine.render.setTessellationFactor (float factor)
Sets the multiplier for the corresponding material parameter. Tessellation factor that controls subdivision of triangles into smaller ones.Arguments
- float factor - Tessellation factor multiplier. If a negative value is provided, 0 will be used instead.
void engine.render.setTessellationScale (float scale)
Sets the multiplier for the corresponding material parameter. Tessellation scale determines displacement factor for tessellated surfaces (to what extent geometry is extruded).Arguments
- float scale - Tessellation scale multiplier. If a negative value is provided, 0 will be used instead.
void engine.render.setWireframeColor (vec4 color)
Sets the color fot the wireframe.Arguments
- vec4 color - Wireframe color to be set.