API Migration
Major Changes
- Added new GeodeticsTransformer class.
- Added new Input class.
- Added new InputGamePad class.
- Added new ObjectMeshSplineCluster class.
- Removed TextureRender class. Use the new RenderTarget class instead.
Breaking Changes
The Memory Management system has been significantly reconsidered in UNIGINE 2.9. Now the Editor class automatically owns all pointers to nodes created in the Main loop via one of the following ways:
// creating a new node
NodeDummyPtr nodeDummy = NodeDummy::create();
NodeReferencePtr nodeReference = NodeReference::create("object.node");
ObjectMeshStaticPtr mesh = ObjectMeshStatic::create("material_ball.mesh");
// loading a node
NodePtr node = World::get()->loadNode("object.node");
// cloning a node
node->clone();
// creating a new node
NodeDummy nodeDummy = new NodeDummy();
NodeReference nodeReference = new NodeReference("object.node");
ObjectMeshStatic mesh = new ObjectMeshStatic("material_ball.mesh");
// loading a node
Node node = Engine.world.LoadNode("object.node");
// cloning a node
node.Clone();
This results in decreasing number of unexpected crashes and memory leaks. As an example, the following code used to cause a crash due to refering to a null pointer:
PlayerPtr createPlayer()
{
PlayerDummyPtr player = PlayerDummy::create();
return player->getPlayer();
// the player variable used to delete the node it referred to on exiting the createPlayer function
}
int init()
{
// setPlayer used a null pointer causing a crash
Game::get()->setPlayer(createPlayer());
return 1;
}
Now it works as expected. You don't have to use grab() and release() methods to handle ownership of a node anymore — it will be automatically removed on the world shutdown.
Node removal should be performed only via the following code:
World::get()->removeNode(node);
You can release a node from auto ownership by calling the release() method:
Editor::get()->releaseNode(node);
Such an orphan pointer stays in memory even after the world shutdown which may lead to memory leaks, so you should handle ownership manually.
Exceptions
Nodes that are loaded or created not in the Main loop, as well as the ones loaded by using the AsyncQueue, are not handled by the Editor class. You should define their ownership manually via the following method:
node->release();
Editor::get()->addNode(node);
Smart Pointers Migration#
The following workflow is recommended when migrating the code base of your projects to the new API:
- get rid of all grab() and release() methods in the main thread. The isOwner() method is unlikely to be useful in the Main loop either.
- you don't need the addNode() method of the Editor class anymore since nodes are added to the world when created.
- don't use the Editor's removeNode() and destroy(node). Instead, it's recommended to remove nodes via the removeNode() method of the World class.
Custom C++ Component System Projects#
If you're upgrading a project, that uses the Custom C++ Component System, you'll have to manually copy the Component System source files to your project's source/ComponentSystem folder after successful migration.
Body Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setID() | Return value changed. |
removeShape(Shape) | Removed. Use removeShape() instead. |
BoundBox Class#
Camera Class#
Editor Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getIntersection() | Set of arguments changed. |
getIntersection() | Set of arguments changed. |
Engine Class#
Game Class#
Image Class#
Light Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setShadowSoftness() | Removed. |
getShadowSoftness() | Removed. |
New Functions
- SHADOW_RESOLUTION_VALUE_16384
- SHADOW_RESOLUTION_VALUE_8192
- SHADOW_RESOLUTION_VALUE_4096
- SHADOW_RESOLUTION_VALUE_2048
- SHADOW_RESOLUTION_VALUE_1024
- SHADOW_RESOLUTION_VALUE_512
- SHADOW_RESOLUTION_VALUE_256
- SHADOW_RESOLUTION_VALUE_128
- SHADOW_RESOLUTION_VALUE_64
- SHADOW_RESOLUTION_DEFAULT
- SHADOW_PENUMBRA_ULTRA
- SHADOW_PENUMBRA_HIGH
- SHADOW_PENUMBRA_MEDIUM
- SHADOW_PENUMBRA_LOW
- SHADOW_PENUMBRA_DISABLED
- SHADOW_PENUMBRA_GLOBAL
- SHADOW_FILTER_ULTRA
- SHADOW_FILTER_HIGH
- SHADOW_FILTER_MEDIUM
- SHADOW_FILTER_LOW
- SHADOW_FILTER_DISABLED
- SHADOW_FILTER_GLOBAL
- SHAPE_DEFAULT
- setShadowPenumbra()
- getShadowPenumbra()
- setShadowPenumbraMode()
- getShadowPenumbraMode()
- setShadowFilter()
- getShadowFilter()
- setShadowFilterMode()
- getShadowFilterMode()
LightEnvironmentProbe Class#
LightVoxelProbe Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setBakeInternalVolume() | Set of arguments changed. |
isBakeInternalVolume() | Removed. Use getBakeInternalVolume() instead. |
New Functions
Material Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
PARAMETER_CONSTANT | Removed. |
New Functions
- PARAMETER_FLOAT
- PARAMETER_FLOAT2
- PARAMETER_FLOAT3
- PARAMETER_FLOAT4
- PARAMETER_INT
- PARAMETER_INT2
- PARAMETER_INT3
- PARAMETER_INT4
- setParameterFloat()
- setParameterFloat()
- getParameterFloat()
- setParameterFloat2()
- setParameterFloat2()
- getParameterFloat2()
- setParameterFloat3()
- setParameterFloat3()
- getParameterFloat3()
- setParameterFloat4()
- setParameterFloat4()
- getParameterFloat4()
- setParameterInt()
- setParameterInt()
- getParameterInt()
- setParameterInt2()
- setParameterInt2()
- getParameterInt2()
- setParameterInt3()
- setParameterInt3()
- getParameterInt3()
- setParameterInt4()
- setParameterInt4()
- getParameterInt4()
- getRenderPass()
- getRenderPassName()
- renderCompute()
- renderCompute()
- renderScreen()
- renderScreen()
- runExpression()
- setProceduralTexture()
- isBrush()
- isParameterExpression()
- getParameterWidgetIndex()
- getStateWidgetIndex()
- getTextureWidgetIndex()
Node Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setID() | Return value changed. |
scale() | Removed. |
worldScale() | Removed. |
setRotation() | Removed. |
setWorldRotation() | Removed. |
setClutter() | Renamed to setImmovable(). |
isClutter() | Renamed to isImmovable(). |
New Functions
- rotate()
- rotate()
- translate()
- worldRotate()
- worldRotate()
- worldTranslate()
- getCloneProperty()
- getCloneNode()
- CALLBACK_PROPERTY_CHANGE_ENABLED
- CALLBACK_CACHE_NODE_ADD
- CALLBACK_NODE_LOAD
- CALLBACK_NODE_CLONE
- CALLBACK_NODE_SWAP
- CALLBACK_NODE_REMOVE
- CALLBACK_PROPERTY_NODE_SLOTS_CHANGED
- CALLBACK_NODE_CHANGE_ENABLED
- OBJECT_MESH_SPLINE_CLUSTER
- insertProperty()
- insertProperty()
- insertProperty()
NodeReference Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setNodeName() | Return value changed. |
Object Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getIntersection() | Set of arguments changed. |
getIntersection() | Set of arguments changed. |
New Functions
ObjectExternBase Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getIntersection() | Set of arguments changed. |
ObjectIntersection Class#
ObjectMeshCluster Class#
ObjectMeshClutter Class#
ObjectMeshSkinned Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getAnimationName() | Removed. Use getAnimationPath() instead. |
Player Class#
PropertyParameter Class#
Ptr Class#
Render Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setSkipClouds() | Removed. Use setCloudsEnabled() instead. |
isSkipClouds() | Removed. Use isCloudsEnabled(). |
setSkipLights() | Removed. Use setLightsEnabled() instead. |
isSkipLights() | Removed. Use isLightsEnabled() instead. |
setSkipWater() | Removed. Use setWaterEnabled() instead. |
isSkipWater() | Removed. Use isWaterEnabled() instead. |
setSkipPostMaterials() | Removed. Use setScreenSpaceEffects() instead. |
isSkipPostMaterials() | Removed. Use isScreenSpaceEffects() instead. |
setSkipRenderMaterials() | Removed. Use setPrePostMaterialsEnabled() instead. |
isSkipRenderMaterials() | Removed. Use isPrePostMaterialsEnabled() instead. |
setSkipTransparent() | Removed. Use setTransparentEnabled() instead. |
isSkipTransparent() | Removed. Use isTransparentEnabled() instead. |
setSkipTransparentAmbient() | Removed. Use setTransparentAmbient() instead. |
isSkipTransparentAmbient() | Removed. Use isTransparentAmbient() instead. |
setSkipTransparentDeferred() | Removed. Use setTransparentDeferred() instead. |
isSkipTransparentDeferred() | Removed. Use isTransparentDeferred() instead. |
setSkipTransparentLight() | Removed. Use setTransparentLight() instead. |
isSkipTransparentLight() | Removed. Use isTransparentLight() instead. |
setSkipTransparentMultipleEnvProbes() | Removed. Use setTransparentMultipleEnvProbes() instead. |
isSkipTransparentMultipleEnvProbes() | Removed. Use isTransparentMultipleEnvProbes() instead. |
setRenderMaterials() | Renamed to setPrePostMaterials(). |
getRenderMaterials() | Renamed to getPrePostMaterials(). |
setShadowsSoft() | Removed. |
isShadowsSoft() | Removed. |
setShadowsSoftNoise() | Removed. |
getShadowsSoftNoise() | Removed. |
setShadowsSoftQuality() | Removed. |
getShadowsSoftQuality() | Removed. |
renderPostMaterial() | Removed. |
renderPostMaterial() | Removed. Use renderScreenMaterial() instead. |
renderPostMaterial() | Removed. Use renderScreenMaterial() instead. |
renderPostMaterial() | Removed. Use renderScreenMaterial() instead. |
renderComputeMaterial() | Set of arguments changed. |
setLightsInterleavedFixGhosting() | Removed. |
isLightsInterleavedFixGhosting() | Removed. |
setSSS() | Renamed to setSSSSS(). |
isSSS() | Renamed to isSSSSS(). |
setSSSColor() | Renamed to setSSSSSColor(). |
getSSSColor() | Renamed to getSSSSSColor(). |
setSSSQuality() | Renamed to setSSSSSQuality(). |
getSSSQuality() | Renamed to getSSSSSQuality(). |
setSSSRadius() | Renamed to setSSSSSRadius(). |
getSSSRadius() | Renamed to getSSSSSRadius(). |
setSSSResolution() | Renamed to setSSSSSResolution(). |
getSSSResolution() | Renamed to getSSSSSResolution(). |
setTAAColorClamping() | Renamed to setTAAFramesByColor(). |
isTAAColorClamping() | Renamed to isTAAFramesByColor(). |
setTAAMaxFrameCount() | Renamed to setTAAMaxFramesByVelocity(). |
getTAAMaxFrameCount() | Renamed to getTAAMaxFramesByVelocity(). |
setTAAMinFrameCount() | Renamed to setTAAMinFramesByVelocity(). |
getTAAMinFrameCount() | Renamed to getTAAMinFramesByVelocity(). |
setTAAVelocityClamping() | Renamed to setTAAFramesByVelocity(). |
isTAAVelocityClamping() | Renamed to isTAAFramesByVelocity(). |
setTAAVelocityThreshold() | Renamed to setTAAFramesVelocityThreshold(). |
getTAAVelocityThreshold() | Renamed to getTAAFramesVelocityThreshold(). |
New Functions
- PASS_CUSTOM_BEGIN
- PASS_CUSTOM_END
- CORRECT_ROUGHNESS_DISABLED
- CORRECT_ROUGHNESS_LOW
- CORRECT_ROUGHNESS_MEDIUM
- CORRECT_ROUGHNESS_HIGH
- CORRECT_ROUGHNESS_ULTRA
- setBentNormalDenoiseQuality()
- getBentNormalDenoiseQuality()
- setBentNormalFixOverlitAreas()
- isBentNormalFixOverlitAreas()
- setFilmicSaturationRecovery()
- getFilmicSaturationRecovery()
- setShadowsFilterNoise()
- isShadowsFilterNoise()
- setShadowsFilterMode()
- getShadowsFilterMode()
- setShadowsPenumbraMode()
- getShadowsPenumbraMode()
- setShadowsPenumbraNoise()
- isShadowsPenumbraNoise()
- setLightsInterleavedSamples()
- getLightsInterleavedSamples()
- getTemporaryRenderTarget()
- releaseTemporaryRenderTarget()
- getTemporary3DTexture()
- getTemporary2DArrayTexture()
- getTemporaryTexture()
- getTemporaryTexture()
- getTemporaryTexture()
- getTemporaryTexture()
- releaseTemporaryTexture()
- getHDRTextureFormat()
- addScriptableMaterial()
- removeScriptableMaterial()
- getNumScriptableMaterials()
- findScriptableMaterial()
- setScriptableMaterial()
- getScriptableMaterial()
- setScriptableMaterialEnabled()
- getScriptableMaterialEnabled()
- swapScriptableMaterials()
- clearScriptableMaterials()
- setEnvironmentCorrectRoughness()
- getEnvironmentCorrectRoughness()
- setSSAODenoiseQuality()
- getSSAODenoiseQuality()
- setSSGIDenoiseQuality()
- getSSGIDenoiseQuality()
- setSSGIDenoiseIntensity()
- getSSGIDenoiseIntensity()
- setSSGIDenoiseGaussianSigma()
- getSSGIDenoiseGaussianSigma()
- setSSGIDenoiseThreshold()
- getSSGIDenoiseThreshold()
- setSSGIDenoiseRadius()
- getSSGIDenoiseRadius()
- setSSGIColorClampingIntensity()
- getSSGIColorClampingIntensity()
- setSSGIColorClampingVelocityThreshold()
- getSSGIColorClampingVelocityThreshold()
- setSSRDenoiseQuality()
- getSSRDenoiseQuality()
- setSSRDenoiseIntensity()
- getSSRDenoiseIntensity()
- setSSRDenoiseGaussianSigma()
- getSSRDenoiseGaussianSigma()
- setSSRDenoiseThreshold()
- getSSRDenoiseThreshold()
- setSSRDenoiseRadius()
- getSSRDenoiseRadius()
- setSSRColorClampingIntensity()
- getSSRColorClampingIntensity()
- setSSRColorClampingVelocityThreshold()
- getSSRColorClampingVelocityThreshold()
- setSSSSSAmbient()
- isSSSSSAmbient()
- setSSSSSDiffuse()
- isSSSSSDiffuse()
- setSSSSSInterleaved()
- isSSSSSInterleaved()
- setSSSSSInterleavedColorClamping()
- getSSSSSInterleavedColorClamping()
- setSSSSSInterleavedSamples()
- getSSSSSInterleavedSamples()
- setSSSSSMaxThreshold()
- getSSSSSMaxThreshold()
- setSSSSSMinThreshold()
- getSSSSSMinThreshold()
- setSSSSSNoiseRay()
- getSSSSSNoiseRay()
- setSSSSSNoiseStep()
- getSSSSSNoiseStep()
- setSSSSSTAASamples()
- getSSSSSTAASamples()
- setSSSSSTAACatmullResampling()
- isSSSSSTAACatmullResampling()
- setSSSSSTAAMinFramesByVelocity()
- getSSSSSTAAMinFramesByVelocity()
- setSSSSSTAAMaxFramesByVelocity()
- getSSSSSTAAMaxFramesByVelocity()
- setSSSSSTAAFramesVelocityThreshold()
- getSSSSSTAAFramesVelocityThreshold()
- setSSSSSTAAFrameCount()
- getSSSSSTAAFrameCount()
- setSSSSSTAAPreserveDetails()
- getSSSSSTAAPreserveDetails()
- setSSSSSTAAFramesByVelocity()
- isSSSSSTAAFramesByVelocity()
- setSSSSSTAAFramesByColor()
- isSSSSSTAAFramesByColor()
- setSSSSSTAAAntialiasingInMotion()
- isSSSSSTAAAntialiasingInMotion()
- setSSSSSTAAFixFlicker()
- isSSSSSTAAFixFlicker()
Renderer Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getTextureRender() | Removed. Use getRenderTarget() instead. |
getPostTextureRender() | Removed. Use getPostRenderTarget() instead. |
hasGeodeticPivot() | Return value changed. |
isNode() | Return value changed. |
isReflection() | Return value changed. |
isShadow() | Return value changed. |
isStereo() | Return value changed. |
useDynamicReflections() | Return value changed. |
useOcclusionQueries() | Return value changed. |
usePostEffects() | Return value changed. |
useShadows() | Return value changed. |
useTAA() | Return value changed. |
useVelocityBuffer() | Return value changed. |
useVisualizer() | Return value changed. |
setShaderParameters() | Argument type changed. |
setShaderParameters() | Argument type changed. |
setShaderParameters() | Argument type changed. |
setShaderParameters() | Argument type changed. |
setShaderParameters() | Argument type changed. |
New Functions
RenderState Class#
Shader Class#
New Functions
- setParameterInt1()
- setParameterInt2()
- setParameterInt3()
- setParameterInt4()
- setParameterUInt1()
- setParameterUInt2()
- setParameterUInt3()
- setParameterUInt4()
- setParameterFloat1()
- setParameterFloat2()
- setParameterFloat3()
- setParameterFloat4()
- setParameterDouble1()
- setParameterDouble2()
- setParameterDouble3()
- setParameterDouble4()
- setParameterInt1()
- setParameterInt2()
- setParameterInt3()
- setParameterInt4()
- setParameterUInt1()
- setParameterUInt2()
- setParameterUInt3()
- setParameterUInt4()
- setParameterFloat1()
- setParameterFloat2()
- setParameterFloat3()
- setParameterFloat4()
- setParameterDouble1()
- setParameterDouble2()
- setParameterDouble3()
- setParameterDouble4()
Shape Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getTextureRender() | Removed. Use getRenderTarget() instead. |
setID() | Return value changed. |
Sounds Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setCurrentDeviceName() | Return value changed. |
SplinePoint Class#
SplineSegment Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
parametricToLinear() | Removed. |
setDeltaAngleThreshold() | Renamed to setAdaptiveAngleThreshold(). |
getDeltaAngleThreshold() | Renamed to getAdaptiveAngleThreshold(). |
New Functions
String Class#
StructuredBuffer Class#
Texture Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getDepth() | Set of arguments changed. |
getHeight() | Set of arguments changed. |
getWidth() | Set of arguments changed. |
New Functions
UGUID Class#
vec2 Class#
vec3 Class#
vec4 Class#
World Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getIntersection() | Set of arguments changed. |
getIntersection() | Set of arguments changed. |
New Functions
WorldIntersection Class#
WorldSplineGraph Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
getNumSegmentNodes() | Removed. Use SplineSegment::getNumNodes() instead. |
New Functions
WorldPortal Class#
AppProjectionInterface Class#
UNIGINE 2.8 | UNIGINE 2.9 |
---|---|
setGamma() | Removed. |
getGamma() | Removed. |
setBorderBlend() | Set of arguments changed. |
getBorderBlend() | Return value changed. |
setMaskBorderSize() | Removed. |
getMaskBorderSize() | Removed. |
setMaskOuterAlpha() | Removed. |
getMaskOuterAlpha() | Removed. |
setMaskInnerAlpha() | Removed. |
getMaskInnerAlpha() | Removed. |
setMaskPower() | Removed. |
getMaskPower() | Removed. |
New Functions
- setDebugShowWarpPoints()
- isDebugShowWarpPoints()
- addBlend()
- getBlend()
- getNumBlends()
- setBlendEnabled()
- isBlendEnabled()
- setBlendSmooth()
- getBlendSmooth()
- setBlendAlpha()
- getBlendAlpha()
- setBlendContrast()
- getBlendContrast()
- setBlendGamma()
- getBlendGamma()
- clearBlends()
- setDebugShowBlendPoints()
- isDebugShowBlendPoints()