This page has been translated automatically.
Programming
Fundamentials
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
Core Library
Containers
Engine Classes
Node-Related Classes
Rendering-Related Classes
Physics-Related Classes
Bounds-Related Classes
GUI-Related Classes
Controls-Related Classes
Pathfinding-Related Classes
Utility 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.

API Migration

99% of UnigineScript, C++ and C# classes, methods and constants are unified now, providing full access to the engine features by means of any of the three languages.

API Changes

Major Changes

  • Added a new Camera class partially replicating the Player class functionality except for:
    • Camera has no physical properties.
    • Camera isn't a node.

    The Camera class is used for creating and setting cameras, the image of which can be then rendered via the Vieport class methods or Render class methods.

  • Added new Viewport class allowing to render the image from any camera. It can be built into any user interface. Except for the Render class, the Viewport class supports all main viewport features: cube maps rendering, visualizer, dynamic reflections, antialiasing, etc.
  • The old Geodetic class has been renamed Ellipsoid and has been extended.
  • Added new GeodeticPivot class for the new geodetic pivot object.

Render Class

UNIGINE 2.1.1UNIGINE 2.2
setSSAOBlur()Removed.
getSSAOBlur()Removed.
setSSAOCavityScale()Removed.
getSSAOCavityScale()Removed.
getCameraOffset()Removed.
setCameraOffset()Removed.
getCameraThreshold()Removed.
getStereo()Removed.
void renderImage2D(mat4 projection, Mat4 modelview, Image image, int width, int height, cstr materials, int hdr)Removed.
void renderImageCube(mat4 projection, Vec3 position, Image image, int size, cstr materials, int hdr)Removed.
void renderViewport(mat4 projection, Mat4 modelview, cstr materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) constRemoved.
void renderViewport(mat4 projection, Mat4 modelview, Mat4 old_modelview, cstr materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) constRemoved.
void renderViewportStereo(const Math::mat4 &projection, const UNIGINE_MAT4 &modelview, const Math::mat4 *projections, const UNIGINE_MAT4 *modelviews, const char *materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) const = 0()Removed.
void renderViewportStereo(const Math::mat4 &projection, const UNIGINE_MAT4 &modelview, const Math::mat4 *projections, const UNIGINE_MAT4 *modelviews, const char *materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) const()Removed.
void renderViewportStereo(const Math::mat4 &projection, const UNIGINE_MAT4 &modelview, const UNIGINE_MAT4 *old_modelviews, const Math::mat4 *projections, const UNIGINE_MAT4 *modelviews, const char *materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) const = 0()Removed.
void renderViewportStereo(const Math::mat4 &projection, const UNIGINE_MAT4 &modelview, const UNIGINE_MAT4 *old_modelviews, const Math::mat4 *projections, const UNIGINE_MAT4 *modelviews, const char *materials, int viewport_mask, int reflection_mask, int shadows, int visualizer = 0) const()Removed.
void renderNode(mat4 projection, Mat4 modelview, Mat4 old_modelview, Node node, cstr materials, int viewport_mask, int reflection_mask, int shadows) const()Removed.
setCameraThreshold()Removed.
getSSAOScale()getSSAOIntensity()
setSSAOScale()setSSAOIntensity()
STEREO_DISABLEDRemoved.
STEREO_ENABLEDRemoved.
STEREO_HORIZONTALRemoved.
STEREO_VERTICALRemoved.
DEFERRED_DISABLEDRemoved.
DEFERRED_LIGHTINGRemoved.
DEFERRED_SHADINGRemoved.

Mesh Class

Renderer Class

UNIGINE 2.1.1UNIGINE 2.2
isStereo()Removed.
isViewport()Removed.
saveCamera()Removed.
restoreCamera()Removed.
setSProjection()Removed.
getSProjection()Removed.

WidgetSpriteViewport Class

UNIGINE 2.1.1UNIGINE 2.2
setCameraOffset()Removed.
getCameraOffset()Removed.
setMaterials()Removed.
getMaterials()Removed.
setShadows()Removed.
getShadows()Removed.

New Functions and Variables

WidgetSpriteNode Class

Player Class

UNIGINE 2.1.1UNIGINE 2.2
setModelview()Removed.
getModelview()Removed.
getIModelview()Removed.
setOldModelview()Removed.
getOldModelview()Removed.
setSProjection()Removed.
getSProjection()Removed.
setOffset()Removed.
getOffset()Removed.

New Functions and Variables

PlayerActor Class

UNIGINE 2.1.1UNIGINE 2.2
setView()Renamed setViewDirection().
getView()Renamed getViewDirection().

Light Class

UNIGINE 2.1.1UNIGINE 2.2
void setShadowSlope(float slope)Removed.
float getShadowSlope()Removed.
setShadowSize()Renamed setShadowResolution().
getShadowSize()Renamed getShadowResolution().
setShadowBias()Now operates as an adaptive bias.

New Functions and Variables

LightWorld Class

UNIGINE 2.1.1UNIGINE 2.2
void setShadowRange(float range)Removed.
float getShadowRange()()Removed.
void setShadowDistribute(float distribute)()Removed.
float getShadowDistribute()()Removed.
setNumShadowSplits()Renamed setNumShadowCascades.
getNumShadowSplits()Renamed getNumShadowCascades.

New Functions and Variables

LightOmni Class

