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

Support for VR headsets #82

Open
hhkaos opened this issue Jun 18, 2015 · 69 comments
Open

Support for VR headsets #82

hhkaos opened this issue Jun 18, 2015 · 69 comments

Comments

@hhkaos
Copy link

hhkaos commented Jun 18, 2015

I was thinking the other day that it would be great to make an app like Google Expeditions for Google Cardboad but using web technologies (p.e. mixing Pannellum + Ionic Framework).

What do you think about doing a pannellum's fork to start a Pannellum Cardboard o something like this?

Cheers!
Raul

@mpetroff
Copy link
Owner

I think adding WebVR support directly to Pannellum might be a better route, as this would (eventually) allow a variety of VR headsets to be supported. From what I've read, there's currently WebVR support in Firefox Nightly for the Oculus Rift only, with plans to add Cardboard support, and there are experimental Chromium builds that support WebVR for both the Rift and Cardboard.

There's also the school of thought that VR is sufficiently different from the regular viewer and shouldn't be integrated directly as it requires a completely different UI. In this case, it would make the most sense to write a separate Pannellum VR viewer using libpannellum.

@ofekd
Copy link

ofekd commented Jun 22, 2015

I've been able to use this (somewhat) successfully on Firefox for Android:
https://vr.chromeexperiments.com/

I guess it doesn't use WebVR - are you insistent on waiting for it?

Thanks for looking into it 👍

@hhkaos
Copy link
Author

hhkaos commented Jun 22, 2015

Hi guys!

I have tried both :), WebVR doesn't work very good in my phones (LG G3 and Nexus 5) but it seem to work better on my desktop. It crashes in Firefox and in Chrome very frequently.

About Chrome Experiments works great.

But I also tried:

It works better than WebVR but not on every phone I think.

Thanks!

@ofekd
Copy link

ofekd commented Jul 18, 2015

@mpetroff - what's your current view on this? We would like to start development and are wondering about integration vs separate viewer. In any case we will probably do something similar to Chrome Experiments.

@mpetroff
Copy link
Owner

I don't feel particularly strongly about VR, so any sort of implementation isn't a priority for me, particularly since VR technology and standards have yet to stabilize. At the moment, I'd tend toward a separate viewer since I'm not sure I want to integrate something that's still in so much flux (and I haven't implemented a plugin architecture yet, which would be a happy medium between integration and a separate viewer).

@ofekd
Copy link

ofekd commented Jul 19, 2015

It looks like having a plugin architecture along with a proper API like as mentioned in #30 will enable a lot of progress. Do you need any help with it? Where is the work coordinated?

@mpetroff
Copy link
Owner

I just need time to work on it, which always seems to be in short supply.

@ofekd
Copy link

ofekd commented Jul 20, 2015

As always :) We really want to get this going, so if you need any help (excluding a time machine) let me know.

Thank you very much for investing your time and sharing Pannellum with us!

@rferreiroa
Copy link

Hello! How it's going? I am developing with panellum and webvr. I really find interesting a plugin arch and a proper api. I can help with this stuff
Kind regards!!

@jeffreyvandenbossche
Copy link

Hello @Selko ,
I'm making a VR project with pannellum so i want to move the picture with the device orientation. I use gyro.js for access the gyro and accelerometer. But when i use it in the viewer it is totally flickering and spinning around and when i reach the coordinates -360 on the yaw it totally spins around to the coordinate 360.
Can you help me ?

Kinds regards!

@mpetroff
Copy link
Owner

The yaw should be set in [-180, 180].

@jeffreyvandenbossche
Copy link

I have try it but when i reach now -180 it flipping the pic around to the coordinate 180 and if i use the arrows it is no problem to go from -180 to 180. Is there a function that you use for this that is not happening ?

@rferreiroa
Copy link

Hi! I can help you of course. @jeffreyvandenbosche . I need to implement gyro.js and test it. Have you a link or something to test it too?
The option that suggest @mpetroff is good. Develop a function for these limits (-180, 180) is not very complicated, but could not be the best option. Let me test and i tell you.

Kind regards!

@jeffreyvandenbossche
Copy link

@Selko i don't have anything online for testing, do you need something specific for testing ?
Thanks that you will help me

@rferreiroa
Copy link

I need only implement gyro.js and test it. From the other hand, have you two viewers in your pannellum development? Its necessary to see with carboards

@jeffreyvandenbossche
Copy link

The javascript file can be found here, and the code that I have insert in pannellum.js could be found here No i just try it now without the cardboard, just a 360 panorama viewer with device orientation. And there is a problem also with the vertical position

@rferreiroa
Copy link

Ok, i'll test it this weekend. Let me see. To
Open two viewers, a simple solution is open a parent iframe, but i don't like so much.

@jeffreyvandenbossche
Copy link

okay, thank you. For the cardboard support im not sure how to do it on the best and cleanest way. But that is for later, first fix the device orientation.

@rferreiroa
Copy link

I found a free app virtual 360 (https://itunes.apple.com/us/app/virtual-360/id566962234?mt=8). Interface is very similar to Pannellum and has gyro working very good

@rferreiroa
Copy link

@lodestarops
Copy link

lodestarops commented Apr 26, 2016

Looking forward to this =) is there a preview we could check out? VR seems to be getting pretty big. I'd like to help if I could as well.

@Aykelith
Copy link
Contributor

I would love to see this feature implemented. I done some research and I found webvr-polyfill and here('Use polyfill') are examples(especially this one) on how to implement. I don't have much gl knowledge, but I don't think is much to work on.

@gurmukhp
Copy link

gurmukhp commented Nov 3, 2016

I've had a go at doing this but it's not been easy at all. Integrating the webVR stuff isn;t too bad, but for some reason when VRDisplay.update is called in the animate function, the browser locks up. I've even got it to show the cardboard image to signal a VR experience is about to start.

Any pointers?

@Aykelith
Copy link
Contributor

Aykelith commented Nov 3, 2016

From what I see I think maybe we should implement the stereoscopic 3d effect and use webVR to get the eyes variables.

@gurmukhp
Copy link

gurmukhp commented Nov 3, 2016

Any idea how to do this?

On 3 November 2016 at 13:20, Prisacariu Alexandru notifications@github.com
wrote:

From what I see I think maybe we should implement the stereoscopic 3d
effect and use webVR to get the eyes variables.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#82 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA26uf7JyB1HH9xYUWARzeVpm9El2Cyiks5q6d-WgaJpZM4FGB3c
.

@Aykelith
Copy link
Contributor

Aykelith commented Nov 3, 2016

Yes, but need OpenGL knowledge because also the shaders need to be changed. You can find on internet a lot of sources that implement 3D stereoscopic effect. Maybe take a look at this code.

@micker
Copy link

micker commented May 23, 2019

no news about this ?

@timakima
Copy link

I would be also interested to know if VR is currently on the roadmap?

@mpetroff
Copy link
Owner

It's a very low priority, so it's not happening anytime soon, at least without something in particular to change my priorities. I find Google Cardboard to provide a terrible user experience and see it as little more than a gimmick. Other VR headsets are probably considerably better, but I've never used one. Chrome for Android is the only mainstream browser to support WebVR by default at this time (Firefox doesn't count, since its WebVR support is Windows-only), so WebVR's utility is limited; WebXR is also in the process of replacing WebVR.

@DStillingfleet
Copy link

Matthew is probably right about the gimmicky aspect of Google Cardboard VR.

But for those who want to give it ago, it's really simple to use his masterpiece for VR, especially if you just looking for a view on one location. And because it's VR with two lenses, you can play with true 3D. I made a very simple example using photos from a Ricoh Theta S that you can view at https://www.virtualmountains.co.uk/X/360_3D_Experimentx4.html.

There's no secrets, so just take a look at the short html source to see how its done. No WebVR needed.

@hubick
Copy link

hubick commented Jul 22, 2019

I don't care much for gaming, but the promise of virtual tourism totally drew me to VR. Sadly, I quickly realized there's a dearth of high quality content (at least gen2 HMD image quality has improved). That's why I've started stitching gigapixel panoramas - to create that type of content I want to see more of. Pannellum has been absolutely fantastic, and the only freely available solution I've found capable of getting that level of resolution onto the web, so anyone can easily see it in their browser. As such, I'd be very excited to see that capability extend to WebVR (if not here, then where?), and am equally sad to read it's a low priority :-( Every major VR HMD vendor should be sponsoring this!

I mainly do Java / back-end Web Services, so I don't really know where to start. How much work is this (for someone who knows what they're doing)? You want a bounty? ;-)

@mpetroff
Copy link
Owner

As such, I'd be very excited to see that capability extend to WebVR

As I previously mentioned, WebVR is deprecated; it's scheduled to be removed from Chrome by the end of the year. Building something with WebVR would thus be a complete waste of time.

WebXR is slated to replaced it, but its API is still unstable and is likely to undergo substantial changes over the next few months. I'd much rather have a stable API, preferably one that doesn't involve a user having to enable a particular browser flag.

If the final API ends up being similar to the current API, there are two significant areas of work. One is low-level WebGL work to integrate in support for using projection and view matrices. The other is the substantial UI changes that would be required.

The final issue is available hardware. While I have a Google Cardboard viewer, I find it very unpleasant to use and would not like to use it for development. I also have a Daydream-ready phone but no Daydream View headset to go with it.

@joshuakoh1
Copy link

Any updates on this?

@mpetroff
Copy link
Owner

WebXR now has some degree of browser support, so there's finally a reasonable implementation path open. However, Google also recently discontinued Cardboard, so it's not clear what degree of support there will be for it going forward. Regardless, this isn't a priority for me in the immediate future.

@joshuakoh1
Copy link

@mpetroff Could you point me in the direction of what I need to replace to make WebXR work?

@mpetroff
Copy link
Owner

mpetroff commented Apr 7, 2021

Nothing needs to be replaced, since no similar functionality was ever developed. At the the bare minimum, you would need to develop code to initialize WebXR, render views for each eye, and process WebXR motion control inputs. Ideally, you'd also need to develop a WebXR-based user interface for interacting with hot spots and progressing through tours.

@L00ncan
Copy link

L00ncan commented Apr 4, 2022

I don't understand why my thread was closed here -- /issues/1086#issuecomment-1087801168 -- yet redirected to this thread here, i only wanted to know why 360s aren't viewable at all through the viewer not that it doesn't reperesent VR but you cannot even use it on the browser format. Sure, i threw in the sentences are they willing to support VR headsets, cause! why not ask while i'm here. As it stands Pannellum browser cannot even view 360s in standard browser formats when viewing from a headset with any bells & whistles non-active, just simple browser mode, the entirety of the 360s lag on vanilla chrome mode. Google Maps doesn't lag the 360s at all. Pannellum 360 player is a lead balloon viewing it through the chrome browser wearing a headset, try it if you must.

p.s - i don't see the google cardboard as a gimmick, phones improve over time

@mpetroff
Copy link
Owner

mpetroff commented Apr 5, 2022

@L00ncan I don't have an Oculus Rift headset, so I can't test with it. I also don't understand how you're trying to use Pannellum with it, given the current lack of WebXR support. I have no idea what you mean by viewing in "standard browser formats" or what "vanilla chrome mode" means.

Your issue was marked as a duplicate of this one since you asked about VR headset support, and this is the issue tracking that feature (I just updated the title to make it clear that the discussion in this issue has moved past just support for Google Cardboard).

@mpetroff mpetroff changed the title Support for Google Cardboard Support for VR headsets Apr 5, 2022
@L00ncan
Copy link

L00ncan commented Apr 6, 2022

Alot of VR headset applications are owned by the Facebook, Google or Steam corporations. All web browser dependable corporations at their origins of source. It's only natural they would provide web browsers to browse the web with their VR to use their services, when you visit the web browser pannellum does not work without major lag into non-useable display, when google maps loads the same 360s in browser format the same 360s load fine.
.
pannellum does not work in VR web browser

@gazhay
Copy link

gazhay commented Apr 6, 2022

I think what L00ncan is saying is that the in-headset browser on a quest works with things like google streetview, and other applications with "no lag".

If you navigate that browser to a page using pannellum, the pannellum instance is then rendered within that browser window and has "lag" and is "unusable".

I'm not commenting on the validity of the use-case of pannellum within a headset browser application, but the optimization would be the responsibility of the browser implementation, not the pannellum project author. Or perhaps a fork would be more appropriate?

@hubick
Copy link

hubick commented Apr 6, 2022

I, for one, wouldn't expect the tiny little CPU and very limited RAM (6GB on Quest2) in those headsets to be able to handle Pannellum and all the data from a large pano. Not even close. Google Maps and other websites don't need to load comparably massive amounts of image data. The fact that you even expect it to work, I think shows how well most experiences on those devices have had their resources tailored and optimized specifically for the limitations of the device in order to work well.

@L00ncan
Copy link

L00ncan commented Apr 6, 2022

I never mentioned the Oculus Quest2 i use The Oculus Rift and not limited to facebooks standard mobile ram, i use my Gamer PC with my my Oculus Rift S, i have 32 Gb of ddr4 ram on my i7 processor with my 1060TI Geforce and 8Tb hdd space

My catalogue of 360s is enormous.

@gazhay
Copy link

gazhay commented Apr 7, 2022

