Giter Club home page Giter Club logo

Comments (15)

cvan avatar cvan commented on May 21, 2024

I noticed these other issues:

  • The back button is too large on Android (not as large as on iOS). At least on my devices, the button obscures the top corner of the left viewport.
  • The gear icon is noticeably larger on iOS than on Android.
  • Clicking on the gear icon doesn't do anything on Android (or anywhere where the Fullscreen API is supported). When I exit VR, for a few milliseconds before it disappears, I can see that the Cardboard settings modal was behind the fullscreened canvas. On iOS the menu appears because WebKit doesn't support Fullscreen.

Not sure whether you want to cover all of those issues in this one or file separate ones. Let me know - I can do that.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Thanks for testing more. Are you using webvr-samples, or using the latest
polyfill? I thought I fixed the gear issue (your #3) but I don't think
@toji updated to latest polyfill yet.

On Wed, Mar 23, 2016 at 3:24 AM chris van wiemeersch <
[email protected]> wrote:

I noticed these other issues:

  • The back button is too large on Android (not as large as on iOS). At
    least on my devices, the button obscures the top corner of the left
    viewport.
  • The gear icon is noticeably larger on iOS than on Android.
  • Clicking on the gear icon doesn't do anything on Android (or
    anywhere where the Fullscreen API is supported). When I exit VR, for a few
    milliseconds before it disappears, I can see that the Cardboard settings
    modal was behind the fullscreened canvas. On iOS the menu appears because
    WebKit doesn't support Fullscreen.

Not sure whether you want to cover all of those issues in this one or file
separate ones. Let me know - I can do that.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#46 (comment)

from webvr-polyfill.

cvan avatar cvan commented on May 21, 2024

Latest polyfill

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Things are looking a little bit better here: http://borismus.github.io/webvr-polyfill/examples/basic/. There's still a problem on iOS, which manifests when you exit VR mode. I'm not sure how to best fix it... Problem is the following:

When we go into VR mode, we redefine canvas.width and canvas.height using Object.defineProperty (https://github.com/borismus/webvr-polyfill/blob/master/src/cardboard-distorter.js#L238). When exiting VR mode, we restore canvas.width and canvas.height with its original values, which we capture using Object.getOwnPropertyDescriptor (https://github.com/borismus/webvr-polyfill/blob/master/src/cardboard-distorter.js#L68). However on iOS, these values never really get set back properly, so changing canvas.width/height values has no effect.

cc: @toji

from webvr-polyfill.

cvan avatar cvan commented on May 21, 2024

I noticed the exact same thing; spent a few hours last night trying to fix but I was unsuccessful. maybe y'all have better luck.

from webvr-polyfill.

cvan avatar cvan commented on May 21, 2024

Testing against examples/basic/, I noticed that the back button is smaller, but it's still visible within the left viewport. And the back button on iOS seems to make the screen turn black and rotating the phone back to portrait doesn't seem to resize things correctly.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

@cvan Yes, that's because iOS fails to reset the redefined width & height properties. So far my workaround attempts have not succeeded and I'm open to suggestions.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Looks like the problem is that get and set are undefined on realCanvasWidth/Height. Furthermore, renderer.domElement.__lookupGetter__('width') doesn't work in Safari at all (same for setter).

A workaround could be to use a proxy wrapper to wrap around the Canvas element, but that seems really bad. Maybe there's a way to create a JS-based getter/setter that resets the underlying canvas element?

from webvr-polyfill.

cvan avatar cvan commented on May 21, 2024

Can we instead assume that the canvas will be resized when the window gets resized and/or there's an orientation change? That way, we could just add event listeners. Thoughts?

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Not as clean, since canvas might not be fullscreen by default. We should support canvas getting resized even when the window remains fixed.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

Ok, fixed part of the problem by making a JS getter setter if getOwnPropertyDescriptor fails. But on iOS initial sizing is still wrong on requestPresent/exitPresent. 0d933e2

from webvr-polyfill.

cvan avatar cvan commented on May 21, 2024

so far, I've seen Object.getOwnPropertyDescriptor always return the correct object. you saw otherwise? is this a known WebKit bug?

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

It returns an object but get/set are undefined.

from webvr-polyfill.

toji avatar toji commented on May 21, 2024

Spent a while researching this myself, and I'm not convinced the Width/height patch we're doing it feasible on Safari (iOS or OSX). So after giving it some thought I've got an alternate proposal:

We should keep doing what we're doing on Android, but on Safari we simply don't install the width/height patch and instead check the width and height on every submitFrame. If it differs from the last values we saw resize the false backbuffer to match (after rendering the current distortion frame.) The real backbuffer will also be resized, since that's the default width/height behavior. This means that if they set the size to larger than the physical screen res (to try and get a 1:1 pixel ratio post-distortion) the real backbuffer will be too large and downscale when rendered to the screen, wasting fill rate and somewhat defeating the purpose of trying for a 1:1 ratio in the first place. Fortunately most iOS don't seem as fillrate sensitive as their contemporary android devices, so it's more of a quality issue than a performance or correctness issue. At least the resize won't break when we exit VR mode at that point, though.

from webvr-polyfill.

borismus avatar borismus commented on May 21, 2024

This is fixed, except for weird button sizing. I've worked around this for now, but the workaround is ugly and wrong: 17dc3c8. Logged a new bug to track it: #57

from webvr-polyfill.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.