Explorar el Código

Eliminated hardcoded dimension, added support for pixel ratio.

Aside to mrdoob: should the WebGLRenderer provide getSize() => {width:
..., height: ...} element that takes into account pixel ratio?
Boris Smus hace 10 años
padre
commit
6ec0e0a8c9
Se han modificado 1 ficheros con 2 adiciones y 4 borrados
  1. 2 4
      examples/js/effects/VREffect.js

+ 2 - 4
examples/js/effects/VREffect.js

@@ -156,11 +156,9 @@ THREE.VREffect = function ( renderer, done ) {
 		}
 		// VR Mode enabled
 		this._canvasOriginalSize = {
-			width: renderer.domElement.width,
-			height: renderer.domElement.height
+			width: renderer.domElement.width / renderer.getPixelRatio(),
+			height: renderer.domElement.height / renderer.getPixelRatio()
 		};
-		// Hardcoded Rift display size
-		renderer.setSize( 1280, 800, false );
 		this.startFullscreen();
 	};