UNIGINE 2.1.1UNIGINE 2.2
()Removed.
LightOmni(vec4 color,vec3 radius,string name)()Renamed LightOmni(vec4 color,float attenuation_distance,string name).
void setRadius(vec3 r)Renamed void setAttenuationDistance(float d).
vec3 getRadius()Renamed float getAttenuationDistance().

New Functions and Variables

LightProj Class

void setRadius(float r)()Renamed void setAttenuationDistance(float d).
float getRadius()()Renamed float getAttenuationDistance().

New Functions and Variables

ObjectText Class

WorldExpression Class

New Functions and Variables

Math Classes

  • All dmat4 conversions from double / float arrays assume it has 16 elements inside (4x4 matrix) rather than 12 (4x3 matrix).
  • All mat3 conversions from double / float arrays assume it has 9 elements inside (3x3 matrix) rather than 12 (4x3 matrix).
UNIGINE 2.1.1UNIGINE 2.2
explicit dmat4(const double *m,int transpose = 0,int square = 0)Removed the square argument.
void set(const double *m,int transpose = 0,int square = 0)Removed the square argument.
void set(const float *m,int transpose = 0,int square = 0)Removed the square argument.
void get(double *m,int transpose = 0,int square = 0)Removed the square argument.

Engine Class

UNIGINE 2.1.1UNIGINE 2.2
getDataPath()string engine.getDataPath(int num = 0)
()Removed.

New Functions and Variables

  • getNumDataPaths()
  • getNumPluginPaths()
  • getPluginPath()
  • getSystemScript()
  • getEditorScript()
  • getExternDefines

UUSL Changes

From now, UUSL supports tessellation (quad-based, used only in new water for now).

  • Changes in the UUSL functions:

    New functions:

    • floatPack88To16() packs normalized RG8 into R16.
    • floatPack8888To1616() packs normalized RGBA8 into R16G16.
    • floatPack16To88() unpacks R16 into RG8.
    • floatPack1616To8888() unpacks R16G16 into RGBA8.
    • mul3(float3x3 m,float3 v) performs the 3x3 matrix * float3 vector multiplication.
    • mul(float3 v, float3x3 m) performs the vector * matrix multiplication (OpenGL only).
    • lerpOne() performs interpolation of single value and factor.
    • length2() - returns dot product of the vector: dot(vector, vector).
    • getBasisX(float3x3 m) returns x-basis of the given 3x3 matrix.
    • getBasisX(float4x4 m) returns x-basis of the given 4x4 matrix.
    • getBasisY(float3x3 m) returns y-basis of the given 3x3 matrix.
    • getBasisY(float4x4 m) returns y-basis of the given 4x4 matrix.
    • getBasisZ(float3x3 m) returns z-basis of the given 3x3 matrix.
    • getBasisZ(float4x4 m) returns z-basis of the given 4x4 matrix.
    • getFresnelSchlick() calculates Fresnel factor (Schlick's approximation).
    • getGGX() calculates specular lighting.
    • getAreaLightGGX() calculates area light specular lighting.
    • getPhong() calculates Phong shading.
    • getBlinn() calculates Blinn shading.
    • getBarley12() calculates diffuse lighting.
    • getWrapAround() calculates Energy-Conserving wrapped diffuse.
    • getTranslucent() calculates translucent.
    • getBRDF() calculates BRDF.
    • specularReflection() calculates specular reflection.
    • conserveEnergy() corrects diffuse with taking into account energy conservation.
    • getLightAttenuation() calculates Light Attenuation by position or distance.

    Deleted functions:

    • getLightOmniRadius().
    • setDeferredDepth().
  • New predefined values:
    • STATICARRAY(float2,halton16,16) array with Halton sequence.
    • STATICARRAY(float2,halton8,8) array with Halton sequence.
  • New fragment shader's semantics:
    • INIT_FRONTFACE adds an input semantic indicates primitive face (frontface or not).
    • IN_FRONTFACE floating-point scalar that indicates a back-facing primitive.
  • Changes in the UUSL shader parameters:

    New parameters:

    • s_camera_position camera position in world space.
    • s_iprojection inverse projection matrix.
    • s_camera_projection projection matrix of camera (not renderstate).
    • s_camera_iprojection inverse projection matrix of camera (not renderstate).
    • s_modelview_untranslated model-View matrix without translate (only rotation).
    • s_light_attenuation light source attenuation.
    • s_light_shape light source shape.
    • s_camera_direction camera direction vector.
    • s_light_shadow_softness light shadow softness value.
    • s_light_shadow_iradius light shadow inverse radius.
    • s_light_shadow_sharpness light shadow sharpness value.
    • s_light_cascades_bias[4] world light shadow cascades bias.
    • s_light_cascades_projection[4] world light shadow cascades projection matrix.

    Renamed parameters:

    • s_camera_position -> s_camera_offset
    • s_light_shadow_splits -> s_light_cascades_num
    • s_light_shadow_projections[4] -> s_light_cascades_projection[4]

    Deleted parameters:

    • s_light_iradius
    • s_material_reflection_center
    • s_material_reflection_color
    • s_material_reflection_radius
    • s_light_shadow_offsets[4]
    • s_light_shadow_iradius
  • Changes in the UUSL textures:

    Renamed:

    • INIT_RW_TEXTURE(NUM,SIZE) -> INIT_RW_TEXTURE(NUM).
    • TEXTURE_CUBE_SHADOW(NUM,COORD) -> TEXTURE_CUBE_SHADOW(NUM,DIRECTION,DEPTH).

Extended Functionality

Added access to the following interfaces for all 3 languages:

Last update: 2017-07-03
Build: ()