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.1 | UNIGINE 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) const | Removed. |
void renderViewport(mat4 projection, Mat4 modelview, Mat4 old_modelview, cstr 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 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_DISABLED | Removed. |
STEREO_ENABLED | Removed. |
STEREO_HORIZONTAL | Removed. |
STEREO_VERTICAL | Removed. |
DEFERRED_DISABLED | Removed. |
DEFERRED_LIGHTING | Removed. |
DEFERRED_SHADING | Removed. |
Mesh Class
New Functions and Variables
- void setSSAOIntensityLightedSide(float)
- float getSSAOIntensityLightedSide()
- void renderImage2D(Camera camera,Image image,int skip_flags)
- void renderImage2D(Camera camera,Image image,int width,int height,int hdr,int skip_flags)
- void renderImageCube(Camera camera,Image image,int size,int hdr,int skip_flags)
- void renderImageCube(Camera camera,Image image,int skip_flags)
- void renderNodeImage2D(Camera camera,Node node,Image image,int skip_flags,int light_usage,cstr environment_texture_name)
- void renderNodeImage2D(Camera camera,Node node,Image image,int width,int height,int hdr,int skip_flags,int light_usage,cstr environment_texture_name)
- setSSSRadius()
- setGeodeticTransform
Renderer Class
UNIGINE 2.1.1 | UNIGINE 2.2 |
---|---|
isStereo() | Removed. |
isViewport() | Removed. |
saveCamera() | Removed. |
restoreCamera() | Removed. |
setSProjection() | Removed. |
getSProjection() | Removed. |
WidgetSpriteViewport Class
UNIGINE 2.1.1 | UNIGINE 2.2 |
---|---|
setCameraOffset() | Removed. |
getCameraOffset() | Removed. |
setMaterials() | Removed. |
getMaterials() | Removed. |
setShadows() | Removed. |
getShadows() | Removed. |
New Functions and Variables
WidgetSpriteNode Class
UNIGINE 2.1.1 | UNIGINE 2.2 |
---|---|
setCameraOffset() | Removed. |
getCameraOffset() | Removed. |
setMaterials() | Removed. |
getMaterials() | Removed. |
setShadows() | Removed. |
getShadows() | Removed. |
New Functions and Variables
- void setCamera(Camera camera)
- Camera getCamera()
- const char *getPostMaterials()
- void setPostMaterials(const char *materials)
- int setSkipFlags
- int getSkipFlags
- int checkSkipFlags(int flags)
- void appendSkipFlags(int flags)
- void removeSkipFlags(int flags)
- const char *getEnvironmentTextureName()
- void setEnvironmentTextureName(const char *materials)
- int setLightUsage
- int getLightUsage
Player Class
UNIGINE 2.1.1 | UNIGINE 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.1 | UNIGINE 2.2 |
---|---|
setView() | Renamed setViewDirection(). |
getView() | Renamed getViewDirection(). |
Light Class
UNIGINE 2.1.1 | UNIGINE 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
- void setShadowNormalBias(float bias)
- float getShadowNormalBias()
- void setRenderWater(float)
- float getRenderWater()
- setRenderTransparent(float)
- float getRenderTransparent()
LightWorld Class
UNIGINE 2.1.1 | UNIGINE 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.1 | UNIGINE 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
- void setShapeRadius(float r)
- float getShapeRadius()
- void setShapeLength(float l)
- float getShapeLength()
- void setShapeHeight(float h)
- float getShapeHeight()
- void setShapeType(int t)
- int getShapeType()
- void setPenumbra(float)
- float getPenumbra()
ObjectText Class
WorldExpression Class
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.1 | UNIGINE 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
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:
- AmbientSource
- App
- Blob
- Body
- BodyCloth
- BodyDummy
- BodyFracture
- BodyParticles
- BodyPath
- BodyRagDoll
- BodyRigid
- BodyRope
- BodyWater
- Camera
- Config
- Console
- Controls
- ControlsApp
- ControlsDummy
- ControlsJoystick
- ControlsSixAxis
- ControlsXPad360
- Decal
- DecalMesh
- DecalOrtho
- DecalProj
- Dir
- Editor
- Ffp
- Field
- FieldAnimation
- FieldSpacer
- File
- FileSystem
- Game
- GameIntersection
- Gui
- Image
- Joint
- JointBall
- JointCylindrical
- JointFixed
- JointHinge
- JointParticles
- JointPath
- JointPrismatic
- JointSuspension
- JointWheel
- Json
- Light
- LightEnvironmentProbe
- LightOmni
- LightProj
- LightWorld
- Material
- Materials
- Mesh
- Navigation
- NavigationMesh
- NavigationSector
- Node
- NodeDummy
- NodeExtern
- NodeExternBase
- NodeLayer
- NodePivot
- NodeReference
- NodeTrigger
- Object
- ObjectBillboards
- ObjectDummy
- ObjectDynamic
- ObjectExtern
- ObjectExternBase
- ObjectGrass
- ObjectGui
- ObjectGuiMesh
- ObjectIntersection
- ObjectIntersectionNormal
- ObjectIntersectionTexCoord
- ObjectMeshCluster
- ObjectMeshClutter
- ObjectMeshDynamic
- ObjectMeshSkinned
- ObjectMeshStatic
- ObjectParticles
- ObjectSky
- ObjectTerrain
- ObjectText
- ObjectVolumeBox
- ObjectVolumeOmni
- ObjectVolumeProj
- ObjectVolumeSphere
- ObjectWaterGlobal
- ObjectWaterMesh
- Obstacle
- ObstacleBox
- ObstacleCapsule
- ObstacleSphere
- Path
- PathRoute
- PathRouteIntersection
- Physical
- PhysicalForce
- PhysicalNoise
- PhysicalTrigger
- PhysicalWater
- PhysicalWind
- Physics
- PhysicsIntersection
- PhysicsIntersectionNormal
- Player
- PlayerActor
- PlayerDummy
- PlayerPersecutor
- PlayerSpectator
- Profiler
- Properties
- Property
- RegExp
- Render
- Renderer
- RenderState
- Shader
- Shape
- ShapeBox
- ShapeCapsule
- ShapeConvex
- ShapeCylinder
- ShapeSphere
- Socket
- Sound
- SoundReverb
- SoundSource
- Splash
- Stream
- Texture
- TextureRender
- UserInterface
- Viewport
- Visualizer
- Widget
- WidgetButton
- WidgetCanvas
- WidgetCheckBox
- WidgetComboBox
- WidgetDialog
- WidgetDialogColor
- WidgetDialogFile
- WidgetDialogImage
- WidgetDialogMessage
- WidgetEditLine
- WidgetEditText
- WidgetExtern
- WidgetExternBase
- WidgetGridBox
- WidgetGroupBox
- WidgetHBox
- WidgetHPaned
- WidgetIcon
- WidgetLabel
- WidgetListBox
- WidgetManipulator
- WidgetManipulatorRotator
- WidgetManipulatorScaler
- WidgetManipulatorTranslator
- WidgetMenuBar
- WidgetMenuBox
- WidgetScroll
- WidgetScrollBox
- WidgetSlider
- WidgetSpacer
- WidgetSpinBox
- WidgetSprite
- WidgetSpriteNode
- WidgetSpriteShader
- WidgetSpriteVideo
- WidgetSpriteViewport
- WidgetTabBox
- WidgetTreeBox
- WidgetVBox
- WidgetVPaned
- WidgetWindow
- World
- WorldCluster
- WorldClutter
- WorldExpression
- WorldExtern
- WorldExternBase
- WorldIntersection
- WorldIntersectionNormal
- WorldIntersectionTexCoord
- WorldLayer
- WorldOccluder
- WorldOccluderMesh
- WorldOccluderTerrain
- WorldPortal
- WorldSector
- WorldSwitcher
- WorldTransformBone
- WorldTransformPath
- WorldTrigger
- Xml
Last update: 03.07.2017
Помогите сделать статью лучше
Была ли эта статья полезной?
(или выберите слово/фразу и нажмите Ctrl+Enter