|
@@ -13,6 +13,8 @@ import { Node } from "../../node";
|
|
import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
import { AbstractMesh } from "../../Meshes/abstractMesh";
|
|
import { Ray } from "../../Culling/ray";
|
|
import { Ray } from "../../Culling/ray";
|
|
import { HemisphericLight } from "../../Lights/hemisphericLight";
|
|
import { HemisphericLight } from "../../Lights/hemisphericLight";
|
|
|
|
+import { Logger } from '../../Misc/logger';
|
|
|
|
+import { VRMultiviewToSingleview } from '../../PostProcesses/vrDistortionCorrectionPostProcess';
|
|
|
|
|
|
// Side effect import to define the stereoscopic mode.
|
|
// Side effect import to define the stereoscopic mode.
|
|
import "../RigModes/webVRRigMode";
|
|
import "../RigModes/webVRRigMode";
|
|
@@ -140,6 +142,10 @@ export interface WebVROptions {
|
|
*/
|
|
*/
|
|
defaultHeight?: number;
|
|
defaultHeight?: number;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * If multiview should be used if availible (default: false)
|
|
|
|
+ */
|
|
|
|
+ useMultiview?: boolean;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -277,6 +283,16 @@ export class WebVRFreeCamera extends FreeCamera implements PoseControlled {
|
|
this._frameData = new VRFrameData();
|
|
this._frameData = new VRFrameData();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ if (webVROptions.useMultiview) {
|
|
|
|
+ if (!this.getScene().getEngine().getCaps().multiview) {
|
|
|
|
+ Logger.Warn("Multiview is not supported, falling back to standard rendering");
|
|
|
|
+ this._useMultiviewToSingleView = false;
|
|
|
|
+ }else {
|
|
|
|
+ this._useMultiviewToSingleView = true;
|
|
|
|
+ this._rigPostProcess = new VRMultiviewToSingleview("VRMultiviewToSingleview", this, 1.0);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* The idea behind the following lines:
|
|
* The idea behind the following lines:
|
|
* objects that have the camera as parent should actually have the rig cameras as a parent.
|
|
* objects that have the camera as parent should actually have the rig cameras as a parent.
|