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

Reality tabs guidance #295

Closed
TrevorDev opened this issue Aug 2, 2018 · 5 comments
Closed

Reality tabs guidance #295

TrevorDev opened this issue Aug 2, 2018 · 5 comments
Labels
question Further information is requested

Comments

@TrevorDev
Copy link

TrevorDev commented Aug 2, 2018

I have a webVR url: http://www.babylonjs-playground.com/frame.htm#EIX8SD#7

This page renders a sphere and enters webVR on click. It works as expected when running exokit like this:
exokit.cmd -h -l http://www.babylonjs-playground.com/frame.htm#EIX8SD#7

Buy I get unexpected results when running as a reality tab

  1. Run: exokit.cmd -h -l
  2. Type in http://www.babylonjs-playground.com/frame.htm#EIX8SD#7 and hit enter
  3. Observe sphere is rendered but when moving around with the mouse the sphere is stuck in screen space
  4. Press cntrl-1 to enter vr
  5. Observe sphere is still rendered in screen space and is not anchored in the world
  6. Expected sphere to behave as it did in non reality tab mode

The same issue happens when using emukit.webmr.io instead of the babylon link

Is there something that I'm missing?
Thanks

@avaer avaer added the question Further information is requested label Aug 2, 2018
@avaer
Copy link
Member

avaer commented Aug 2, 2018

It looks like the sites are working, except not listening for vrdisplayactivate. Exokit should be emitting vrdisplayactivate automatically.

But if it's not listened for by the site, the site won't automatically enter VR (via WebVR requestPresent, or WebXR session flow). So that means in this case Exokit is drawing the site the way it's telling us to draw it, which is not VR.

Solutions

For Emukit's part, I think it's a bug/feature request so I filed it: exokitxr/emukit#8

I'm not sure if this Babylon.js site is listening for vrdisplayactivate, but if it isn't then that would probably need to be added to the site and/or engine.

Action items

  • We can probably detect this case, so we don't render a bad reality tab that isn't VRing. Maybe we should just not blend the reality tab until it boots VR.
  • Exokit needs to document reality tabs properly!
  • Maybe we could hack around this for sites that aren't cooperating with vrdisplayactivate and use a heuristic to try to enter their VR, but this is a hard problem to solve and wouldn't be 100%.

If the Babylon.js site needs to get set up with vrdisplayactivate I'd be glad to help -- most likely it should be straightforward.

@TrevorDev
Copy link
Author

I'm using vrdisplayactivate now at this link http://www.babylonjs-playground.com/frame.htm#EIX8SD#13 and got it working alone :) I had to do a bit of hacky stuff to get it working as it seems vrDisplay.isPresenting is true even before entering vr which makes babylon's enterVR do nothing because it thinks its already in vr. Also a couple other notes/issues:

  • Exokit calls vrdisplayactivate every second even when not pressing cntrl-1 which was not expected, I expected it to be called only once when pressing cntrl 1
  • I also have http://www.babylonjs-playground.com/frame.htm#EIX8SD#14 which is the same as the other link but with the sphere moved to the right a few meters however when I launch this after the first one the background goes black and then when it comes back I still only see 1 sphere. Are they not running at the same time or do I need to do anything special with not autoclearing the screen buffer?
  • How is the home world loaded? Is there any way to replace it with my own or add my urls to the app tab for faster debugging?

Thanks!

@avaer
Copy link
Member

avaer commented Aug 4, 2018

Those sound like three quick feature requests! I can try to get at them this weekend.

Basically:

  • Constant vrdisplayactivate is known behavior but it’s not great. Much better to just emit once. I consider this a bugfix.
  • The home env is just a node module containing a site: https://github.com/webmixedreality/exokit-home;You could replace it but the reality tabs logic lives there since it’s the “browser” part. So we should probably move the reality tabs to a core feature, and allow setting some other url as home (which could then do its own reality tabs). Side note: we are rewriting the home env in React to give it an actual design.
  • The home env is capped at two reality layers right now — but there is no real reason for that. We can set it as high we want by adding more layers to the shader: https://github.com/webmixedreality/exokit-home/blob/master/js/ScreenQuad.js#L19
  • There is no way to add favorite urls to the home lists but there should be.

I’ll file these 👍, thanks for pointing them out!

@chrislatorres
Copy link
Contributor

Closing this issue due to being outdated. Most of the above issues have been closed, #308 being the exception.

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

No branches or pull requests

3 participants