This page has been translated automatically.
Programming
Fundamentals
Setting Up Development Environment
UnigineScript
High-Level Systems
C++
C#
UUSL (Unified UNIGINE Shader Language)
File Formats
Rebuilding the Engine and Tools
GUI
Double Precision Coordinates
API
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

Unigine::Render Class

Header:#include <UnigineRender.h>

Provides access to Unigine rendering functions. For example, it is used by AppWall application to render onto multiple monitors.

Render Class

Members


Render * get()

Returns a pointer to the existing render.

Return value

Pointer to the existing render.

int getAlphaFade()

Returns a value indicating if alpha fading between object LODs is enabled.

Return value

1 if alpha fading is enabled; otherwise, 0.

void setAnimationLeaf(float leaf)

Updates the global scale for rotation angle of vegetation leaves.

Arguments

  • float leaf - Global leaf rotation angle. If a negative value is provided, 0 will be used instead.

float getAnimationLeaf()

Returns the current scale for rotation angle of vegetation leaves.

Return value

Global leaf rotation angle.

void setAnimationScale(float scale)

Updates the global scale for rotation speed of vegetation leaves.

Arguments

  • float scale - Global leaf rotation speed.

float getAnimationScale()

Returns the current global scale for rotation speed of vegetation leaves.

Return value

Global leaf rotation speed.

void setAnimationStem(float stem)

Updates the global scale for movement amplitude of vegetation stems.

Arguments

  • float stem - Global stem amplitude scale. If a negative value is provided, 0 will be used instead.

float getAnimationStem()

Returns the current global scale for movement amplitude of vegetation stems.

Return value

Global stem amplitude scale.

void setAnimationTime(float time)

Updates the render animation time for vegetation.

Arguments

  • float time - Animation time in milliseconds.

float getAnimationTime()

Returns the render animation time for vegetation.

Return value

Animation time in milliseconds.

void setAnimationWind(const Math::vec3 & wind)

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

  • const Math::vec3 & wind - Offset for vegetation under wind by X, Y and Z axes.

Math::vec3 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 getAntialiasing()

Returns the type of enabled anti-aliasing. This method can be used to check the anti-aliasing type before calling get/setFXAAIntensity() function.

Return value

The type of antialiasing:
  • 0 - no antialliasing used
  • 1 - FXAA
  • 2 - TAA

int getAPI()

Returns the current Graphics API, or API_UNKNOWN if API cannot be identified.

Return value

The Graphics API flag (see API_* variables).

int getAuxiliary()

Returns a value indicating if auxiliary buffer is used.

Return value

1 if auxiliary buffer is used; otherwise, 0.

void setBackgroundColor(const Math::vec4 & color)

Sets the background color by using given vector.

Arguments

  • const Math::vec4 & color - A background color vector.

const Math::vec4 & getBackgroundColor()

Returns the background color vector.

Return value

A background color vector.

Ptr<Texture> getBlack2DTexture()

Return black 2D texture.

Return value

Black 2D texture.

Ptr<Texture> getBlackCubeTexture()

Return black Cube texture.

Return value

Black Cube texture.

void 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.

int isBloomEnabled()

Returns a value indicating if the bloom effect is enabled.

Return value

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

void setBloomPower(float power)

Arguments

  • float power

float getBloomPower()

void setBloomScale(float scale)

Arguments

  • float scale

float getBloomScale()

void setBudget(float budget)

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

Arguments

  • float budget - The budget value in seconds.

float getBudget()

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

Return value

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

void 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.

float getCameraEffectsThreshold()

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

Return value

HDR threshold.

void 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.

float getClutterDistance()

Returns a distance, at which (and farther) objects with "clutter" flag on will not be rendered.

Return value

Distance in units.

void setColorBrightness(float brightness)

Updates the current brightness of the scene.

Arguments

  • float brightness - Brightness. The provided value is saturated in the range [-1; 1].

float getColorBrightness()

Returns the current overall brightness of the scene.

Return value

Current brightness.

void setColorContrast(float contrast)

Updates the current contrast of the scene.

Arguments

  • float contrast - Contrast. The provided value is saturated in the range [-1; 1].

float getColorContrast()

Returns the current overall contrast of the scene.

Return value

Current contrast.

void 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].

float getColorGamma()

Returns the current overall gamma of the scene.

Return value

Current gamma.

void setColorSaturation(float saturation)

Updates the current saturation of the scene.

Arguments

  • float saturation - Saturation. The provided value is saturated in the range [0; 2].

float getColorSaturation()

Returns the current overall saturation of the scene.

Return value

Current saturation.

