what's new.md 19 KB

4.0.0

Major updates

Updates

GUI

  • Added inputText.onKeyboardEventProcessedObservable (Deltakosh)
  • Added button.image and button.textBlock to simplify access to button internal parts (Deltakosh)
  • Added sldier.displayThumb to show/hide slider's thumb (Deltakosh)
  • Added grid.rowCount, grid.columnCount and grid.getChildrenAt() (Deltakosh)
  • Added Control.AllowAlphaInheritance to let users control the way alpha is used (inherited or not) (Deltakosh)
  • Added support for performing operations like select all, text highlight, delete selected in inputText (Saket Saurabh)
  • Added inputText.onTextCopyObservable, inputText.onTextCutObservable and inputText.onTextPasteObservable to inputText (Saket Saurabh)
  • Added AdvancedDynamicTexture.onClipboardObservable to observe for clipboard events in AdvancedDynamicTexture(Saket Saurabh)
  • Added inputText.onFocusSelectAll to allow complete selection of text on focus event.(Saket Saurabh)
  • Added mouse drag to highlight text in inputText (Saket Saurabh)

Core Engine

  • Added animatable.onAnimationLoopObservable (Deltakosh)
  • Added animationGroup.onAnimationLoopObservable (Deltakosh)
  • Added FlyCamera for free navigation in 3D space, with a limited set of settings (Phuein)
  • Added support for Scissor testing (Deltakosh)
  • Added Engine.onNewSceneAddedObservable (Deltakosh)
  • Added new PassCubePostProcess to render cube map content (Deltakosh)
  • Added support for utility layer for SkeletonViewer (Deltakosh)
  • Improved shader precision detection (Deltakosh)
  • Added support for bone matrix texture. Now skeletons will use a texture instead of uniforms when possible (Deltakosh)
  • Refactored of the SolidParticleSystem code for performance and code quality improvement (barroij)
  • Added utility function Tools.BuildArray for array initialisation (barroij)
  • Introduced a new IOfflineSupport interface to hide IndexedDB (Deltakosh)
  • PBRMaterial and StandardMaterial now use hot swapping feature for shaders. This means they can keep using a previous shader while a new one is being compiled (Deltakosh)
  • Performance oriented changes (barroij)
    • Prevented avoidable matrix inversion or square root computation
    • Enabled a removal in O(1) from the transformNodes array and materials array of the Scene. As a consequence, the order of the element within these arrays might change during a removal
    • Enabled a removal in O(1) from the instances array of a Mesh. As a consequence, the order of the element within this array might change during a removal
    • Stopped calling Array.splice on the scene.meshes array and on the engine._uniformBuffer when removing an element. As a consequence, the order of the element within these arrays might change during a removal
    • Added an option useGeometryIdsMap in the Scene constructor options. When set to true, each Scene isntance will have and will keep up-to-date a map of geometry per uniqueId. This is to avoid browsing all the geometries of the scene when a new one is being pushed. Disabled by default
    • Added an option useMaterialMeshMap in the Scene constructor options. When set to true, each Material isntance will have and will keep up-to-date a map of its bound meshes. This is to avoid browsing all the meshes of the scene to retrieve the ones bound to the current material when disposing the Material. Disabled by default
    • Added an option useClonedMeshhMap in the Scene constructor options. When set to true, each Mesh will have and will keep up-to-date a map of cloned meshes. This is to avoid browsing all the meshes of the scene to retrieve the ones that have the current mesh as source mesh. Disabled by default
    • Added blockfreeActiveMeshesAndRenderingGroups property in the Scene, following the same model as blockMaterialDirtyMechanism. This is to avoid calling Scene.freeActiveMeshes and Scene.freeRenderingGroups for each disposed mesh when we dispose several meshes in a row. One have to set blockfreeActiveMeshesAndRenderingGroups to true just before disposing the meshes, and set it back to false just after
    • Prevented code from doing useless and possible time consuming computation when disposing the ShaderMaterial of a LinesMesh
    • Make a better use of the isIdentity cached value wihtin a Matrix
    • Make sure we browse all the submeshes only once in Material.markAsDirty function
    • Added an Vector3.UnprojectRayToRef static function to avoid computing and inverting the projection matrix twice when updating a Ray.
  • Align BoundingBox and BoundingSphere API and behavior for clarity and simplicity. As a consequence, the BoundingBox's method setWorldMatrix has been removed and the underlying world matrix cannot be modified but by calling reConstruct or update. (barroij)
  • Make sure that Material.markAsDirty and all the markXXXDirty methods early out when scene.blockMaterialDirtyMechanism is true. (barroij)
  • Add updateUpVectorFromRotation to target camera to allow the up vector to be computed from rotation (TrevorDev)
  • Added opacity texture support to GridMaterial (Deltakosh)
  • Added support for deserializing morph target animations in animation groups
  • AssetContainer dispose method (TrevorDev)
  • Loading texture with KTX will fallback to non-KTX loader if KTX loader fails (TrevorDev)
  • Layer are now supported in RenderTargetTexture (Sebavan)
  • Make onscreen joystick's canvas public (TrevorDev)
  • Added Tools.CustomRequestHeaders, Tools.UseCustomRequestHeaders, Tools.InjectCustomRequestHeaders to send Custom Request Headers alongside XMLHttpRequest's i.e. when loading files (Tools.Loadfile) from resources requiring special headers like 'Authorization' (susares)
  • Added .serialize and .Parse functions in ReflectionProbe to retrieve reflection probes when parsing a previously serialized material (julien-moreau)
  • GizmoManager clearGizmoOnEmptyPointerEvent options and onAttachedToMeshObservable event (TrevorDev)
  • Added support for overriding the mesh used for the world matrix for a mesh with a skeleton (bghgary)
  • Added support for linking a bone to a transform node (bghgary)
  • Factored out setDirection function from lookAt for transform node (bghgary)
  • Add support for setting renderingGroupId and creating instances to AxesViewer (bghgary)
  • Invert vScale of compressed ktx textures as they are inverted in the file and UNPACK_FLIP_Y_WEBGL is not supported by ktx (TrevorDev)
  • Enable dragging in boundingBoxGizmo without needing a parent (TrevorDev)

glTF Loader

  • Added support for mesh instancing for improved performance when multiple nodes point to the same mesh (bghgary)
  • Create TransformNode objects instead of Mesh objects for glTF nodes without geometry (bghgary)
  • Added glTF JSON pointers to metadata of nodes, materials, and textures (bghgary)
  • Load KTX textures in the gltf2 loader when textureFormat is set on engine (TrevorDev)
  • Skinned meshes now behave as intended by glTF (bghgary)
    • Skinned meshes now set an override mesh instead of reparenting to the __root__ transform node
    • Loaded bones are linked with the transform node created for the corresponding glTF node

glTF Serializer

Viewer

Materials Library

  • Added the cameraOffset vector property in the SkyMaterial to get an offset according to the horizon (julien-moreau)

Bug fixes

  • Fixed TransformNode.setDirection (orientation was wrong) (Deltakosh)
  • Fixed ArcRotateCamera control when upVector was modified (Deltakosh)
  • Fixed anaglyph mode for Free and Universal cameras (Deltakosh)
  • Fixed FileLoader's loading of a skybox, & added a parsed value for whether to create with PBR or STDMaterial (Palmer-JC)
  • Removed bones from rootNodes where they should never have been (Deltakosh)
  • Refocusing on input gui with pointer events (TrevorDev)
  • Gizmo scaling not consistent when camera is parented (TrevorDev)
  • Context loss causing unexpected results with dynamic textures, geometries with the same name and reflectionTextures (TrevorDev)
  • CreateScreenshotUsingRenderTarget stretches mirror textures when setting both width and height (TrevorDev)
  • VR helper only updating vr cameras position when entering vr, rotation was missing (TrevorDev)
  • Fix VR controllers after gltfLoader transformNode change (TrevorDev)
  • Bounding Box fixedDragMeshScreenSize stopped working and allow rotating through bounding box (TrevorDev)
  • VR helper would rotate non vr camera while in VR (TrevorDev)
  • PointerDragBahavior using Mesh as base type, causing type-checking problems with AbstractMesh (Poolminer)
  • TransformNode lookAt not working in world space when node's parent has rotation (TrevorDev)
  • MakeNotPickableAndWrapInBoundingBox had unexpected behavior when input had scaling of 0 on an axis (TrevorDev)
  • Fixed an issue with loading base64 encoded images in the glTF loader (bghgary)
  • In multi-camera scenes the inspector would cause the camera's interaction events to get detached (TrevorDev)
  • Fix delete highlighted text after keyboard input, beat delay after double click event in InputText (Saket Saurabh)
  • SixDofDragBehavior will support when the camera is parented (TrevorDev)
  • Deactivate webvr lasers when not in vr (TrevorDev)
  • Update physics position using absolutePosition instead of pivotPosition (TrevorDev)

