浏览代码

Merge remote-tracking branch 'upstream/master' into sceneOptimization

Julien Barrois 6 年之前
父节点
当前提交
5b8c1951c8
共有 35 个文件被更改,包括 18691 次插入17939 次删除
  1. 5384 5361
      Playground/babylon.d.txt
  2. 2 1
      Tools/Gulp/config.json
  3. 1 1
      Viewer/package.json
  4. 12508 12485
      dist/preview release/babylon.d.ts
  5. 1 1
      dist/preview release/babylon.js
  6. 93 15
      dist/preview release/babylon.max.js
  7. 93 15
      dist/preview release/babylon.no-module.max.js
  8. 1 1
      dist/preview release/babylon.worker.js
  9. 95 17
      dist/preview release/es6.js
  10. 1 1
      dist/preview release/glTF2Interface/package.json
  11. 1 1
      dist/preview release/gui/babylon.gui.min.js.map
  12. 2 2
      dist/preview release/gui/package.json
  13. 1 1
      dist/preview release/inspector/babylon.inspector.bundle.js.map
  14. 5 5
      dist/preview release/inspector/package.json
  15. 2 2
      dist/preview release/loaders/package.json
  16. 2 2
      dist/preview release/materialsLibrary/package.json
  17. 2 2
      dist/preview release/postProcessesLibrary/package.json
  18. 2 2
      dist/preview release/proceduralTexturesLibrary/package.json
  19. 3 3
      dist/preview release/serializers/package.json
  20. 202 0
      dist/preview release/viewer/babylon.viewer.d.ts
  21. 2 2
      dist/preview release/viewer/babylon.viewer.js
  22. 3 3
      dist/preview release/viewer/babylon.viewer.max.js
  23. 203 1
      dist/preview release/viewer/babylon.viewer.module.d.ts
  24. 2 0
      dist/preview release/what's new.md
  25. 1 1
      inspector/src/tools/FullscreenTool.ts
  26. 1 1
      package.json
  27. 49 0
      src/Cameras/XR/babylon.webXRCamera.ts
  28. 9 1
      src/Cameras/babylon.camera.ts
  29. 1 1
      src/Culling/babylon.boundingBox.ts
  30. 2 2
      src/PostProcess/babylon.motionBlurPostProcess.ts
  31. 0 4
      src/babylon.mixins.ts
  32. 15 3
      src/babylon.scene.ts
  33. 二进制
      tests/validation/ReferenceImages/cameraRig.png
  34. 1 1
      tests/validation/config.json
  35. 1 1
      tests/validation/validation.js

文件差异内容过多而无法显示
+ 5384 - 5361
Playground/babylon.d.txt


+ 2 - 1
Tools/Gulp/config.json

@@ -1297,7 +1297,8 @@
                 "../../src/Cameras/VR/babylon.vrDeviceOrientationFreeCamera.js",
                 "../../src/Cameras/VR/babylon.vrDeviceOrientationArcRotateCamera.js",
                 "../../src/Cameras/VR/babylon.vrDeviceOrientationGamepadCamera.js",
-                "../../src/Cameras/VR/babylon.vrExperienceHelper.js"
+                "../../src/Cameras/VR/babylon.vrExperienceHelper.js",
+                "../../src/Cameras/XR/babylon.webXRCamera.js"
             ],
             "dependUpon": [
                 "core",

+ 1 - 1
Viewer/package.json

@@ -42,4 +42,4 @@
     "dependencies": {
         "pepjs": "^0.4.3"
     }
-}
+}

文件差异内容过多而无法显示
+ 12508 - 12485
dist/preview release/babylon.d.ts


文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.js


+ 93 - 15
dist/preview release/babylon.max.js

@@ -19372,7 +19372,7 @@ var BABYLON;
             vectors[7].copyFromFloats(maxX, minY, maxZ);
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
             this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
         };
         /**
@@ -23465,6 +23465,10 @@ var BABYLON;
              */
             _this.customRenderTargets = new Array();
             /**
+             * When set, the camera will render to this render target instead of the default canvas
+             */
+            _this.customDefaultRenderTarget = null;
+            /**
              * Observable triggered when the camera view matrix has changed.
              */
             _this.onViewMatrixChangedObservable = new BABYLON.Observable();
@@ -24375,6 +24379,10 @@ var BABYLON;
          */
         Camera.RIG_MODE_WEBVR = 21;
         /**
+         * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
+         */
+        Camera.RIG_MODE_CUSTOM = 22;
+        /**
          * Defines if by default attaching controls should prevent the default javascript event to continue.
          */
         Camera.ForceAttachControlToAlwaysPreventDefault = false;
@@ -26922,6 +26930,7 @@ var BABYLON;
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                var eventRaised = false;
                 if (checkPicking) {
                     var btn = evt.button;
                     clickInfo.hasSwiped = _this._isPointerSwiping();
@@ -26942,6 +26951,7 @@ var BABYLON;
                             if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== _this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
+                                eventRaised = true;
                                 cb(clickInfo, _this._currentPickResult);
                             }
                         }