int setColorTextureImage(const Ptr<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

  • const Ptr<Image> & image - Color transformation image.

Return value

1 if the image is set successfully; otherwise, 0.

int getColorTextureImage(const Ptr<Image> & image)

Return the current color transformation image (LUT).

Arguments

  • const Ptr<Image> & image - Image to store the color transformation texture in.

Return value

1 if an image is successfully received; otherwise, 0.

void setColorTextureName(const char * name)

Sets the name of a new color transformation texture (LUT).

Arguments

  • const char * name - Name of the file with the texture. If NULL (0) is passed, the texture is cleared.

const char * getColorTextureName()

Returns the name of the current color transformation texture (LUT).

Return value

Name of the current color transformation texture.

void setColorWhite(const Math::vec4 & white)

Updates the current white balance of the scene.

Arguments

  • const Math::vec4 & white - White balance. The provided value is saturated in the range [vec4_epsilon;vec4_one].

Math::vec4 getColorWhite()

Returns the current white balance of the scene.

Return value

Current white balance.

void setCompositeMaterial(const char * 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

  • const char * material - Name of the composite material.

const char * 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.

int getComputeShader()

Checks if the compute shaders available.

Return value

1 if compute shaders are available; otherwise, 0.

void setCrossAngle(float angle)

Updates the angle between flare shafts of a cross flare.

Arguments

  • float angle - Angle in degrees.

float getCrossAngle()

Returns the angle between flare shafts of a cross flare.

Return value

Angle between flare shafts in degrees.

void setCrossColor(const Math::vec4 & color)

Updates the color of a cross flares.

Arguments

  • const Math::vec4 & color - Color of cross flares.

Math::vec4 getCrossColor()

Returns the color of a cross flare.

Return value

Color of a cross flare.

void setCrossEnabled(int mode)

Enables or disables cross flares.

Arguments

  • int mode - Positive integer to enable cross flares, 0 to disable.

int isCrossEnabled()

Returns a value indicating if cross flares are enabled.

Return value

Positive integer if cross flares are enabled; otherwise, 0.

void 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].

float getCrossLength()

Returns the length of a cross flare.

Return value

Length of a cross flare relative to the screen width.

void 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.

float getCrossScale()

Returns the current multiplier for color of HDR cross flares.

Return value

Cross color scale.

void setCrossShafts(int shafts)

Updates the number of cross flares.

Arguments

  • int shafts - The number of a cross flares. The provided value is saturated in the range [2; 32].

int getCrossShafts()

Returns the number of cross flares.

Return value

Number of cross flares.

void setCrossThreshold(float threshold)

Returns the brightness threshold for cross flares.

Arguments

  • float threshold - Cross flares threshold.

float getCrossThreshold()

Returns the current brightness threshold for cross flares.

Return value

Cross flares threshold.

void setData(const char * data)

Sets user data associated with the world. In the *.world file, the data is set in the data tag.

Arguments

  • const char * data - New user data.

const char * getData()

Returns user string data associated with the world. This string is written directly into the data tag of the *.world file.

Return value

User string data.

void setDecalDistance(float distance)

Updates the distance, at which (and farther) decals will not be rendered.

Arguments

  • float distance - Distance in units.

float getDecalDistance()

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

Return value

Distance in units.

int isDepthZeroToOne()

void setDirtScale(float scale)

Arguments

  • float scale

float getDirtScale()

void setDirtTextureName(const char * 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

  • 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.

Return value

Name of the lens flares modulation texture.

void 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.

float getDistanceScale()

Returns the current global distance scale for all distance parameters: shadow distance, world lights shadows, LOD distances, etc.

Return value

Global distance scale.

int getDOF()

Returns a value indicating if depth of field is enabled.

Return value

1 if depth of field is enabled; otherwise, 0.

void setDOFBlur(float blur)

Arguments

  • float blur

float getDOFBlur()

void setDOFChromaticAberration(float aberration)

Arguments

  • float aberration

float getDOFChromaticAberration()

void setDOFFarDistance(float distance)

Arguments

  • float distance

float getDOFFarDistance()

void setDOFFarFocalOffset(float offset)

Arguments

  • float offset

float getDOFFarFocalOffset()

void setDOFFocalDistance(float distance)

Updates the focal distance of the camera (in units), i.e. a point where objects are in-focus and clear.

Arguments

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

float getDOFFocalDistance()

Returns a distance to objects in focus.

Return value

Distance to the camera focus in units.

void setDOFNearDistance(float distance)

Arguments

  • float distance

float getDOFNearDistance()

void setDOFNearFocalOffset(float offset)

Arguments

  • float offset

float getDOFNearFocalOffset()

void setEnabled(int arg1)

Enable or disable the render.

Arguments

  • int arg1 - 1 to enable the render, 0 to disable it.

int isEnabled()

Return a value indicating if the render is enabled.

Return value

Return 1 if the render is enabled; otherwise, 0 is returned.

void setEnvironmentAmbientIntensity(int num, float intensity)

Sets the intensity value of the environment ambient lighting for given preset. 0 value means no environment ambient lighting for given preset.

Arguments

  • int num - The number of preset.
  • float intensity - Intensity value of the environment ambient lighting for given preset.

float getEnvironmentAmbientIntensity(int num = -1)

Returns the intensity value of the environment ambient lighting for given preset.

Arguments

  • int num - The number of preset.

Return value

The intensity value of environment ambient lighting preset.

void setEnvironmentHazeColor(int num, const Math::vec4 & arg2)

Sets the color of the haze for the given preset. This function will take effect only if the HAZE_SOLID mode is used.

Arguments

  • int num - Preset number.
  • const Math::vec4 & arg2 - Haze color.

Math::vec4 getEnvironmentHazeColor(int num = -1)

Returns the current haze color set for the given preset.
Notice
This function will return color only if the HAZE_SOLID mode is used.

Arguments

  • int num - Preset number.

Return value

Haze color.

void setEnvironmentHazeDensity(int num, float arg2)

Sets the density of the haze for the given preset.

Arguments

  • int num - Preset number.
  • float arg2 - Haze density.

float getEnvironmentHazeDensity(int num)

Returns the current haze density set for the given preset.

Arguments

  • int num - Preset number.

Return value

Haze density.

void setEnvironmentHazeMaxDistance(int num, float arg2)

Sets the distance at which the haze appears for the given preset.

Arguments

  • int num - Preset number.
  • float arg2 - Haze maximum visibility distance.

float 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.

void setEnvironmentHazeMode(int mode)

Sets the mode for the haze effect.

Arguments

int getEnvironmentHazeMode()

Returns the current mode set for the haze effect.

Return value

One of the RENDER_HAZE_*variables.

void setEnvironmentPresetIntensity(int num, float arg2)

Sets the intensity of the given preset.

Arguments

  • int num - Preset number.
  • float arg2 - Intensity of the preset.

float getEnvironmentPresetIntensity(int num)

Returns the intensity of the given preset.

Arguments

  • int num - Preset number.

Return value

Intensity of the preset.

void setEnvironmentReflectionIntensity(int num, float intensity)

Sets the intensity value of the environment reflection for given preset. 0 value means no environment reflection for given preset.

Arguments

  • int num - The number of preset.
  • float intensity - Intensity value of the environment reflection for given preset.

float getEnvironmentReflectionIntensity(int num = -1)

Returns the intensity value of the environment reflection for given preset.

Arguments

  • int num - The number of preset.

Return value

The intensity value of environment reflection preset.

void setEnvironmentScatteringBaseLUTName(int num, const char * arg2)

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.
  • const char * arg2 - Path to the texture.

const char * 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.

void setEnvironmentScatteringGroundColor(int num, const Math::vec4 & arg2)

Sets the color set for the imitated landscape (ground) for the given preset.

Arguments

  • int num - Preset number.
  • const Math::vec4 & arg2 - Ground color.

Math::vec4 getEnvironmentScatteringGroundColor(int num)

Returns the current color set for the imitated landscape (ground).

Arguments

  • int num - Preset number.

Return value

Ground color.

void setEnvironmentScatteringGroundLUTName(int num, const char * arg2)

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.
  • const char * arg2 - Path to the texture.

const char * 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.

void setEnvironmentScatteringLightColorLUTName(int num, const char * arg2)

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.
  • const char * arg2 - Path to the texture.

const char * 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.

void setEnvironmentScatteringMieLUTName(int num, const char * arg2)

Sets the path to the Mie LUT texture (the texture for setting the Mie light) for the given preset.

Arguments

  • int num - Preset number.
  • const char * arg2 - Path to the texture.

const char * 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.

void setEnvironmentSkyIntensity(int num, float intensity)

Sets the intensity value of the environment sky for given preset. 0 value means no environment sky for given preset.

Arguments

  • int num - The number of preset.
  • float intensity - Intensity value of the environment sky for given preset.

float getEnvironmentSkyIntensity(int num = -1)

Returns the intensity value of the environment sky for given preset.

Arguments

  • int num - The number of preset.

Return value

Intensity value of the sky for given preset.

void setEnvironmentTextureColor(int num, const Math::vec4 & arg2)

Sets the environment color multiplier for the given preset.

Arguments

  • int num - Preset number.
  • const Math::vec4 & arg2 - The environment color multiplier.

Math::vec4 getEnvironmentTextureColor(int num)

Returns the environment color multiplier set for the given preset.

Arguments

  • int num - Preset number.

Return value

The environment color multiplier.

void setEnvironmentTextureName(int num, const char * arg2)

Sets the path to the cubemap defining the environment color for the given preset.

Arguments

  • int num - Preset number.
  • const char * arg2 - Path to the cubemap defining the environment color.

const char * 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.

void setExposure(float exposure)

Updates the current exposure.

Arguments

  • float exposure - Exposure in seconds. The provided value is saturated in the range [0; 4].

float getExposure()

Returns the current exposure.

Return value

Current exposure in seconds.

void setExposureAdaptation(float adaptation)

Updates the current period of exposure adaptation.

Arguments

  • float adaptation - Period of adaptation in seconds. If a too small or even negative value is provided, 1E-6 will be used instead.

float getExposureAdaptation()

Returns the current period of exposure adaptation.

Return value

Period of exposure adaptation in seconds.

void 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].

float getExposureMaxLuminance()

Returns the maximum luminance used for HDR rendering.

Return value

Maximum luminance.

void 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].

