Skip to content

@deltakosh deltakosh released this Apr 30, 2019 · 863 commits to master since this release

4.0.0

Major updates

Optimizations

  • Added an engine creation option to compile all shaders with medium precision (Deltakosh)
  • Optimized effect reused for shadow maps (Deltakosh)
  • Added support for scissor testing (Deltakosh)
  • Improved shader precision detection (Deltakosh)
  • Added support for bone matrix texture, allowing skeletons to use a texture instead of uniforms when possible (Deltakosh)
  • Refactored of the SolidParticleSystem code for performance and code quality improvement (barroij)
  • Added per solid particle culling possibility: solidParticle.isInFrustum() (jerome)
  • Performance-oriented changes (barroij):
    • Prevented avoidable matrix inversion or square root computation.
    • Enabled constant-time removal 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 constant-time removal 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 useGeometryUniqueIdsMap 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. It also enables a removal of geometry in constant time. 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. Enable by setting blockfreeActiveMeshesAndRenderingGroups to true just before disposing the meshes, then 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 within 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.
  • Added per mesh culling strategy (jerome)

Updates

GUI

  • Added inputText.onKeyboardEventProcessedObservable (Deltakosh)
  • Added button.image and button.textBlock to simplify access to button internal parts (Deltakosh)
  • Added slider.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 reflectionMatrix support for more coordinatesMode's (Dennis Dervisis)
  • Added new WebRequest class to centralize all network requests. Can be used to configure headers of all network requests (Deltakosh)
  • Added WebRequest.CustomRequestHeaders, WebRequest.UseCustomRequestHeaders to send Custom Request Headers alongside XMLHttpRequest's i.e. when loading files (Tools.Loadfile) from resources requiring special headers like 'Authorization' (susares)
  • Added support for user clip planes to LineMeshes (Deltakosh)
  • Added shadowGenerator.onBeforeShadowMapRenderMeshObservable (Deltakosh)
  • Added support for scene.customLODSelector to let users define their own LOD rules (Deltakosh)
  • Added animatable.onAnimationLoopObservable (Deltakosh)
  • Added animationGroup.onAnimationLoopObservable (Deltakosh)
  • Added FlyCamera for free navigation in 3D space, with a limited set of settings (Phuein)
  • Added Engine.onNewSceneAddedObservable (Deltakosh)
  • Added new PassCubePostProcess to render cube map content (Deltakosh)
  • Added support for utility layer for SkeletonViewer (Deltakosh)
  • 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, allowing them to keep using a previous shader while a new one is being compiled (Deltakosh)
  • Aligned BoundingBox and BoundingSphere API and behavior for clarity and simplicity, removing BoundingBox's method setWorldMatrix and disallowing modification of the underlying world matrix except 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 wrap boolean parameter to CreateBox options to orientate images vertically on box sides (JohnK)
  • 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)
  • Made onscreen joystick's canvas public (TrevorDev)
  • Added .serialize and .Parse functions in ReflectionProbe to retrieve reflection probes when parsing a previously serialized material (julien-moreau)
  • Added clearGizmoOnEmptyPointerEvent options and onAttachedToMeshObservable event to GizmoManager (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)
  • Added support for setting renderingGroupId and creating instances to AxesViewer (bghgary)
  • Added vScale inversion of compressed KTX textures as they are inverted in the file and UNPACK_FLIP_Y_WEBGL is not supported by KTX (TrevorDev)
  • Enabled dragging in boundingBoxGizmo without needing a parent (TrevorDev)
  • Added InputsManager and keyboard bindings for FollowCamera (mrdunk)
  • Fixed typo in FollowCamera InputsManager when limiting rotation to 360 degrees (mrdunk)
  • In FollowCamera InputsManager, allowed choice of modifier key (Alt, Ctrl and/or Shift) for each camera movement axis (mrdunk)
  • Added MouseWheel bindings for FollowCamera (mrdunk)
  • Tweaked MouseWheel bindings for FollowCamera orientations (mrdunk)
  • Added maximum and minimum limits for FollowCamera parameters (mrdunk)
  • Converted ArcRotateCamera to use new BaseCameraPointersInput (mrdunk)
  • Added transparency support to GlowLayer (Sebavan)
  • Added option forceDisposeChildren to multiMaterial.dispose (danjpar)
  • Added Pointer bindings for FollowCamera (mrdunk)
  • Added Inspector light gizmo with icons (TrevorDev)
  • Added option multiMultiMaterials to mesh.mergeMeshes (danjpar)
  • Exposed fallback camera distortion metrics option in vrExperienceHelper (TrevorDev)
  • Added OnAfterEnteringVRObservable to webVRHelper (TrevorDev)
  • Added support for side by side and top/bottom VR videos in the video dome (Sebavan)
  • Added unit tests for BaseCameraPointersInput and ArcRotateCameraPointersInput (mrdunk)
  • Prevented onActiveCameraChanged from being fired when rendering rig cameras (TrevorDev)
  • Added MeshExploder class (danjpar)
  • Enabled Observables to make observers top or bottom priority (TrevorDev)
  • Prevented mesh outline from being shown through the mesh when it's transparent (TrevorDev)
  • Prevented DeviceOrientationCamera from being modified by mouse input when the orientation sensor is active (TrevorDev)
  • Added LoadScriptAsync tools helper function MackeyK24)
  • Added customShaderNameResolve to PBRMaterialBase to allow subclasses to specify custom shader information MackeyK24)
  • Added PBRCustomMaterial to material library to allow easy subclassing of PBR materials MackeyK24)
  • Added custom defines for roughness and microsurface in PBRCustomMaterial Lockphase)
  • Added auto-exposure support in StandardRenderingPipeline when HDR is enabled (julien-moreau)
  • Added EquiRectangularCubeTexture class to enable the usage of browser-canvas supported images as CubeTextures (Dennis Dervisis)
  • Added EquiRectangularCubeTextureAssetTask to be able to load EquiRectangularCubeTextures via Asset Manager (Dennis Dervisis)
  • Added Matrix.RotationAlignToRef method to obtain rotation matrix from one vector to another (sable)
  • ArcRotateCamera will now cache the necessary matrices when modifying its upVector, instead of calculating them each time they're needed (sable)
  • Updated DracoCompression to use web workers (bghgary)
  • Added LOD Babylon Mesh Entities to support to babylonFileLoader.ts (MackeyK24)

