Browse Source

Added framebuffer scaling back in

Firepal 5 years ago
parent
commit
263f12d4ca
1 changed files with 10 additions and 4 deletions
  1. 10 4
      src/renderers/webxr/WebXRManager.js

+ 10 - 4
src/renderers/webxr/WebXRManager.js

@@ -16,7 +16,7 @@ function WebXRManager( renderer, gl ) {
 
 	var session = null;
 
-	// var framebufferScaleFactor = 1.0;
+	var framebufferScaleFactor = 1.0;
 
 	var referenceSpace = null;
 	var referenceSpaceType = 'local-floor';
@@ -166,9 +166,14 @@ function WebXRManager( renderer, gl ) {
 
 	}
 
-	this.setFramebufferScaleFactor = function ( /* value */ ) {
+	this.setFramebufferScaleFactor = function ( value ) {
 
-		// framebufferScaleFactor = value;
+		framebufferScaleFactor = value;
+		
+		// Warn if function is used while presenting
+		if(scope.isPresenting == true){
+		console.warn("WebXRManager: Cannot change framebuffer scale while presenting VR content");
+		}
 
 	};
 
@@ -210,7 +215,8 @@ function WebXRManager( renderer, gl ) {
 				antialias: attributes.antialias,
 				alpha: attributes.alpha,
 				depth: attributes.depth,
-				stencil: attributes.stencil
+				stencil: attributes.stencil,
+				framebufferScaleFactor: framebufferScaleFactor
 			};
 
 			// eslint-disable-next-line no-undef