@@ -27007,7 +27017,7 @@ var BABYLON;
                         }
                     }
                 }
-                else {
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, _this._currentPickResult);
                 }
@@ -29044,7 +29054,18 @@ var BABYLON;
                     step.action(this.activeCamera);
                 }
                 this._intermediateRendering = false;
-                engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                if (this.activeCamera.customDefaultRenderTarget) {
+                    var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
+                    if (internalTexture) {
+                        engine.bindFramebuffer(internalTexture);
+                    }
+                    else {
+                        BABYLON.Tools.Error("Camera contains invalid customDefaultRenderTarget");
+                    }
+                }
+                else {
+                    engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                }
             }
             this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
             // Prepare Frame
@@ -61859,10 +61880,10 @@ var BABYLON;
                 if (!this.isReady()) {
                     return;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
             // Determine the number of particles we need to create
@@ -67582,10 +67603,10 @@ var BABYLON;
                     }
                     this._preWarmDone = true;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return 0;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             // Get everything ready to render
             this._initialize();
@@ -91809,7 +91830,7 @@ var BABYLON;
      * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
      * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
      * As an example, all you have to do is to create the post-process:
-     *  var mb = new BABYLON.MotionBlurProcess(
+     *  var mb = new BABYLON.MotionBlurPostProcess(
      *      'mb', // The name of the effect.
      *      scene, // The scene containing the objects to blur according to their velocity.
      *      1.0, // The required width/height ratio to downsize to before computing the render pass.
@@ -91817,8 +91838,8 @@ var BABYLON;
      * );
      * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
      */
-    var MotionBlurProcess = /** @class */ (function (_super) {
-        __extends(MotionBlurProcess, _super);
+    var MotionBlurPostProcess = /** @class */ (function (_super) {
+        __extends(MotionBlurPostProcess, _super);
         /**
          * Creates a new instance MotionBlurPostProcess
          * @param name The name of the effect.
@@ -91831,7 +91852,7 @@ var BABYLON;
          * @param textureType Type of textures used when performing the post process. (default: 0)
          * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
          */
-        function MotionBlurProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
+        function MotionBlurPostProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
             if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             if (blockCompilation === void 0) { blockCompilation = false; }
             var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
@@ -91860,7 +91881,7 @@ var BABYLON;
             };
             return _this;
         }
-        Object.defineProperty(MotionBlurProcess.prototype, "motionBlurSamples", {
+        Object.defineProperty(MotionBlurPostProcess.prototype, "motionBlurSamples", {
             /**
              * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
              */
@@ -91881,16 +91902,16 @@ var BABYLON;
          * Disposes the post process.
          * @param camera The camera to dispose the post process on.
          */
-        MotionBlurProcess.prototype.dispose = function (camera) {
+        MotionBlurPostProcess.prototype.dispose = function (camera) {
             if (this._geometryBufferRenderer) {
                 // Clear previous transformation matrices dictionary used to compute objects velocities
                 this._geometryBufferRenderer._previousTransformationMatrices = {};
             }
             _super.prototype.dispose.call(this, camera);
         };
-        return MotionBlurProcess;
+        return MotionBlurPostProcess;
     }(BABYLON.PostProcess));
-    BABYLON.MotionBlurProcess = MotionBlurProcess;
+    BABYLON.MotionBlurPostProcess = MotionBlurPostProcess;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.motionBlurPostProcess.js.map
@@ -108208,6 +108229,63 @@ var BABYLON;
 
 //# sourceMappingURL=babylon.vrExperienceHelper.js.map
 
+
+var BABYLON;
+(function (BABYLON) {
+    /**
+     * WebXR Camera which holds the views for the xrSession
+     * @see https://doc.babylonjs.com/how_to/webxr
+     */
+    var WebXRCamera = /** @class */ (function (_super) {
+        __extends(WebXRCamera, _super);
+        /**
+         * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
+         * @param name the name of the camera
+         * @param scene the scene to add the camera to
+         */
+        function WebXRCamera(name, scene) {
+            var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
+            // Initial camera configuration
+            _this.minZ = 0;
+            _this.rotationQuaternion = new BABYLON.Quaternion();
+            _this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
+            _this._updateNumberOfRigCameras(1);
+            return _this;
+        }
+        WebXRCamera.prototype._updateNumberOfRigCameras = function (viewCount) {
+            if (viewCount === void 0) { viewCount = 1; }
+            while (this.rigCameras.length < viewCount) {
+                var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
+                newCamera.minZ = 0;
+                newCamera.parent = this;
+                this.rigCameras.push(newCamera);
+            }
+            while (this.rigCameras.length > viewCount) {
+                var removedCamera = this.rigCameras.pop();
+                if (removedCamera) {
+                    removedCamera.dispose();
+                }
+            }
+        };
+        /** @hidden */
+        WebXRCamera.prototype._updateForDualEyeDebugging = function (pupilDistance) {
+            if (pupilDistance === void 0) { pupilDistance = 0.01; }
+            // Create initial camera rigs
+            this._updateNumberOfRigCameras(2);
+            this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
+            this.rigCameras[0].position.x = -pupilDistance / 2;
+            this.rigCameras[0].customDefaultRenderTarget = null;
+            this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
+            this.rigCameras[1].position.x = pupilDistance / 2;
+            this.rigCameras[1].customDefaultRenderTarget = null;
+        };
+        return WebXRCamera;
+    }(BABYLON.FreeCamera));
+    BABYLON.WebXRCamera = WebXRCamera;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.webXRCamera.js.map
+
 // Mainly based on these 2 articles :
 // Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
 // & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/

+ 93 - 15
dist/preview release/babylon.no-module.max.js

@@ -19339,7 +19339,7 @@ var BABYLON;
             vectors[7].copyFromFloats(maxX, minY, maxZ);
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
             this._update(worldMatrix || this._worldMatrix || BABYLON.Matrix.Identity());
         };
         /**
@@ -23432,6 +23432,10 @@ var BABYLON;
              */
             _this.customRenderTargets = new Array();
             /**
+             * When set, the camera will render to this render target instead of the default canvas
+             */
+            _this.customDefaultRenderTarget = null;
+            /**
              * Observable triggered when the camera view matrix has changed.
              */
             _this.onViewMatrixChangedObservable = new BABYLON.Observable();
@@ -24342,6 +24346,10 @@ var BABYLON;
          */
         Camera.RIG_MODE_WEBVR = 21;
         /**
+         * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
+         */
+        Camera.RIG_MODE_CUSTOM = 22;
+        /**
          * Defines if by default attaching controls should prevent the default javascript event to continue.
          */
         Camera.ForceAttachControlToAlwaysPreventDefault = false;
@@ -26889,6 +26897,7 @@ var BABYLON;
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                var eventRaised = false;
                 if (checkPicking) {
                     var btn = evt.button;
                     clickInfo.hasSwiped = _this._isPointerSwiping();
@@ -26909,6 +26918,7 @@ var BABYLON;
                             if (Date.now() - _this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== _this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
+                                eventRaised = true;
                                 cb(clickInfo, _this._currentPickResult);
                             }
                         }
@@ -26974,7 +26984,7 @@ var BABYLON;
                         }
                     }
                 }
-                else {
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, _this._currentPickResult);
                 }
@@ -29011,7 +29021,18 @@ var BABYLON;
                     step.action(this.activeCamera);
                 }
                 this._intermediateRendering = false;
-                engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                if (this.activeCamera.customDefaultRenderTarget) {
+                    var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
+                    if (internalTexture) {
+                        engine.bindFramebuffer(internalTexture);
+                    }
+                    else {
+                        BABYLON.Tools.Error("Camera contains invalid customDefaultRenderTarget");
+                    }
+                }
+                else {
+                    engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                }
             }
             this.onAfterRenderTargetsRenderObservable.notifyObservers(this);
             // Prepare Frame
@@ -61826,10 +61847,10 @@ var BABYLON;
                 if (!this.isReady()) {
                     return;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             this._scaledUpdateSpeed = this.updateSpeed * (preWarmOnly ? this.preWarmStepOffset : this._scene.getAnimationRatio());
             // Determine the number of particles we need to create
@@ -67549,10 +67570,10 @@ var BABYLON;
                     }
                     this._preWarmDone = true;
                 }