OBJ Loader

  • Added color vertex support (not part of standard) (brianzinn)
  • Added option for silently failing when materials fail to load (brianzinn)
  • Added option to skip loading materials (brianzinn)

glTF Loader

  • Added support for mesh instancing for improved performance when multiple nodes point to the same mesh (bghgary)
  • Switched to 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)
  • Enabled loading KTX textures in the gltf2 loader when textureFormat is set on engine (TrevorDev)
  • Fixed skinned meshes to behave as intended by glTF (bghgary)
    • Set an override mesh on skinned meshes instead of reparenting to the __root__ transform node
    • Linked loaded bones to the transform node created for the corresponding glTF node
  • Improved load performance by blocking material dirtying during load (bghgary)
  • Added animation group target override to support custom animation targets (MackeyK24)
  • Added loadMeshPrimitiveAsync extension support (MackeyK24)

glTF Serializer

  • Added support for exporting KHR_lights_punctual
  • Prevented mesh normals from being flipped when exporting a glTF from a Babylon scene with right-handed coordinate system (Nicholas Barlow)

Post-Processes Library

Materials Library

  • Added the cameraOffset vector property in the SkyMaterial to get an offset according to the horizon (julien-moreau)
  • Fixed GradientMaterial to consider disableLighting working as emissive (julien-moreau)
  • Fixed fresnel term computation in WaterMaterial (julien-moreau)
  • Fixed TerrainMaterial.isReadyForSubMesh to remove WebGL warnings (julien-moreau)
  • Fixed MixMaterial.isReadyForSubMesh to remove WebGL warnings (dad72)

Infrastructure

  • Migrated CI to Azure DevOps pipelines (Sebavan)
  • Created test suites for both WebGL1 and WebGL2 (Sebavan)

