|
@@ -12,6 +12,7 @@ import { Observer } from "../Misc/observable";
|
|
import { Vector3 } from '../Maths/math.vector';
|
|
import { Vector3 } from '../Maths/math.vector';
|
|
import { Axis } from '../Maths/math';
|
|
import { Axis } from '../Maths/math';
|
|
import { SphereBuilder } from '../Meshes/Builders/sphereBuilder';
|
|
import { SphereBuilder } from '../Meshes/Builders/sphereBuilder';
|
|
|
|
+import { Material } from "../Materials/material";
|
|
|
|
|
|
declare type Camera = import("../Cameras/camera").Camera;
|
|
declare type Camera = import("../Cameras/camera").Camera;
|
|
|
|
|
|
@@ -227,14 +228,16 @@ export class VideoDome extends TransformNode {
|
|
switch (value) {
|
|
switch (value) {
|
|
case VideoDome.MODE_SIDEBYSIDE:
|
|
case VideoDome.MODE_SIDEBYSIDE:
|
|
// in half-dome mode the uScale should be double of 360 videos
|
|
// in half-dome mode the uScale should be double of 360 videos
|
|
- this._videoTexture.uScale = this._halfDome ? 1 : 0.5;
|
|
|
|
|
|
+ // Use 0.99999 to boost perf by not switching program
|
|
|
|
+ this._videoTexture.uScale = this._halfDome ? 0.99999 : 0.5;
|
|
this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
|
|
this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
|
|
this._videoTexture.uOffset = camera.isRightCamera ? 0.5 : 0.0;
|
|
this._videoTexture.uOffset = camera.isRightCamera ? 0.5 : 0.0;
|
|
});
|
|
});
|
|
break;
|
|
break;
|
|
case VideoDome.MODE_TOPBOTTOM:
|
|
case VideoDome.MODE_TOPBOTTOM:
|
|
// in half-dome mode the vScale should be double of 360 videos
|
|
// in half-dome mode the vScale should be double of 360 videos
|
|
- this._videoTexture.vScale = this._halfDome ? 1 : 0.5;
|
|
|
|
|
|
+ // Use 0.99999 to boost perf by not switching program
|
|
|
|
+ this._videoTexture.vScale = this._halfDome ? 0.99999 : 0.5;
|
|
this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
|
|
this._onBeforeCameraRenderObserver = this._scene.onBeforeCameraRenderObservable.add((camera) => {
|
|
this._videoTexture.vOffset = camera.isRightCamera ? 0.5 : 0.0;
|
|
this._videoTexture.vOffset = camera.isRightCamera ? 0.5 : 0.0;
|
|
});
|
|
});
|