-                if (this._currentRenderId === this._scene.getRenderId()) {
+                if (this._currentRenderId === this._scene.getFrameId()) {
                     return 0;
                 }
-                this._currentRenderId = this._scene.getRenderId();
+                this._currentRenderId = this._scene.getFrameId();
             }
             // Get everything ready to render
             this._initialize();
@@ -91776,7 +91797,7 @@ var BABYLON;
      * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
      * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
      * As an example, all you have to do is to create the post-process:
-     *  var mb = new BABYLON.MotionBlurProcess(
+     *  var mb = new BABYLON.MotionBlurPostProcess(
      *      'mb', // The name of the effect.
      *      scene, // The scene containing the objects to blur according to their velocity.
      *      1.0, // The required width/height ratio to downsize to before computing the render pass.
@@ -91784,8 +91805,8 @@ var BABYLON;
      * );
      * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
      */
-    var MotionBlurProcess = /** @class */ (function (_super) {
-        __extends(MotionBlurProcess, _super);
+    var MotionBlurPostProcess = /** @class */ (function (_super) {
+        __extends(MotionBlurPostProcess, _super);
         /**
          * Creates a new instance MotionBlurPostProcess
          * @param name The name of the effect.
@@ -91798,7 +91819,7 @@ var BABYLON;
          * @param textureType Type of textures used when performing the post process. (default: 0)
          * @param blockCompilation If compilation of the shader should not be done in the constructor. The updateEffect method can be used to compile the shader at a later time. (default: false)
          */
-        function MotionBlurProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
+        function MotionBlurPostProcess(name, scene, options, camera, samplingMode, engine, reusable, textureType, blockCompilation) {
             if (textureType === void 0) { textureType = BABYLON.Engine.TEXTURETYPE_UNSIGNED_INT; }
             if (blockCompilation === void 0) { blockCompilation = false; }
             var _this = _super.call(this, name, "motionBlur", ["motionStrength", "motionScale", "screenSize"], ["velocitySampler"], options, camera, samplingMode, engine, reusable, "#define SAMPLES 64.0", textureType, undefined, null, blockCompilation) || this;
@@ -91827,7 +91848,7 @@ var BABYLON;
             };
             return _this;
         }
-        Object.defineProperty(MotionBlurProcess.prototype, "motionBlurSamples", {
+        Object.defineProperty(MotionBlurPostProcess.prototype, "motionBlurSamples", {
             /**
              * Gets the number of iterations are used for motion blur quality. Default value is equal to 32
              */
@@ -91848,16 +91869,16 @@ var BABYLON;
          * Disposes the post process.
          * @param camera The camera to dispose the post process on.
          */
-        MotionBlurProcess.prototype.dispose = function (camera) {
+        MotionBlurPostProcess.prototype.dispose = function (camera) {
             if (this._geometryBufferRenderer) {
                 // Clear previous transformation matrices dictionary used to compute objects velocities
                 this._geometryBufferRenderer._previousTransformationMatrices = {};
             }
             _super.prototype.dispose.call(this, camera);
         };
-        return MotionBlurProcess;
+        return MotionBlurPostProcess;
     }(BABYLON.PostProcess));
-    BABYLON.MotionBlurProcess = MotionBlurProcess;
+    BABYLON.MotionBlurPostProcess = MotionBlurPostProcess;
 })(BABYLON || (BABYLON = {}));
 
 //# sourceMappingURL=babylon.motionBlurPostProcess.js.map
@@ -108175,6 +108196,63 @@ var BABYLON;
 
 //# sourceMappingURL=babylon.vrExperienceHelper.js.map
 
+
+var BABYLON;
+(function (BABYLON) {
+    /**
+     * WebXR Camera which holds the views for the xrSession
+     * @see https://doc.babylonjs.com/how_to/webxr
+     */
+    var WebXRCamera = /** @class */ (function (_super) {
+        __extends(WebXRCamera, _super);
+        /**
+         * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
+         * @param name the name of the camera
+         * @param scene the scene to add the camera to
+         */
+        function WebXRCamera(name, scene) {
+            var _this = _super.call(this, name, BABYLON.Vector3.Zero(), scene) || this;
+            // Initial camera configuration
+            _this.minZ = 0;
+            _this.rotationQuaternion = new BABYLON.Quaternion();
+            _this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
+            _this._updateNumberOfRigCameras(1);
+            return _this;
+        }
+        WebXRCamera.prototype._updateNumberOfRigCameras = function (viewCount) {
+            if (viewCount === void 0) { viewCount = 1; }
+            while (this.rigCameras.length < viewCount) {
+                var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
+                newCamera.minZ = 0;
+                newCamera.parent = this;
+                this.rigCameras.push(newCamera);
+            }
+            while (this.rigCameras.length > viewCount) {
+                var removedCamera = this.rigCameras.pop();
+                if (removedCamera) {
+                    removedCamera.dispose();
+                }
+            }
+        };
+        /** @hidden */
+        WebXRCamera.prototype._updateForDualEyeDebugging = function (pupilDistance) {
+            if (pupilDistance === void 0) { pupilDistance = 0.01; }
+            // Create initial camera rigs
+            this._updateNumberOfRigCameras(2);
+            this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
+            this.rigCameras[0].position.x = -pupilDistance / 2;
+            this.rigCameras[0].customDefaultRenderTarget = null;
+            this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
+            this.rigCameras[1].position.x = pupilDistance / 2;
+            this.rigCameras[1].customDefaultRenderTarget = null;
+        };
+        return WebXRCamera;
+    }(BABYLON.FreeCamera));
+    BABYLON.WebXRCamera = WebXRCamera;
+})(BABYLON || (BABYLON = {}));
+
+//# sourceMappingURL=babylon.webXRCamera.js.map
+
 // Mainly based on these 2 articles :
 // Creating an universal virtual touch joystick working for all Touch models thanks to Hand.JS : http://blogs.msdn.com/b/davrous/archive/2013/02/22/creating-an-universal-virtual-touch-joystick-working-for-all-touch-models-thanks-to-hand-js.aspx
 // & on Seb Lee-Delisle original work: http://seb.ly/2011/04/multi-touch-game-controller-in-javascripthtml5-for-ipad/

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/babylon.worker.js


文件差异内容过多而无法显示
+ 95 - 17
dist/preview release/es6.js


+ 1 - 1
dist/preview release/glTF2Interface/package.json

@@ -1,7 +1,7 @@
 {
     "name": "babylonjs-gltf2interface",
     "description": "A typescript declaration of babylon's gltf2 inteface.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/gui/babylon.gui.min.js.map


+ 2 - 2
dist/preview release/gui/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-gui",
     "description": "The Babylon.js GUI library is an extension you can use to generate interactive user interface. It is build on top of the DynamicTexture.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

文件差异内容过多而无法显示
+ 1 - 1
dist/preview release/inspector/babylon.inspector.bundle.js.map


+ 5 - 5
dist/preview release/inspector/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-inspector",
     "description": "The Babylon.js inspector.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -28,10 +28,10 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0",
-        "babylonjs-gui": "3.3.0",
-        "babylonjs-loaders": "3.3.0",
-        "babylonjs-serializers": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0",
+        "babylonjs-gui": "4.0.0-alpha.0",
+        "babylonjs-loaders": "4.0.0-alpha.0",
+        "babylonjs-serializers": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/loaders/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-loaders",
     "description": "The Babylon.js file loaders library is an extension you can use to load different 3D file types into a Babylon scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs-gltf2interface": "3.3.0"
+        "babylonjs-gltf2interface": "4.0.0-alpha.0"
     },
     "peerDependencies": {
         "babylonjs": ">=3.3.0-rc.4"

+ 2 - 2
dist/preview release/materialsLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-materials",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/postProcessesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-post-process",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 2 - 2
dist/preview release/proceduralTexturesLibrary/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-procedural-textures",
     "description": "The Babylon.js materials library is a collection of advanced materials to be used in a Babylon.js scene.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,7 +27,7 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 3 - 3
dist/preview release/serializers/package.json

@@ -4,7 +4,7 @@
     },
     "name": "babylonjs-serializers",
     "description": "The Babylon.js serializers library is an extension you can use to serialize Babylon scenes.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"
@@ -27,8 +27,8 @@
     ],
     "license": "Apache-2.0",
     "dependencies": {
-        "babylonjs": "3.3.0",
-        "babylonjs-gltf2interface": "3.3.0"
+        "babylonjs": "4.0.0-alpha.0",
+        "babylonjs-gltf2interface": "4.0.0-alpha.0"
     },
     "engines": {
         "node": "*"

+ 202 - 0
dist/preview release/viewer/babylon.viewer.d.ts

@@ -674,6 +674,208 @@ declare module BabylonViewer {
     }
 }
 declare module BabylonViewer {
+    /**
+        * BABYLON.Animation play mode enum - is the animation looping or playing once
+        */
+    export const enum AnimationPlayMode {
+            ONCE = 0,
+            LOOP = 1
+    }
+    /**
+        * An enum representing the current state of an animation object
+        */
+    export const enum AnimationState {
+            INIT = 0,
+            PLAYING = 1,
+            PAUSED = 2,
+            STOPPED = 3,
+            ENDED = 4
+    }
+    /**
+        * The different type of easing functions available
+        */
+    export const enum EasingFunction {
+            Linear = 0,
+            CircleEase = 1,
+            BackEase = 2,
+            BounceEase = 3,
+            CubicEase = 4,
+            ElasticEase = 5,
+            ExponentialEase = 6,
+            PowerEase = 7,
+            QuadraticEase = 8,
+            QuarticEase = 9,
+            QuinticEase = 10,
+            SineEase = 11
+    }
+    /**
+        * Defines a simple animation to be applied to a model (scale).
+        */
+    export interface ModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: BABYLON.Vector3;
+            /**
+                * Easing function to apply
+                * See SPECTRE.EasingFunction
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
+    /**
+        * This interface can be implemented to define new types of ModelAnimation objects.
+        */
+    export interface IModelAnimation {
+            /**
+                * Current animation state (playing, stopped etc')
+                */
+            readonly state: AnimationState;
+            /**
+                * the name of the animation
+                */
+            readonly name: string;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * BABYLON.Animation's FPS value
+                */
+            readonly fps: number;
+            /**
+                * Get or set the animation's speed ration (Frame-to-fps)
+                */
+            speedRatio: number;
+            /**
+                * Gets or sets the aimation's play mode.
+                */
+            playMode: AnimationPlayMode;
+            /**
+                * Start the animation
+                */
+            start(): any;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): any;
+            /**
+                * Pause the animation
+                * This will fail silently if the animation is not currently playing
+                */
+            pause(): any;
+            /**
+                * Reset this animation
+                */
+            reset(): any;
+            /**
+                * Restart the animation
+                */
+            restart(): any;
+            /**
+                * Go to a specific
+                * @param frameNumber the frame number to go to
+                */
+            goToFrame(frameNumber: number): any;
+            /**
+                * Dispose this animation
+                */
+            dispose(): any;
+    }
+    /**
+        * The GroupModelAnimation is an implementation of the IModelAnimation interface using BABYLON's
+        * native GroupAnimation class.
+        */
+    export class GroupModelAnimation implements IModelAnimation {
+            /**
+                * Create a new GroupModelAnimation object using an BABYLON.AnimationGroup object
+                * @param _animationGroup The aniamtion group to base the class on
+                */
+            constructor(_animationGroup: BABYLON.AnimationGroup);
+            /**
+                * Get the animation's name
+                */
+            readonly name: string;
+            /**
+                * Get the current animation's state
+                */
+            readonly state: AnimationState;
+            /**
+             * Sets the speed ratio to use for all animations
+             */
+            speedRatio: number;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Get the FPS value of this animation
+                */
+            readonly fps: number;
+            /**
+             * Set the play mode.
+             * If the animation is played, it will continue playing at least once more, depending on the new play mode set.
+             * If the animation is not set, the will be initialized and will wait for the user to start playing it.
+             */
+            playMode: AnimationPlayMode;
+            /**
+                * Reset the animation group
+                */
+            reset(): void;
+            /**
+                * Restart the animation group
+                */
+            restart(): void;
+            /**
+                *
+                * @param frameNumber Go to a specific frame in the animation
+                */
+            goToFrame(frameNumber: number): void;
+            /**
+                * Start playing the animation.
+                */
+            start(): void;
+            /**
+                * Pause the animation
+                */
+            pause(): void;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): void;
+            /**
+                * Dispose this animation object.
+                */
+            dispose(): void;
+    }
 }
 declare module BabylonViewer {
     /**

文件差异内容过多而无法显示
+ 2 - 2
dist/preview release/viewer/babylon.viewer.js


文件差异内容过多而无法显示
+ 3 - 3
dist/preview release/viewer/babylon.viewer.max.js


+ 203 - 1
dist/preview release/viewer/babylon.viewer.module.d.ts

@@ -732,7 +732,209 @@ declare module 'babylonjs-viewer/model/viewerModel' {
 }
 
 declare module 'babylonjs-viewer/model/modelAnimation' {
-    
+    import { AnimationGroup, Vector3 } from 'babylonjs';
+    /**
+        * Animation play mode enum - is the animation looping or playing once
+        */
+    export const enum AnimationPlayMode {
+            ONCE = 0,
+            LOOP = 1
+    }
+    /**
+        * An enum representing the current state of an animation object
+        */
+    export const enum AnimationState {
+            INIT = 0,
+            PLAYING = 1,
+            PAUSED = 2,
+            STOPPED = 3,
+            ENDED = 4
+    }
+    /**
+        * The different type of easing functions available
+        */
+    export const enum EasingFunction {
+            Linear = 0,
+            CircleEase = 1,
+            BackEase = 2,
+            BounceEase = 3,
+            CubicEase = 4,
+            ElasticEase = 5,
+            ExponentialEase = 6,
+            PowerEase = 7,
+            QuadraticEase = 8,
+            QuarticEase = 9,
+            QuinticEase = 10,
+            SineEase = 11
+    }
+    /**
+        * Defines a simple animation to be applied to a model (scale).
+        */
+    export interface ModelAnimationConfiguration {
+            /**
+                * Time of animation, in seconds
+                */
+            time: number;
+            /**
+                * Scale to apply
+                */
+            scaling?: Vector3;
+            /**
+                * Easing function to apply
+                * See SPECTRE.EasingFunction
+                */
+            easingFunction?: number;
+            /**
+                * An Easing mode to apply to the easing function
+                * See BABYLON.EasingFunction
+                */
+            easingMode?: number;
+    }
+    /**
+        * This interface can be implemented to define new types of ModelAnimation objects.
+        */
+    export interface IModelAnimation {
+            /**
+                * Current animation state (playing, stopped etc')
+                */
+            readonly state: AnimationState;
+            /**
+                * the name of the animation
+                */
+            readonly name: string;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Animation's FPS value
+                */
+            readonly fps: number;
+            /**
+                * Get or set the animation's speed ration (Frame-to-fps)
+                */
+            speedRatio: number;
+            /**
+                * Gets or sets the aimation's play mode.
+                */
+            playMode: AnimationPlayMode;
+            /**
+                * Start the animation
+                */
+            start(): any;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): any;
+            /**
+                * Pause the animation
+                * This will fail silently if the animation is not currently playing
+                */
+            pause(): any;
+            /**
+                * Reset this animation
+                */
+            reset(): any;
+            /**
+                * Restart the animation
+                */
+            restart(): any;
+            /**
+                * Go to a specific
+                * @param frameNumber the frame number to go to
+                */
+            goToFrame(frameNumber: number): any;
+            /**
+                * Dispose this animation
+                */
+            dispose(): any;
+    }
+    /**
+        * The GroupModelAnimation is an implementation of the IModelAnimation interface using BABYLON's
+        * native GroupAnimation class.
+        */
+    export class GroupModelAnimation implements IModelAnimation {
+            /**
+                * Create a new GroupModelAnimation object using an AnimationGroup object
+                * @param _animationGroup The aniamtion group to base the class on
+                */
+            constructor(_animationGroup: AnimationGroup);
+            /**
+                * Get the animation's name
+                */
+            readonly name: string;
+            /**
+                * Get the current animation's state
+                */
+            readonly state: AnimationState;
+            /**
+             * Sets the speed ratio to use for all animations
+             */
+            speedRatio: number;
+            /**
+                * Get the max numbers of frame available in the animation group
+                *
+                * In correlation to an arry, this would be ".length"
+                */
+            readonly frames: number;
+            /**
+                * Get the current frame playing right now.
+                * This can be used to poll the frame currently playing (and, for exmaple, display a progress bar with the data)
+                *
+                * In correlation to an array, this would be the current index
+                */
+            readonly currentFrame: number;
+            /**
+                * Get the FPS value of this animation
+                */
+            readonly fps: number;
+            /**
+             * Set the play mode.
+             * If the animation is played, it will continue playing at least once more, depending on the new play mode set.
+             * If the animation is not set, the will be initialized and will wait for the user to start playing it.
+             */
+            playMode: AnimationPlayMode;
+            /**
+                * Reset the animation group
+                */
+            reset(): void;
+            /**
+                * Restart the animation group
+                */
+            restart(): void;
+            /**
+                *
+                * @param frameNumber Go to a specific frame in the animation
+                */
+            goToFrame(frameNumber: number): void;
+            /**
+                * Start playing the animation.
+                */
+            start(): void;
+            /**
+                * Pause the animation
+                */
+            pause(): void;
+            /**
+                * Stop the animation.
+                * This will fail silently if the animation group is already stopped.
+                */
+            stop(): void;
+            /**
+                * Dispose this animation object.
+                */
+            dispose(): void;
+    }
 }
 
 declare module 'babylonjs-viewer/loader/plugins/loaderPlugin' {

+ 2 - 0
dist/preview release/what's new.md

@@ -7,6 +7,8 @@
 - Added Object Based Motion Blur post-process ([julien-moreau](https://github.com/julien-moreau))
 - WebXR ([TrevorDev](https://github.com/TrevorDev))
   - Add customAnimationFrameRequester to allow sessions to hook into engine's render loop ([TrevorDev](https://github.com/TrevorDev))
+  - camera customDefaultRenderTarget to allow cameras to render to a custom render target (eg. xr framebuffer) instead of the canvas ([TrevorDev](https://github.com/TrevorDev))
+  - webXR camera which can be updated by a webXRSession ([TrevorDev](https://github.com/TrevorDev))
 
 ## Updates
 

+ 1 - 1
inspector/src/tools/FullscreenTool.ts

@@ -14,7 +14,7 @@ export class FullscreenTool extends AbstractTool {
 
         function requestFullScreen(element: HTMLElement) {
             // Supports most browsers and their versions.
-            var requestMethod = element.requestFullscreen || element.webkitRequestFullScreen;
+            var requestMethod = element.requestFullscreen || (<any>element).webkitRequestFullScreen;
             requestMethod.call(element);
         }
 

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
     ],
     "name": "babylonjs",
     "description": "Babylon.js is a JavaScript 3D engine based on webgl.",
-    "version": "3.3.0",
+    "version": "4.0.0-alpha.0",
     "repository": {
         "type": "git",
         "url": "https://github.com/BabylonJS/Babylon.js.git"

+ 49 - 0
src/Cameras/XR/babylon.webXRCamera.ts

@@ -0,0 +1,49 @@
+module BABYLON {
+    /**
+     * WebXR Camera which holds the views for the xrSession
+     * @see https://doc.babylonjs.com/how_to/webxr
+     */
+    export class WebXRCamera extends FreeCamera {
+        /**
+         * Creates a new webXRCamera, this should only be set at the camera after it has been updated by the xrSessionManager
+         * @param name the name of the camera
+         * @param scene the scene to add the camera to
+         */
+        constructor(name: string, scene: BABYLON.Scene) {
+            super(name, BABYLON.Vector3.Zero(), scene);
+
+            // Initial camera configuration
+            this.minZ = 0;
+            this.rotationQuaternion = new BABYLON.Quaternion();
+            this.cameraRigMode = BABYLON.Camera.RIG_MODE_CUSTOM;
+            this._updateNumberOfRigCameras(1);
+        }
+
+        private _updateNumberOfRigCameras(viewCount = 1) {
+            while (this.rigCameras.length < viewCount) {
+                var newCamera = new BABYLON.TargetCamera("view: " + this.rigCameras.length, BABYLON.Vector3.Zero(), this.getScene());
+                newCamera.minZ = 0;
+                newCamera.parent = this;
+                this.rigCameras.push(newCamera);
+            }
+            while (this.rigCameras.length > viewCount) {
+                var removedCamera = this.rigCameras.pop();
+                if (removedCamera) {
+                    removedCamera.dispose();
+                }
+            }
+        }
+
+        /** @hidden */
+        public _updateForDualEyeDebugging(pupilDistance = 0.01) {
+            // Create initial camera rigs
+            this._updateNumberOfRigCameras(2);
+            this.rigCameras[0].viewport = new BABYLON.Viewport(0, 0, 0.5, 1.0);
+            this.rigCameras[0].position.x = -pupilDistance / 2;
+            this.rigCameras[0].customDefaultRenderTarget = null;
+            this.rigCameras[1].viewport = new BABYLON.Viewport(0.5, 0, 0.5, 1.0);
+            this.rigCameras[1].position.x = pupilDistance / 2;
+            this.rigCameras[1].customDefaultRenderTarget = null;
+        }
+    }
+}

+ 9 - 1
src/Cameras/babylon.camera.ts

@@ -56,6 +56,10 @@ module BABYLON {
          * Defines that both eyes of the camera should be renderered in a VR mode (webVR).
          */
         public static readonly RIG_MODE_WEBVR = 21;
+        /**
+         * Custom rig mode allowing rig cameras to be populated manually with any number of cameras
+         */
+        public static readonly RIG_MODE_CUSTOM = 22;
 
         /**
          * Defines if by default attaching controls should prevent the default javascript event to continue.
@@ -200,6 +204,10 @@ module BABYLON {
          * else in the scene.
          */
         public customRenderTargets = new Array<RenderTargetTexture>();
+        /**
+         * When set, the camera will render to this render target instead of the default canvas
+         */
+        public customDefaultRenderTarget: Nullable<RenderTargetTexture> = null;
 
         /**
          * Observable triggered when the camera view matrix has changed.
@@ -415,7 +423,7 @@ module BABYLON {
         /** @hidden */
         public _isSynchronizedViewMatrix(): boolean {
             if (!super._isSynchronized()) {
-                return false;
+                return false;
             }
 
             return this._cache.position.equals(this.position)

+ 1 - 1
src/Culling/babylon.boundingBox.ts

@@ -91,7 +91,7 @@
 
             // OBB
             max.addToRef(min, this.center).scaleInPlace(0.5);
-            max.subtractToRef(max, this.extendSize).scaleInPlace(0.5);
+            max.subtractToRef(min, this.extendSize).scaleInPlace(0.5);
 
             this._update(worldMatrix || this._worldMatrix || Matrix.Identity());
         }

+ 2 - 2
src/PostProcess/babylon.motionBlurPostProcess.ts

@@ -3,7 +3,7 @@ module BABYLON {
      * The Motion Blur Post Process which blurs an image based on the objects velocity in scene.
      * Velocity can be affected by each object's rotation, position and scale depending on the transformation speed.
      * As an example, all you have to do is to create the post-process:
-     *  var mb = new BABYLON.MotionBlurProcess(
+     *  var mb = new BABYLON.MotionBlurPostProcess(
      *      'mb', // The name of the effect.
      *      scene, // The scene containing the objects to blur according to their velocity.
      *      1.0, // The required width/height ratio to downsize to before computing the render pass.
@@ -11,7 +11,7 @@ module BABYLON {
      * );
      * Then, all objects moving, rotating and/or scaling will be blurred depending on the transformation speed.
      */
-    export class MotionBlurProcess extends PostProcess {
+    export class MotionBlurPostProcess extends PostProcess {
         /**
          * Defines how much the image is blurred by the movement. Default value is equal to 1
          */

+ 0 - 4
src/babylon.mixins.ts

@@ -155,10 +155,6 @@ interface HTMLVideoElement {
     mozSrcObject: any;
 }
 
-interface Element {
-    webkitRequestFullScreen: () => void;
-}
-
 interface Screen {
     readonly orientation: string;
     readonly mozOrientation: string;

+ 15 - 3
src/babylon.scene.ts

@@ -1894,6 +1894,7 @@ module BABYLON {
                         checkPicking = act.hasPickTriggers;
                     }
                 }
+                let eventRaised = false;
                 if (checkPicking) {
                     let btn = evt.button;
                     clickInfo.hasSwiped = this._isPointerSwiping();
@@ -1918,7 +1919,7 @@ module BABYLON {
                             if (Date.now() - this._previousStartingPointerTime > Scene.DoubleClickDelay ||
                                 btn !== this._previousButtonPressed) {
                                 clickInfo.singleClick = true;
-
+                                eventRaised = true;
                                 cb(clickInfo, this._currentPickResult);
                             }
                         }
@@ -1986,7 +1987,9 @@ module BABYLON {
                             }
                         }
                     }
-                } else {
+                }
+
+                if (!eventRaised) {
                     clickInfo.ignore = true;
                     cb(clickInfo, this._currentPickResult);
                 }
@@ -4403,7 +4406,16 @@ module BABYLON {
 
                 this._intermediateRendering = false;
 
-                engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                if (this.activeCamera.customDefaultRenderTarget) {
+                    var internalTexture = this.activeCamera.customDefaultRenderTarget.getInternalTexture();
+                    if (internalTexture) {
+                        engine.bindFramebuffer(internalTexture);
+                    }else {
+                        Tools.Error("Camera contains invalid customDefaultRenderTarget");
+                    }
+                }else {
+                    engine.restoreDefaultFramebuffer(); // Restore back buffer if needed
+                }
             }
 
             this.onAfterRenderTargetsRenderObservable.notifyObservers(this);

二进制
tests/validation/ReferenceImages/cameraRig.png


+ 1 - 1
tests/validation/config.json

@@ -14,7 +14,7 @@
     },
     {
       "title": "Camera rig",
-      "playgroundId": "#ATL1CS#6",
+      "playgroundId": "#ATL1CS#9",
       "referenceImage": "cameraRig.png"
     },
     {

+ 1 - 1
tests/validation/validation.js

@@ -235,7 +235,7 @@ function runTest(index, done) {
         var snippetUrl = "//babylonjs-api2.azurewebsites.net/snippets";
         var pgRoot = "/Playground"
 
-        var retryTime = 30 * 1000;
+        var retryTime = 500;
         var maxRetry = 2;
         var retry = 0;