float getExposureMinLuminance()

Returns the minimum luminance used for HDR rendering.

Return value

Minimum luminance.

void setExposureMode(int mode)

Sets the mode of the adaptive exposure effect..

Arguments

  • int mode - The value indicating the exposure mode:
    • 0 - disabled.
    • 1 - logarithmic adaptive exposure.
    • 2 - quadratic adaptive exposure.

int 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.

void setFadeColor(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,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

  • 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::vec4 getFadeColor()

Returns the current fade color of the scene.

Return value

The current fade color.

void setFieldDistance(float distance)

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

Arguments

  • float distance - Distance in units.

float getFieldDistance()

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

Return value

Distance in units.

void setFilmicLinearAngle(float angle)

Sets the Linear Angle filmic tonemapping parameter value.

Arguments

  • float angle - Liner Angle value.

float getFilmicLinearAngle()

Returns the current Linear Angle filmic tone mapping parameter value.

Return value

Liner Angle value.

void setFilmicLinearScale(float scale)

Sets the Linear Strength filmic tonemapping parameter value.

Arguments

  • float scale - Linear Strength value.

float getFilmicLinearScale()

Returns the current Linear Strength filmic tone mapping parameter value.

Return value

Linear Strength value.

void setFilmicShoulderScale(float scale)

Sets the Shoulder Strength filmic tonemapping parameter value.

Arguments

  • float scale - Shoulder Strength value.

float getFilmicShoulderScale()

Returns the current Shoulder Strength filmic tonemapping parameter value.

Return value

Shoulder Strength value.

void setFilmicToeDenominator(float denominator)

Sets the Toe Denominator filmic tonemapping parameter value.

Arguments

  • float denominator - Toe Denominator value.

float getFilmicToeDenominator()

Returns the current Toe Denominator filmic tonemapping parameter value.

Return value

Toe Denominator value.

void setFilmicToeNumerator(float numerator)

Sets the Toe Numerator filmic tonemapping parameter value.

Arguments

  • float numerator - Toe Numerator value.

float getFilmicToeNumerator()

Sets the Toe Numerator filmic tonemapping parameter value.

Return value

Toe Numerator value.

void setFilmicToeScale(float scale)

Sets the Toe Strength filmic tonemapping parameter value.

Arguments

  • float scale - Toe Strength value.

float getFilmicToeScale()

Returns the current Toe Strength filmic tonemapping parameter value.

Return value

Toe Strength value.

void setFilmicWhiteLevel(float level)

Sets the Linear White Point filmic tonemapping parameter value.

Arguments

  • float level - Linear White Point value.

float getFilmicWhiteLevel()

Returns the current Linear White Point filmic tonemapping parameter value.

Return value

Linear White Point value.

void setFirstFrame(int frame)

The first frame flag.

Arguments

  • int frame - The first frame flag.

int isFirstFrame()

Return the first frame flag.

Return value

Return the first frame flag.

int isFlipped()

Checks if the render orientation.

Return value

1 if the render is flipped; otherwise, 0.

void setFXAAIntensity(float intensity)

Sets the intensity of the FXAA. Intensity specifies the sample offset of FXAA fragment.

Arguments

  • float intensity - Intensity value of the FXAA to be set.

float getFXAAIntensity()

Returns the intensity value of the FXAA. Intensity specifies the sample offset of FXAA fragment.

Return value

Intensity value of the FXAA

int getGeometryShader()

Returns a value indicating if geometry shader is used.

Return value

1 if geometry shader is used; otherwise, 0.

int getGPUMemory()

Returns an amount of memory provided by the current GPU.

Return value

Amount of memory in Mbytes.

int getGPUName()

Returns the name of the current GPU.

Return value

GPU name flag.

Ptr<Texture> getGray2DTexture()

Return gray 2D texture.

Return value

Gray 2D texture.

Ptr<Texture> getGrayCubeTexture()

Return gray Cube texture.

Return value

Gray Cube texture.

void setLensColor(const Math::vec4 & color)

Updates the color of a lens flares.

Arguments

  • const Math::vec4 & color - Color of lens flares.

Math::vec4 getLensColor()

Returns the color of a lens flare.

Return value

Color of a lens flare.

void setLensDispersion(const Math::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

  • const Math::vec3 & dispersion - Lens dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.

Math::vec3 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.

void setLensEnabled(int mode)

Enables or disables lens flares.

Arguments

  • int mode - Positive integer to enable lens flares, 0 to disable.

int isLensEnabled()

Returns a value indicating if lens flares are enabled.

Return value

Positive integer if lens flares are enabled; otherwise, 0.

void 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].

float 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.

void 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).

