Do not resize the canvas while presenting (leads to resolution drop)#3031
Conversation
src/core/scene/a-scene.js
Outdated
| @@ -464,7 +464,7 @@ module.exports.AScene = registerElement('a-scene', { | |||
| // VR mode. The canvas is resized by VREffect following the values returned | |||
There was a problem hiding this comment.
Can we update the comment to reflect the new logic? Something like this:
Do not resize canvas If the a camera or canvas have not been injected. On VR mode, VREffect handles canvas resize based on the dimensions returned by the getEyeParameters function of the WebVR API. We want to honor those values instead of overwriting the size with the windows and width and height
There was a problem hiding this comment.
Updated, is this clear enough?
c9a93b5 to
cb25692
Compare
cb25692 to
e1b0924
Compare
|
This pr cause me a problem. After apply it, I can't get a "full" fullscreen on pc. The canvas keep the same size as normal state, with black background.After I add This jsfiddle and every example using 0.7.0 can reproduce it. |
|
I will look into it @zcfan |
Do not resize canvas in VR mode (not only for mobile, but for desktop too)
Tested on Edge + WMR, Firefox + Vive and Gear VR
Resizing the browser window while presenting leads to the canvas being resized accordingly, which updates resolution in the headset, causing a bad experience. Since Aframe does not rely on Three.js built-in mechanism for resizing the canvas this needs to be handled explicitly in a-scene.js.