Skip to content

Conversation

@olga-microsoft
Copy link
Contributor

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.

var size;
// Possible camera or canvas not injected yet.
// ON MOBILE the webvr-polyfill relies on the fullscreen API to enter
// VR mode. The canvas is resized by VREffect following the values returned
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, is this clear enough?

@olga-microsoft olga-microsoft force-pushed the msft/resize-resolution-drops branch from c9a93b5 to cb25692 Compare September 8, 2017 21:39
@olga-microsoft olga-microsoft force-pushed the msft/resize-resolution-drops branch from cb25692 to e1b0924 Compare September 8, 2017 21:43
Copy link
Member

@dmarcos dmarcos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks! 👌

@dmarcos dmarcos merged commit 4e98415 into aframevr:master Sep 8, 2017
@zcfan
Copy link

zcfan commented Sep 21, 2017

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.is('vr-mode') back, everything is fine. Is this behavior made on purpose?

This jsfiddle and every example using 0.7.0 can reproduce it.

@olga-microsoft
Copy link
Contributor Author

I will look into it @zcfan

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants