1 thought on “VREffect on mobile devices force setPixelRatio to 1

  1. I believe this is correct as it is. The eyeWidth and eyeHeight already account for the full resolution of the HMD’s display, so there’s no need for any additional multiplication by devicePixelRatio.

    There are a couple reasons why the image might not look great on mobile, in particular if you’re using webvr-polyfill:

    1. The polyfill has to render to a texture, which is then passed through a post-processing effect for the distortion. In WebGL 1.0, rendering to a shader disables antialiasing, so the image looks a bit degraded. I think you could work around this (and get better performance) by doing all the distortion in a single pass in vertex shaders, which is what Cardboard Design Lab does. But that’s pretty hard.
    2. webvr-polyfill has a configuration option called BUFFER_SCALE, which is set to 0.5 by default, and forces the image to not render at full scale. You could set this higher, but you might sacrifice frame rate, which could be bad. So you need to find the right balance and test on different devices. It’s worth noting that in the Oculus best practices for mobile, they recommend only rendering at 1024×1024 per eye. And that’s for the S6, which is not the fastest phone around, but also far from the slowest.

    If you’re referring to Samsung Internet for GearVR, which does not require the polyfill, well, the webvr implementation in that browser still needs work. So don’t expect it to look great in there just yet.

Comments are closed.