|
@@ -241,6 +241,20 @@
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // Set custom projection.
|
|
|
|
+ // Needs to be before binding to prevent changing the aspect ratio.
|
|
|
|
+ if (this.activeCamera) {
|
|
|
|
+ engine.setViewport(this.activeCamera.viewport);
|
|
|
|
+
|
|
|
|
+ if (this.activeCamera !== scene.activeCamera)
|
|
|
|
+ {
|
|
|
|
+ scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ engine.setViewport(scene.activeCamera.viewport);
|
|
|
|
+ }
|
|
|
|
+
|
|
// Prepare renderingManager
|
|
// Prepare renderingManager
|
|
this._renderingManager.reset();
|
|
this._renderingManager.reset();
|
|
|
|
|
|
@@ -304,22 +318,6 @@
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // Set states for projection (this does not change accross faces)
|
|
|
|
- if (!this.isCube || faceIndex === 0) {
|
|
|
|
- if (this.activeCamera && this.activeCamera !== scene.activeCamera) {
|
|
|
|
- scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true));
|
|
|
|
- } else {
|
|
|
|
- scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true));
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- if (this.activeCamera) {
|
|
|
|
- engine.setViewport(this.activeCamera.viewport);
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- engine.setViewport(scene.activeCamera.viewport);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
this.onBeforeRenderObservable.notifyObservers(faceIndex);
|
|
this.onBeforeRenderObservable.notifyObservers(faceIndex);
|
|
|
|
|
|
// Clear
|
|
// Clear
|