float getLensRadius()

Returns the current radius of the spherical lens flares on the screen.

Return value

Radius of the spherical lens flares.

void 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.

float getLensScale()

Returns the current multiplier for color of HDR lens flares.

Return value

Lens color scale.

void setLensThreshold(float threshold)

Updates the brightness threshold for lens flares.

Arguments

  • float threshold - Lens flares threshold.

float getLensThreshold()

Returns the current brightness threshold for lens flares.

Return value

Lens flares threshold.

void setLightDistance(float distance)

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

Arguments

  • float distance - Distance in units.

float getLightDistance()

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

Return value

Distance in units.

int getMotionBlur()

Returns a value indicating if motion blur is enabled.

Return value

1 if motion blur is enabled; otherwise, 0.

void setMotionBlurDepthFalloff(float falloff)

Sets motion blur falloff dependeing on depth.

Arguments

  • float falloff - Depth falloff.

float getMotionBlurDepthFalloff()

Returns the motion blur falloff depending on depth.

Return value

Depth falloff

void 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.

float 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.

void 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.

float 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 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 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 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 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 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 getNumProcedurals()

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

Return value

The number of procedurals.

int 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 getNumShaders()

Returns the number of shaders set per frame. See Rendering Profiler article for details.

Return value

The number of shaders.

int getNumShadows()

Returns the number of shadow passes rendered per frame. See Rendering Profiler article for details.

Return value

The number of shadow passes.

int 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 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.

void setObjectDistance(float distance)

Updates the distance, at which (and farther) objects will not be rendered.

Arguments

  • float distance - Distance in units.

float getObjectDistance()

Returns a distance, at which (and farther) objects will not be rendered.

Return value

Distance in units.

int getParallax()

Returns a value indicating if parallax occlusion mapping is enabled.

Return value

1 if parallax occlusion mapping is enabled; otherwise, 0.

void setPostMaterials(const char * materials)

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

  • const char * materials - List of comma-separated post postprocess material names.

const char * 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

Names of the current post postprocess materials.

