Browse Source

Merge pull request #6741 from BabylonJS/videoDome-eye-switch

Update videoDome.ts
David Catuhe 6 years ago
parent
commit
c4ef5300ce
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/Helpers/videoDome.ts

+ 3 - 1
src/Helpers/videoDome.ts

@@ -229,8 +229,10 @@ export class VideoDome extends TransformNode {
                 // in half-dome mode the uScale should be double of 360 videos
                 // Use 0.99999 to boost perf by not switching program
                 this._videoTexture.uScale = this._halfDome ? 0.99999 : 0.5;
+                const rightOffset = this._halfDome ? 0.0 : 0.5;
+                const leftOffset = this._halfDome ? 0.5 : 0.0;
                 this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
-                    this._videoTexture.uOffset = camera.isRightCamera ? 0.5 : 0.0;
+                    this._videoTexture.uOffset = camera.isRightCamera ? rightOffset : leftOffset;
                 });
                 break;
             case VideoDome.MODE_TOPBOTTOM: