|
@@ -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;
|
|
@@ -29046,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
|
|
@@ -91811,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.
|
|
@@ -91819,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.
|
|
@@ -91833,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;
|
|
@@ -91862,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
|
|
|
*/
|
|
@@ -91883,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
|
|
@@ -108210,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/
|