|
@@ -29,6 +29,8 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
let referenceSpace = null;
|
|
|
let referenceSpaceType = 'local-floor';
|
|
|
+ // Set default foveation to maximum.
|
|
|
+ let foveation = 1.0;
|
|
|
let customReferenceSpace = null;
|
|
|
|
|
|
let pose = null;
|
|
@@ -338,8 +340,7 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
newRenderTarget.isXRRenderTarget = true; // TODO Remove this when possible, see #23278
|
|
|
|
|
|
- // Set foveation to maximum.
|
|
|
- this.setFoveation( 1.0 );
|
|
|
+ this.setFoveation( foveation );
|
|
|
|
|
|
customReferenceSpace = null;
|
|
|
referenceSpace = await session.requestReferenceSpace( referenceSpaceType );
|
|
@@ -568,36 +569,32 @@ class WebXRManager extends EventDispatcher {
|
|
|
|
|
|
this.getFoveation = function () {
|
|
|
|
|
|
- if ( glProjLayer !== null ) {
|
|
|
-
|
|
|
- return glProjLayer.fixedFoveation;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( glBaseLayer !== null ) {
|
|
|
+ if ( glProjLayer === null && glBaseLayer === null ) {
|
|
|
|
|
|
- return glBaseLayer.fixedFoveation;
|
|
|
+ return undefined;
|
|
|
|
|
|
}
|
|
|
|
|
|
- return undefined;
|
|
|
+ return foveation;
|
|
|
|
|
|
};
|
|
|
|
|
|
- this.setFoveation = function ( foveation ) {
|
|
|
+ this.setFoveation = function ( value ) {
|
|
|
|
|
|
// 0 = no foveation = full resolution
|
|
|
// 1 = maximum foveation = the edges render at lower resolution
|
|
|
|
|
|
+ foveation = value;
|
|
|
+
|
|
|
if ( glProjLayer !== null ) {
|
|
|
|
|
|
- glProjLayer.fixedFoveation = foveation;
|
|
|
+ glProjLayer.fixedFoveation = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
if ( glBaseLayer !== null && glBaseLayer.fixedFoveation !== undefined ) {
|
|
|
|
|
|
- glBaseLayer.fixedFoveation = foveation;
|
|
|
+ glBaseLayer.fixedFoveation = value;
|
|
|
|
|
|
}
|
|
|
|