void setReflectionColor(const Math::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
and reflective tessellation materials:
  • mesh_tessellation_reflection_2d_base
  • mesh_tessellation_reflection_cube_base
  • mesh_tessellation_paint_reflection_cube_base

Arguments

  • const Math::vec4 & color - Reflection color for reflective mesh materials.

Math::vec4 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
and reflective tessellation materials:
  • mesh_tessellation_reflection_2d_base
  • mesh_tessellation_reflection_cube_base
  • mesh_tessellation_paint_reflection_cube_base

Return value

Reflection color for reflective mesh materials.

void setReflectionDistance(float distance)

Updates the distance, at which (and farther) reflections will not be rendered.

Arguments

  • float distance - Distance in units.

float getReflectionDistance()

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

Return value

Distance in units.

int getRefraction()

Returns a value indicating if refraction is enabled.

Return value

1 if refraction is enabled; otherwise, 0.

void setRefractionDispersion(const Math::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

  • const Math::vec3 & dispersion - Dispersion displacement per channel. If a negative value is set for a channel, 0 will be used instead.

Math::vec3 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.

void setRenderMaterials(const char * materials)

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

  • const char * materials - List of comma-separated postprocess material names.

const char * 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

Names of the current render materials.

void setShaderDefines(const char * defines)

Set additional shader defines.

Arguments

  • const char * defines - Additional shader defines.

const char * getShaderDefines()

Return additional shader defines.

Return value

Additional shader defines.

int getShadersQuality()

Returns the quality of shaders.

Return value

One of the RENDER_QUALITY_* pre-defined variables.

void setShadowDistance(float distance)

Updates the distance, at which (and farther) shadows will not be rendered.

Arguments

  • float distance - Distance in units.

float getShadowDistance()

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

Return value

Distance in units.

int getShadowShafts()

Returns a value indicating if volumetric shadows are enabled.

Return value

1 if volumetric shadows are enabled; otherwise, 0.

void 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.

float getShadowShaftsExposure()

Returns the contrast used for volumetric shadows.

Return value

Shadow contrast.

void 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.

float getShadowShaftsLength()

Returns the length of volumetric shadows.

Return value

Shadow length.

void setSharpenIntensity(float intensity)

Sets intensity of the sharpening effect.

Arguments

  • float intensity - Intensity of the sharpening effect.

float getSharpenIntensity()

Returns intensity of the sharpening effect.

Return value

Intensity of the sharpening effect.

void setSkyRotation(const Math::quat & rotation)

Arguments

  • const Math::quat & rotation

Math::quat getSkyRotation()

void setSSAOIntensity(float intensity)

Sets the intensity of the SSAO (screen-space ambient occlusion) for the scene.

Arguments

  • float intensity - Intensity value of the SSAO (screen-space ambient occlusion) for the scene.

float getSSAOIntensity()

Returns the intensity of the SSAO (screen-space ambient occlusion) for the scene.

Return value

Intensity value of the SSAO (screen-space ambient occlusion).

void setSSAOIntensityLightedSide(float intensity)

Sets the intensity of the SSAO (screen-space ambient occlusion) for the scene object's lighted side.

Arguments

  • float intensity - Intensity value of the SSAO (screen-space ambient occlusion) for the scene object's lighted side.

float getSSAOIntensityLightedSide()

Returns the intensity of the SSAO (screen-space ambient occlusion) for the scene objects' lighted side.

Return value

Intensity value of the SSAO (screen-space ambient occlusion).

void setSSAORadius(float radius)

Sets a radius of ambient occlusion.

Arguments

  • float radius - Radius of ambient occlusion shadowing.

float getSSAORadius()

Returns the radius of ambient occlusion.

Return value

Radius of ambient occlusion shadowing.

void setSSRDepthThreshold(int threshold)

Enables or disables the depth threshold for screen space reflections. The depth threshold limits blur of screen space reflections (calculation of SSR roughness) by depth.

Arguments

  • int threshold - A flag. 1 value enables SSR depth threshold, 0 value disables.

int isSSRDepthThreshold()

Returns the value indicating if the depth threshold is enabled for screen space reflections. The depth threshold limits blur of screen space reflections (calculation of SSR roughness) by depth.

Return value

1 if the SSR depth threshold is enabled, otherwise 0.

void setSSREnabled(int enabled)

Enables (or disables) Screen Space Reflections effect.

Arguments

  • int enabled - A flag. 1 value enables SSR effect, 0 value disables.

int isSSREnabled()

Returns the value indicating is SSR effect is enabled.

Return value

1 if the SSR effect is enabled, otherwise 0.

void setSSRFarDistanceScale(float scale)

Sets the scale for the rendering distance of the far view.

The default value is 1.

Arguments

  • float scale - Scale value within the [0;10] range.

float getSSRFarDistanceScale()

Returns the scale of the rendering distance of the far view.

The default value is 1.

Return value

Scale value within the [0;10] range.

void setSSRFarEnabled(int enabled)

Enables or disables screen space reflections calculation for the far view.

Arguments

  • int enabled - A flag. 1 value enables the SSR calculation for far view; 0 value disables.

int isSSRFarEnabled()

Returns the value indicating if screen space reflections calculation is enabled for the far view.

Return value

1 value if the SSR calculation for far view is enabled; otherwise, 0.

void setSSRFarQuality(int quality)

Sets the quality of screen space reflections rendered at the far view.

Arguments

  • int quality - One of the following values:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int getSSRFarQuality()

Returns the current quality value of screen space reflections rendered at the far view.

Return value

One of the following values:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void setSSRNearDistanceScale(float scale)

Sets the scale for the rendering distance the near view.

The default value is 1.

Arguments

  • float scale - Scale value within the [0;10] range.

float getSSRNearDistanceScale()

Returns the scale of the rendering distance of the near view.

The default value is 1.

Return value

Scale value within the [0;10] range.

void setSSRNearEnabled(int enabled)

Enables or disables screen space reflections calculation for the near view.

Arguments

  • int enabled - A flag. 1 value enables the SSR calculation for near view; 0 value disables.

int isSSRNearEnabled()

Returns the value indicating if screen space reflections calculation is enabled for the near view.

Return value

1 value if the SSR calculation for near view is enabled; otherwise, 0.

void setSSRNearQuality(int quality)

Sets the quality of screen space reflections rendered at the far view.

Arguments

  • int quality - One of the following values:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int getSSRNearQuality()

Returns the current quality value of screen space reflections rendered at the far view.

Return value

One of the following values:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void setSSRNormalThreshold(int threshold)

Enables or disables the normal threshold for screen space reflections. The normal threshold limits blur of screen space reflections (calculation of SSR roughness) by normals.

Arguments

  • int threshold - A flag. 1 value enables SSR normal threshold, 0 value disables.

int isSSRNormalThreshold()

Returns the value indicating if the normal threshold is enabled for screen space reflections. The normal threshold limits blur of screen space reflections (calculation of SSR roughness) by normals.

Return value

1 if the SSR normal threshold is enabled, otherwise 0.

void setSSRResolution(int resolution)

Sets the quality of screen space reflections.

Arguments

  • int resolution - One of the following values:
    • 0 - render reflections in quad resolution.
    • 1 - render reflections in half resolution (by default).
    • 1 - render reflections in full resolution.

int getSSRResolution()

Returns the value indicating the quality of screen space reflections.

Return value

One of the following values:
  • 0 - render reflections in quad resolution.
  • 1 - render reflections in half resolution (by default).
  • 1 - render reflections in full resolution.

void setSSRRoughnessQuality(int quality)

Sets the quality of screen space reflections roughness.

Arguments

  • int quality - One of the following values:
    • 0 - low quality.
    • 1 - medium quality (by default).
    • 2 - high quality.
    • 3 - ultra quality.

int getSSRRoughnessQuality()

Returns the current quality value of screen space reflections roughness.

Return value

One of the following values:
  • 0 - low quality.
  • 1 - medium quality (by default).
  • 2 - high quality.
  • 3 - ultra quality.

void setSSRScale(float scale)

Sets the scale of screen space reflections.

The default value is 1.

Arguments

  • float scale - SSR scale value within the [0;10] range.

float getSSRScale()

Returns the current scale value of screen space reflections.

The default value is 1.

Return value

SSR scale value within the [0;10] range.

void setSSRStretching(float stretching)

Sets the stretching factor (for information lost screen places) of screen space reflections.

The default value is 0.5f

Arguments

  • float stretching - A stretching factor within the [0;10] range.

float getSSRStretching()

Returns the current stretching factor (for information lost screen places) of screen space reflections.

The default value is 0.5f

Return value

A stretching factor within the [0;10] range.

void setSSSColor(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.

Arguments

  • const Math::vec4 & color - A subsurface scattering color.

Math::vec4 getSSSColor()

Returns the current subsurface scattering color.

Return value

A subsurface scattering color.

void setSSSRadius(float radius)

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.

Arguments

  • float radius - Subsurface scattering radius.

float getSSSRadius()

Returns the current subsurface scattering radius.

Return value

Subsurface scattering radius value.

void setStereoDistance(float distance)

Set stereo distance.

Arguments

  • float distance - Stereo distance.

float getStereoDistance()

Get stereo distance.

Return value

Stereo distance.

void setStereoOffset(float offset)

Set stereo offset.

Arguments

  • float offset - Stereo offset.

float getStereoOffset()

Get stereo offset.

Return value

Stereo offset.

void setStereoRadius(float radius)

Set stereo radius.

Arguments

  • float radius - Stereo radius.

float getStereoRadius()

Get stereo radius.

Return value

Stereo radius.

int getStructuredBuffers()

Checks, if StructuredBuffers are available.

Return value

1 if StructuredBuffers are available; otherwise, 0.

void setSunShaftsAttenuation(float attenuation)

Sets the power of fading for HDR shaft flare across its length.

Arguments

  • float attenuation - Fading power. The provided value is clamped to range [0;1].

float getSunShaftsAttenuation()

Returns the current power of fading for HDR shaft flare across its length.

Return value

Fading power.

void setSunShaftsColor(const Math::vec4 & color)

Updates the color of the lens shafts.

Arguments

  • const Math::vec4 & color - Color of lens shafts.

Math::vec4 getSunShaftsColor()

Returns the current color of the lens shafts.

Return value

Color of lens shafts.

void setSunShaftsEnabled(int enable)

Enables or disables lens shafts.

Arguments

  • int enable - Positive integer to enable lens shafts, 0 to disable.

int isSunShaftsEnabled()

Returns a value indicating if flare shafts are enabled.

Return value

Positive integer if flare shafts are enabled; otherwise, 0.

void 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].

float getSunShaftsLength()

Returns the length of a flare shaft.

Return value

Length of a flare shaft relative to the screen width.

void 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.

float getSunShaftsScale()

Returns the current multiplier for color of HDR shaft flares.

Return value

Shaft color scale.

void setSunShaftsThreshold(float threshold)

Updates the brightness threshold for flare shafts.

Arguments

  • float threshold - Flare shafts threshold.

float getSunShaftsThreshold()

Returns the current brightness threshold for flare shafts.

Return value

Flare shafts threshold.

void setTAAFrameCount(float count)

Arguments

  • float count

float getTAAFrameCount()

void setTAAMaxFrameCount(float count)

Arguments

  • float count

float getTAAMaxFrameCount()

void setTAAMinFrameCount(float count)

Arguments

  • float count

float getTAAMinFrameCount()

void setTAAPreserveDetails(float details)

Arguments

  • float details

float getTAAPreserveDetails()

void setTAAVelocityThreshold(float threshold)

Arguments

  • float threshold

float getTAAVelocityThreshold()

int getTessellation()

Returns a value indicating if tessellation is enabled.

Return value

1 if tessellation is enabled; otherwise, 0.

void 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.

float getTessellationDistance()

Returns the multiplier for the corresponding material parameter, that controls the distance after which surfaces are not tessellated.

Return value

Tessellation distance multiplier.

void 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.

float getTessellationFactor()

Returns the multiplier for the corresponding material parameter that controls subdivision of triangles into smaller ones.

Return value

Tessellation factor multiplier.

void 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.

float 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 getTexturesQuality()

Returns the quality of textures.

Return value

One of the RENDER_QUALITY_* pre-defined variables.

void setViewport(const Ptr<Viewport> & viewport)

Sets a viewport for a main application window.

Arguments

  • const Ptr<Viewport> & viewport - Pointer to Viewport.

Ptr<Viewport> getViewport()

Returns a main application window viewport.

Return value

Pointer to Viewport.

Ptr<Texture> getWhite2DTexture()

Return white 2D texture.

Return value

White 2D texture.

Ptr<Texture> getWhiteCubeTexture()

Return white Cube texture.

Return value

White Cube texture.

void setWireframeColor(const Math::vec4 & color)

Sets the color fot the wireframe.

Arguments

  • const Math::vec4 & color - Wireframe color to be set.

Math::vec4 getWireframeColor()

Returns the color of the wireframe.

Return value

Wireframe color.

int compressBCTexture(const Ptr<Texture> & texture, Ptr<Image> & destination, int quality = 1, int compressed_format = 0, int skip_mip_maps = 0)

Compresses given texture by using specified compression format.

Arguments

  • const Ptr<Texture> & texture - Source data to be compressed.
  • Ptr<Image> & destination - The result of compression.
  • int quality - 0 is for low quality (very fast), 1 is for high quality.
  • int compressed_format - One of the compressed BC format.
  • int skip_mip_maps - Ignore texture mip-maps flag. 1 is for ignoring; otherwise, 0.

Return value

1 if the compression was performed successfully; otherwise, 0.

int createMipmapsCubeGGX(const Ptr<Image> & image, float quality)

Arguments

  • const Ptr<Image> & image
  • float quality

int createShorelineDistanceField(const Ptr<Image> & image, const Ptr<Image> & mask, int shoreline_radius, int blur_radius, int downsample_resolution)

Arguments

  • const Ptr<Image> & image
  • const Ptr<Image> & mask
  • int shoreline_radius
  • int blur_radius
  • int downsample_resolution

int loadSettings(const char * file)

Loads the render settings from a given file.

Arguments

  • const char * file - Path to an xml file with desired settings.

Return value

Returns 1 if the settings are loaded successfully; otherwise, 0.

int loadWorld(const Ptr<Xml> & xml)

Loads a render state from the Xml.

Arguments

  • const Ptr<Xml> & xml - Xml smart pointer.

Return value

Returns 1 if the operation was a success; otherwise, 0 is returned.

void renderComputeMaterial(int width, int height, const Ptr<Material> & material)

Renders (dispatches) given compute material.

Usage Example

Source code (C++)
texture_render->setUnorderedAccessTexture(0, texture);
texture_render->enable(TextureRender::USAGE_COMPUTE);
render->renderComputeMaterial(width, height, material);
texture_render->disable();
texture_render->unbindUnorderedAccessTexture();

Arguments

  • int width - The number of thread groups align X axis.
  • int height - The number of thread group align Y axis.
  • const Ptr<Material> & material - A smart pointer to the material.

void renderImage2D(const Ptr<Camera> & camera, const Ptr<Image> & image, int skip_flags)

Renders the scene into a 2D image in accordance with the set parameters. The viewport position is taken from the camera created via Camera class.

Arguments

  • const Ptr<Camera> & camera - The Camera to be used.
  • const Ptr<Image> & image - The Image to save the result to.
  • int skip_flags - Skip the effects:
    • VIEWPORT_SKIP_SHADOWS
    • VIEWPORT_SKIP_VISUALIZER
    • VIEWPORT_SKIP_SRGB
    • VIEWPORT_SKIP_POSTEFFECTS
    • VIEWPORT_SKIP_VELOCITY
    • VIEWPORT_SKIP_DYNAMIC_REFLECTIONS

    0 enables all the effects.

void renderImage2D(const Ptr<Camera> & camera, const Ptr<Image> & image, int width, int height, int hdr, int skip_flags)

Renders the scene into a 2D image of the given size in accordance with the set parameters. The viewport position is taken from the camera created via Camera class.

Arguments

  • const Ptr<Camera> & camera - The Camera to be used.
  • const Ptr<Image> & image - The Image to save the result to.
  • int width - Width of the projected image, in units.
  • int height - Height of the projected image, in units.
  • int hdr - 1 - enable HDR, 0 - disable HDR.
  • int skip_flags - Skip the effects:
    • VIEWPORT_SKIP_SHADOWS
    • VIEWPORT_SKIP_VISUALIZER
    • VIEWPORT_SKIP_SRGB
    • VIEWPORT_SKIP_POSTEFFECTS
    • VIEWPORT_SKIP_VELOCITY
    • VIEWPORT_SKIP_DYNAMIC_REFLECTIONS

    0 enables all the effects.

void renderImageCube(const Ptr<Camera> & camera, const Ptr<Image> & image, int skip_flags)

Renders the scene into a cube map image.

Arguments

  • const Ptr<Camera> & camera - Projection matrix.
  • const Ptr<Image> & image - Position from where to grab the cube map.
  • int skip_flags - Texture image.

void renderImageCube(const Ptr<Camera> & camera, const Ptr<Image> & image, int size, int hdr, int skip_flags, int local_space = 0)

Renders the scene into a cube map in accordance with the set parameters. The viewport position is taken from the camera created via Camera class.

Arguments

  • const Ptr<Camera> & camera - The Camera to be used.
  • const Ptr<Image> & image - The Image to save the result to.
  • int size - Texture dimensions (cube map edge size).
  • int hdr - 1 - enable HDR; 0 - disable HDR.
  • int skip_flags - Skip the effects:
    • VIEWPORT_SKIP_SHADOWS
    • VIEWPORT_SKIP_VISUALIZER
    • VIEWPORT_SKIP_SRGB
    • VIEWPORT_SKIP_POSTEFFECTS
    • VIEWPORT_SKIP_VELOCITY
    • VIEWPORT_SKIP_DYNAMIC_REFLECTIONS

    0 enables all the effects.

  • int local_space

void renderNodeImage2D(const Ptr<Camera> & camera, const Ptr<Node> & node, const Ptr<Image> & image, int skip_flags, int light_usage, const char * environment_texture_name)

Renders the given node into a 2D image in accordance with the set 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

  • const Ptr<Camera> & camera - The Camera to be used.
  • const Ptr<Node> & node - The Node to be rendered.
  • const Ptr<Image> & image - The Image to save the result to.
  • int skip_flags - Skip the effects:
    • VIEWPORT_SKIP_SHADOWS
    • VIEWPORT_SKIP_VISUALIZER
    • VIEWPORT_SKIP_SRGB
    • VIEWPORT_SKIP_POSTEFFECTS
    • VIEWPORT_SKIP_VELOCITY
    • VIEWPORT_SKIP_DYNAMIC_REFLECTIONS

    0 enables all the effects.

  • int light_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. In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.

void renderNodeImage2D(const Ptr<Camera> & camera, const Ptr<Node> & node, const Ptr<Image> & image, int width, int height, const char * hdr)

Renders the 2D image of the given node in accordance with the set 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

  • const Ptr<Camera> & camera - The Camera to be used.
  • const Ptr<Node> & node - The Node to be rendered.
  • const Ptr<Image> & image - The Image to save the result to.
  • int width - Skip the effects:
    • VIEWPORT_SKIP_SHADOWS
    • VIEWPORT_SKIP_VISUALIZER
    • VIEWPORT_SKIP_SRGB
    • VIEWPORT_SKIP_POSTEFFECTS
    • VIEWPORT_SKIP_VELOCITY
    • VIEWPORT_SKIP_DYNAMIC_REFLECTIONS

    0 enables all the effects.

  • int height - Sets the light sources that will affect the node (one of the USAGE_*_LIGHTING Viewport class variables.)
  • const char * hdr - Path to the environment cubemap to be used. Takes effect if the first (auxiliary light) or second (node light) lighting mode is used. In case LightWorld is used (zero mode), the environment cubemap used for the current world will be used.

void renderPostMaterial(const Ptr<Material> & material, const char * name, const Ptr<Texture> & texture)

Renders given post material.

Usage Example

Source code (C++)
texture_render->setColorTexture(0, texture);
texture_render->enable();
render->renderPostMaterial(material, "color", texture2);
texture_render->disable();
texture_render->unbindColorTexture();

Arguments

  • const Ptr<Material> & material - A smart pointer to the material.
  • const char * name - Texture name in material.
  • const Ptr<Texture> & texture - A smart pointer to input texture.

void renderProcedurals(const Vector< Ptr<Material> > & materials)

Renders post-process materials with procedural textures (calculated on GPU using custom shaders) that are assigned to surfaces.

Arguments

  • const Vector< Ptr<Material> > & materials - Procedural materials list.

int restoreState(const Ptr<Stream> & stream)

Restores a render state from the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.

Return value

1 if the state is restored successfully; otherwise, 0.

int saveSettings(const char * file)

Saves the current renderer settings to a given file.

Arguments

  • const char * file - Path to a target file.

Return value

1 if the settings are saved successfully; otherwise, 0.

int saveState(const Ptr<Stream> & stream)

Saves a render state into the stream.

Arguments

  • const Ptr<Stream> & stream - Stream smart pointer.

Return value

1 if the state is saved successfully; otherwise, 0.

int saveWorld(const Ptr<Xml> & xml)

Saves the render state into the given Xml node.

Arguments

  • const Ptr<Xml> & xml - Xml node.

Return value

1 if the state is saved successfully; otherwise, 0.

int API_DIRECT3D11

Description

DIRECT3D 11 API.

int API_NULL

Description

Null API name.

int API_OPENGL

int API_UNKNOWN

Description

Unknown API.

int COMPRESSION_BC1_DXT1

int COMPRESSION_BC1_DXT1A

int COMPRESSION_BC2_DXT3

int COMPRESSION_BC3_DXT5

int COMPRESSION_BC4_ATI1

int COMPRESSION_BC5_ATI2

int ENVIRONMENT_NUM_PRESETS

int EXPOSURE_DISABLED

Description

Rendering of the adaptive exposure effect is disabled.

int EXPOSURE_LOGARITHMIC

Description

The logarithmic exposure effect is used.

int EXPOSURE_QUADRATIC

Description

The adaptive exposure effect is rendered using quadratic function.

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 HAZE_DISABLED

int HAZE_SCATTERING

int HAZE_SOLID

int NUM_PASSES

int PASS_ALPHA_TEST

int PASS_AMBIENT

int PASS_AUXILIARY

int PASS_DEFERRED

int PASS_DEPTH_PRE_PASS

int PASS_EMISSION

int PASS_LIGHT_ENVIRONMENT_PROBE

int PASS_LIGHT_OMNI

int PASS_LIGHT_PROJ

int PASS_LIGHT_WORLD

int PASS_POST

int PASS_REFLECTION

int PASS_REFRACTION

int PASS_SHADOW

int PASS_VISUALIZER_SOLID

int PASS_WIREFRAME

Description

The wireframe pass is enabled.

int QUALITY_HIGH

Description

High quality of textures and shaders.

int QUALITY_LOW

Description

Low quality of textures and shaders. 1/16 of the original texture will be used.

int QUALITY_MEDIUM

Description

Medium quality of textures and shaders. 1/4 of the original texture will be used.
Last update: 2017-07-03
Build: ()