In that case, the issue isn't with pannellum.
In your use-case everything renders on the PC and the headset is a display.

I am not overly familiar with those setups, but that would require the graphics card to render two images (one for each eye) which are slightly different.
1060 is a bit low spec these days and maybe can't handle it, esp 3GB variants.

In any event, the headset is only displaying what the PC supplies and as such I don't see how pannellum could change that for you.

@L00ncan
Copy link

L00ncan commented Apr 7, 2022

When i load maps or 1080p/360/4k video non full-screen on webpages similar it works great though, seems like you're shooting fish in a barrel trying to conjure vr-web-page explanations.
.
The future investment of my web projects are solely depending on Augmented VR as a staple long before Mark Zuckerberg announced his interest, so i'm gonna need a little better than vague guesses at this point.

@gazhay
Copy link

gazhay commented Apr 7, 2022

You are clearly the expert.
The beauty of open source allows you to fork pannellum, fix the issue and submit a PR for the fix to the benefit of the community.

Good luck 👍

@TheWaterbug
Copy link

TheWaterbug commented Feb 7, 2024

How's this for a poor-man's VR support?

https://www.kan.org/Eastvale/Pano/2UpTest.html

image

It's just two adjacent <iframe> elements with the same pano and orientationOnByDefault=true.

I've tried this in iOS/Safari and iOS/Chrome, and it works fine in both, but you'll have to give them permission to use your phone's orientation the first time you load (click the Safari icon in the corner to manually enable orientation), and then reloads should have orientation support turned on automatically.

For some reason it does not render properly in macOS Safari. It does render correctly in macOS Chrome, but of course my MBP doesn't have a gyro sensor.

I have a $20 iPhone holder/headset that allows me to set adjust the interocular distance and focus distance, and it seems to work just fine. It would work the same in an $8 Google Cardboard holder as well.

The immersion effect was pretty good, despite the pixelation and extraneous screen content. I almost tripped over my real bed trying to walk through this, and at one point I tried to pet my cat.

If you don't have a VR holder you can hold your phone about 3" from your face, and you'll see the images converge. It'll probably be out of focus, but you'll get some sense of the desired immersion effect.

Of course I'd love to do the following, if I knew how:

  1. Hide the extraneous UI elements. Full-screening a panorama won't work, because I'd need to share the screen with the other one.
  2. Use CSS to properly scale the panos to fit the viewport.
  3. Have a UI of some sort of set the zoom and horizontal offset
  4. Sync the orientation. Is it synced right now? Does pannellum take an absolute orientation from iOS? Or does it accumulate the deltas since initialization? If one side loads before the other, can they get out of sync? They seem to be in sync right now, but I don't know if I'm just getting lucky.

@DStillingfleet
Copy link

Hi TheWaterbug

That's a good start, It will not satisfy everyone, but if it's for you, then that fine. And it's not too difficult to add hotspots that activate when you look at them, implement scene changes, and even 3D, see my comment of July 16th 2019.

@TheWaterbug
Copy link

Thanks! I knew this was too obvious idea not to have been tried before; I just didn't scroll back far enough to see your post. The SNR on this thread has been low, lately 😂.

But I tried your link in several browsers on macOS and in iOS, and the panoramas do not seem to be enabled. They render the initial view, but aren't draggable, and don't respond to motion. Did something change since 2019?

@DStillingfleet
Copy link

Hi TheWaterbug

Guess I should have checked that that 2019 link still worked. Take a look at https://purplevr.co.uk/StMaryBoveney/TourStMaryMagdalene-101.html instead, and select VR headset and try it out.

@mpetroff
Copy link
Owner

Hide the extraneous UI elements. Full-screening a panorama won't work, because I'd need to share the screen with the other one.

You can set "showControls": false in the configuration to hide the controls.

Sync the orientation. Is it synced right now? Does pannellum take an absolute orientation from iOS? Or does it accumulate the deltas since initialization? If one side loads before the other, can they get out of sync? They seem to be in sync right now, but I don't know if I'm just getting lucky.

Pannellum directly uses a listener for deviceorientation, but I think it's implementation specific whether or not attaching different listeners for the event return the same value (Safari doesn't support deviceorientationabsolute, which would be guaranteed to match). I don't think they can drift out of sync, but the starting positions could potentially be different (but should be close enough to not matter, assuming both copies are attached at approximately the same time).

@DStillingfleet
Copy link

With the orientation on, I can vouch that iOS will keep the two pannellum views in sync.

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

No branches or pull requests