immersive-web / cardboard-vr-display

A JavaScript implementation of a WebVR 1.1 VRDisplay
https://immersive-web.github.io/cardboard-vr-display
Apache License 2.0
91 stars 43 forks source link

Object added to Camera appear incorrectly positioned. #21

Closed devasur closed 6 years ago

devasur commented 6 years ago

I am facing a problem with reticle display after upgrading to Polyfill 0.10.4. The Reticle (added fixed position 1 unit in front of camera) appears shifted horizontally towards edges on both left and right viewport. Because of this, while scene distortion is accurate, reticles appear duplicate. I am unable to pinpoint the root cause of the problem. If I roll back to polyfill 0.9.x the problem disappears.

Screen Shots (Compare positions of the white circle)

0.9.x (Reticles are centered)

screenshot_20180321-152617_polyfill941

0.10.x (Reticles are shifted to left and right edges on each viewport) screenshot_20180321-152617_polyfill0 10 4

If these two images are super imposed you can see the offset very clearly.

vr_reticle_superimposed

Do you have any clue? Reticle is added to the camera, not scene.

devasur commented 6 years ago

Rewrote the same using polyfill 0.10.4 and rayinput by @borismus . I can see the same offset issue for the gaze reticle. Will build a smaller test case and share. But this seems like a real issue to me.

jsantell commented 6 years ago

What browser are you seeing this in? Could you try chrome m65 and m67 (canary)?

jsantell commented 6 years ago

I think this is the same issue as https://github.com/immersive-web/webvr-polyfill/issues/312, thank you for the reproduction case, the reticle trick should help in tracking down the issue more

devasur commented 6 years ago

I was able to reproduce this on m65, m66 (dev) abd m67 (canary). All on android.

devasur commented 6 years ago

Confirming, ghosting has nothing to do with reticle. It is purely a parameter of distance from camera. Also observed some ghosting even when object is ~10m from camera. But after some time (gyroscope movements) ghosting disappeared for objects > ~10m. This is not consistent. But may be useful for you to troubleshoot. For now I have moved the reticle to 12m as a work around.

jsantell commented 6 years ago

This was tracked down to this: https://github.com/immersive-web/cardboard-vr-display/commit/82de07f2eae7306ee65cf05ea7b0f8185216b864

Also added was a reticle to the example to track issues with objects closer to the camera so we can avoid similar issues in the future