Core Engine

  • Fixed a bug with mesh.alwaysSelectAsActiveMesh preventing layerMask to be taken in account (Deltakosh)
  • Fixed a bug with pointer up being fire twice (Deltakosh)
  • Fixed a bug with particle systems being update once per camera instead of once per frame (Deltakosh)
  • Handle properly the LinesMesh intersectionThreshold by using its value directly when the intersection against a Ray is checked, instead of extending the BoundingInfo accordingly + Addded an InstancesLinesMesh class used to create instance of LinesMesh so that each instance can have its own intersectionThreshold value (barroij)
  • Fixed the LineEdgesRenderer used for edge rendering of LinesMesh handle properly LinesMesh made of disconnected lines + Make it work for instance of LinesMesh (barroij)
  • Fixed Matrix.toNormalMatrixfunction (barroij)
  • Add missing effect layer to asset container (TrevorDev)
  • Fixed effect layer compatibility with multi materials (Sebavan)
  • Added a DeepImmutable<T> type to specifiy that a referenced object should be considered recursively immutable, meaning that all its properties are readonly and that if a property is a reference to an object, this object is also recursively immutable. (barroij)
  • Fixed VideoTexture poster property when autoplay is turned off.
  • Fixed position and rotation of plane mesh created by MeshBuilder.CreatePlane when specifying a source plane (sable, bghgary)
  • Fixed inspector dynamic loading (Sebavan)
  • Fixed infiniteDistance not working anymore (Sebavan)
  • Fixed bug in SolidParticle BoundingSphere update within the SolidParticleSystem (barroij)
  • Update Picking so that when the picked Mesh is a LinesMesh, the index of the picked line is returned in the faceId property of the PickingInfo, as we do with face index the picked Mesh is made of triangle faces (barroij)
  • Do not clone mesh observables (Sebavan)
  • Fixed Inspector resolution with AMD loader (Sebavan)

Viewer

Loaders

Breaking changes

  • Database.IDBStorageEnabled is now false by default (Deltakosh)
  • Database.openAsync was renamed by Database.open (Deltakosh)
  • scene.database was renamed to scene.offlineProvider (Deltakosh)
  • BoundingBox.setWorldMatrix was removed. BoundingBox.getWorldMatrix now returns a DeepImmutable<Matrix> (barroij)
  • Matrix's accessor m and method toArray and asArray now returns a DeepImmutable<Float32Array> as the matrix underlying array is not supposed to be modified manually from the outside of the class (barroij)
  • Removed some deprecated (flagged since 3.0) properties and functions (Deltakosh)
    • scene.getInterFramePerfCounter(): use SceneInstrumentation class instead
    • scene.interFramePerfCounter: use SceneInstrumentation class instead
    • scene.getLastFrameDuration(): use SceneInstrumentation class instead
    • scene.lastFramePerfCounter: use SceneInstrumentation class instead
    • scene.getEvaluateActiveMeshesDuration(): use SceneInstrumentation class instead
    • scene.evaluateActiveMeshesDurationPerfCounter: use SceneInstrumentation class instead
    • scene.getRenderTargetsDuration(): use SceneInstrumentation class instead
    • scene.getRenderDuration(): use SceneInstrumentation class instead
    • scene.renderDurationPerfCounter: use SceneInstrumentation class instead
    • scene.getParticlesDuration(): use SceneInstrumentation class instead
    • scene.particlesDurationPerfCounter: use SceneInstrumentation class instead
    • scene.getSpritesDuration(): use SceneInstrumentation class instead
    • scene.spriteDuractionPerfCounter: use SceneInstrumentation class instead
    • engine.drawCalls: use SceneInstrumentation class instead
    • engine.drawCallsPerfCounter: use SceneInstrumentation class instead
    • shadowGenerator.useVarianceShadowMap: use useExponentialShadowMap instead
    • shadowGenerator.useBlurVarianceShadowMap: use useBlurExponentialShadowMap instead
  • The glTF loader now creates InstancedMesh objects when two nodes point to the same mesh (bghgary)
  • The glTF loader now creates TransformNode objects instead of Mesh objects for glTF nodes without geometry (bghgary)
    • Note: The root node is still a Mesh object and is still the first in the returned list of meshes
    • TransformNode objects are excluded from the returned list of meshes when importing mesh
    • TransformNode objects do not raise onMeshLoaded events
  • xAxisMesh, yAxisMesh, and zAxisMesh of AxesViewer was renamed to xAxis, yAxis, and zAxis respectively and now return a TransformNode to represent the parent node of the cylinder and line of the arrow (bghgary)