immersive-web / webvr-polyfill

Use WebVR today, without requiring a special browser build.
http://immersive-web.github.io/webvr-polyfill/examples/
Apache License 2.0
1.4k stars 325 forks source link

Polyfill returns too large eye dimensions (renderWidth/renderHeight) on Essential PH-1 #324

Open drojdjou opened 6 years ago

drojdjou commented 6 years ago
Description:

When using the polyfill in Chrome on an Essential PH-1 phone (with webvr flag disabled) it doesn't find a match in the device db JSON file for that device.

1/ It would be awesome to add PH-1 into the db file. I can provide the data, though I'm not sure what those fields in the JSON mean, so I need some help with that.

2/ The polyfill falls back on some default Android settings in this case. But the eye dimensions calculated are larger than the actual screen size and the resulting WebVR viewport is too big. Would it be possible to derive those values from the screen.width and screen.height properties in case webvr is polyfilled and there is no match in the db file?

3/ If the device lookup in the JSON file fails, could you set a flag on the polyfill object? This way we could at least implement some fallback.

Additional Information:
jsantell commented 6 years ago

1) Check out https://github.com/immersive-web/webvr-polyfill-dpdb -- if you add the device there, we can consume it in the polyfill. Instructions in the README 2) Possible, to be honest I'm not terribly familiar with how these properties are calculated 3) I'm not able to check right now, but I believe the resulting VRDisplay should have some private properties accessible to see which values are used, like display.deviceInfo_

drojdjou commented 6 years ago

Thanks!

1/ I will do that

2/ Basically the problem is that if it is a polyfilled implementation, then the size of the screen is what it is, i.e. equal to window.innerWidth * window.devicePixelRatio and same for the height. The problem with the polyfill is that it comes with different numbers, unrelated to the actual size of the screen in those cases and it takes a lot of ugly patching in the code to make it scale right.