Bug fixes

  • Fixed ArcRotateCamera.setTarget (position was sometimes wrong) (Deltakosh)
  • 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 and 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, laser distance stopped working (TrevorDev)
  • Fixed VR controllers after gltfLoader transformNode was changed (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)
  • Fixed delete highlighted text after keyboard input, beat delay after double click event in InputText (Saket Saurabh)
  • Fixed SixDofDragBehavior when the camera is parented (TrevorDev)
  • Deactivate WebVR lasers when not in VR (TrevorDev)
  • Update physics position using absolutePosition instead of pivotPosition (TrevorDev)
  • Disabled camera arrow key controls when the command key is pressed on Mac OS (kcoley)
  • Viewer should not set receiveShadows on an instanced mesh (TrevorDev)
  • Rotation/scaling snapping not working in the negative direction (TrevorDev)
  • Updated comment in TransformNode.rotationQuaternion to include undefined as one of the potential return values (nathankmiller)
  • Cannon.js ignores connectedPivot joint parameter (TrevorDev)
  • Fixed case sensitive paths (mrdunk)
  • Fixed more case sensitive paths (mrdunk)
  • Attaching a BoundingBoxGizmo on a child node shouldn't remove its parent, rotation gizmo should work on object with parent (TrevorDev)
  • ammo.js fix including issue caused after modules update and use world contact point to be consistent with Oimo and Cannon (TrevorDev)
  • Warn of motor with maxForce in Oimo plugin and set default force to be consistent with others, Cannon.js support no impostor, Cannon.js cylinder axis, ammo.js wake up impostor when apply force/impulse (TrevorDev)
  • Utility layer should render on last active camera (TrevorDev)
  • PointerDragBehavior should not let the drag plane get out of sync when rotating the object during dragging (TrevorDev)
  • Do not crash the application if WebVR submitFrame fails (TrevorDev)
  • Fix pinch action on FollowCameraPointersInput (mrdunk)
  • Tools.CreateScreenshot stopped working (TrevorDev)
  • Inspector showing duplicate nodes when attached to gizmo (TrevorDev)
  • Added missing dependencies for files to support including them from a direct path (eg. import "@babylonjs/core/Helpers/sceneHelpers";) (TrevorDev)
  • AssetContainer should not dispose objects it doesn't contain. Support for environmentTexture add/remove (TrevorDev)
  • Fixed mesh.visibility not working properly when certain material properties are set that changes the interpretation of alpha (e.g. refraction, specular over alpha, etc.) (bghgary)
  • Fixed material and texture leak when loading/removing GLTF/obj/babylon files with AssetContainer (TrevorDev)
  • Avoid exception when removing impostor during cannon world step (TrevorDev)
  • Fixed ArcRotateCamera divide by zero error (when looking along up axis) in rebuildAnglesAndRadius (sable)
  • Fixed ArcRotateCamera rebuildAnglesAndRadius when upVector modified (sable)
  • Fixed code branch, that does not try to (re)load an EquiRectangularCubeTexture/HDRCubeTexture when the caching returns an empty or corrupt InternalTexture (Dennis Dervisis)
  • Added error event listener (bubbling up the onError callback chain) in case an EquiRectangularCubeTexture cannot be loaded, because of a wrong path or IO problems (Dennis Dervisis)
  • 3D GUI buttons no longer will scale up when pressing with a multitouch device (TrevorDev)
  • 2D GUI elements will use the last clicked controller instead of only the right controller when dual VR controllers are interacting with an element (TrevorDev)
  • Virtual keyboard not showing up when made visible (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)
  • Properly handled the LinesMesh intersectionThreshold by using its value directly when the intersection against a Ray is checked instead of extending the BoundingInfo accordingly (barroij)
  • Added 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 to properly handle LinesMeshs made of disconnected lines and made it work for instance of LinesMesh (barroij)
  • Fixed Matrix.toNormalMatrix function (barroij)
  • Added 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)
  • Updated 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)
  • Fixed unintentional cloning of mesh observables (Sebavan)
  • Fixed Inspector resolution with AMD loader (Sebavan)
  • Fixed a bug when a call to updateIndices leads to changing the size of the index buffer by recreating the subMeshes in that case (barroij)
  • Added option to disable gazeTracker color changes in vrExperienceHelper (TrevorDev)
  • Added PointerDragBehavior validateDrag predicate to stop dragging to specific points (TrevorDev)
  • Added Auto Update Touch Action #5674(Sebavan)
  • Added hemispheric lighting to gizmos to avoid flat look (TrevorDev)
  • Fixed a bug causing WebRequest.open to crash if WebRequest.CustomRequestHeaders are set #6055(susares)
  • Fixed a bug causing Mesh.clone to crash if no physicsEngineComponent is used (barroij)
  • Fixed zoom inertia making it difficult to zoom out with ArcRotateCamera (TrevorDev)
  • Added option for isInFrustum to check rigCameras so that viewMatrix updates for rigCameras can notify their parent (TrevorDev)
  • Properly handled unindexed LinesMesh (rendering and picking) (barroij)

Loaders

  • Added missing loadedAnimationGroups to MeshAssetTask (bghgary)
  • Added missing linkTransformNode to BabylonFileLoader (MackeyK24)

Breaking changes

  • Replaced all references to XmlHttpRequest with WebRequest (which provides the same signatures) (Deltakosh)
  • Set Database.IDBStorageEnabled to false by default (Deltakosh)
  • Renamed Database.openAsync to Database.open (Deltakosh)
  • Renamed scene.database to scene.offlineProvider (Deltakosh)
  • Removed BoundingBox.setWorldMatrix and changed BoundingBox.getWorldMatrix to return a DeepImmutable<Matrix> (barroij)
  • Changed Matrix's accessor m and methods toArray and asArray to return a DeepImmutable<Float32Array> as the 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, all of which are superceded by the SceneInstrumentation class unless otherwise specified (Deltakosh)
    • scene.getInterFramePerfCounter()
    • scene.interFramePerfCounter
    • scene.getLastFrameDuration()
    • scene.lastFramePerfCounter
    • scene.getEvaluateActiveMeshesDuration()
    • scene.evaluateActiveMeshesDurationPerfCounter
    • scene.getRenderTargetsDuration()
    • scene.getRenderDuration()
    • scene.renderDurationPerfCounter
    • scene.getParticlesDuration()
    • scene.particlesDurationPerfCounter
    • scene.getSpritesDuration()
    • scene.spriteDuractionPerfCounter
    • engine.drawCalls
    • engine.drawCallsPerfCounter
    • shadowGenerator.useVarianceShadowMap (superceded by useExponentialShadowMap)
    • shadowGenerator.useBlurVarianceShadowMap (superceded by useBlurExponentialShadowMap)
  • 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
  • Renamed xAxisMesh, yAxisMesh, and zAxisMesh of AxesViewer to xAxis, yAxis, and zAxis respectively and changed return to a TransformNode to represent the parent node of the cylinder and line of the arrow (bghgary)
  • Disallowed passing the engine into Viewport.toglobal to prevent circular dependency (Sebavan)
  • Moved Vector3.UnprojectRayToRef to Ray.unprojectRayToRef instance method to decrease class coupling (Sebavan)
  • Moved Material.ParseMultiMaterial to MultiMaterial.ParseMultiMaterial to decrease class coupling (Sebavan)
  • Removed babylon.no-module.max.js javascript version has the Webpack UMD bundle covers both ([Sebavan]
    (https://github.com/Sebavan))
  • Removed es6.js javascript as it is now available as a true es6 NPM package (Sebavan)
  • Removed babylon.worker.js javascript following the lack of usage from the feature ([Sebavan]
    (https://github.com/Sebavan))
  • Removed Primitive Geometries as they were not in use since 2.0 (Sebavan)
  • Changed shouldExportTransformNode callback in glTF serializer options to shouldExportNode (kcoley)
  • Changed PhysicsHelper method parameters for event calls (bobalazek)
Assets 2
You can’t perform that action at this time.