Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vertex shader coordinates #306

Open
jpweeks opened this issue Feb 20, 2018 · 2 comments
Open

Vertex shader coordinates #306

jpweeks opened this issue Feb 20, 2018 · 2 comments

Comments

@jpweeks
Copy link

jpweeks commented Feb 20, 2018

Description:

I have yet to determine the underlying cause, but I am experiencing issues with using this polyfill alongside programs that perform geometric calculations in the vertex shader. I am using a technique described here to project a set of quads in screen space to appear as a continuous line with uniform width. This works well in an isolated GL context, but fails when used with this polyfill, specifically for mobile Cardboard devices. I tried isolating rendering to a framebuffer, but this also yielded unexpected results.

A demo of this issue can be viewed here, along with the source code.

Following are some screenshots from Safari desktop responsive mode as well as iOS Simulator (note I have also tested on an actual device with same results as Simulator):


no distortion

No distortion (Safari desktop responsive mode)
Vertex position calculations correct, renders as expected



distortion

Distortion (Safari iOS Simulator)
Vertex position calculations heavily skewed



distortion with FBO

Distortion with scene drawn to FBO (Safari iOS Simulator)
Vertex position calculations slightly skewed


Additional Information:
  • webvr-polyfill version: 0.10.2
  • Browser name/version/release channel: Safari, iOS 11.2
  • Operating System: iOS 11.2

[Edited to add link to demo and source code]

@jsantell
Copy link
Contributor

Thanks for filing! Seems like this could be an iOS only issue, on Android (Firefox, Chrome with WebVR disabled) it appears to be working fine. Native WebVR does not work due to Uncaught (in promise) DOMException: API can only be initiated by a user gesture..

I suspect there's an issue in how the polyfill handles distorting the views: https://github.com/immersive-web/cardboard-vr-display/blob/18251cfcf95e85d3f1e30c807ec5d94a9ec5b702/src/cardboard-distorter.js

I don't have any initial thoughts other than suspecting the issue is in the cardboard distorter, but would be a good place to investigate, perhaps one of the Utils.isIOS conditionals.

@jpweeks
Copy link
Author

jpweeks commented Feb 21, 2018

Thanks for the quick response! I've been digging through cardboard-distorter but haven't found the cause yet; I'll report back if I'm able to resolve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants