facebookarchive / react-360

Create amazing 360 and VR content using React
https://facebook.github.io/react-360
Other
8.73k stars 1.22k forks source link

[Question] No gaze based cursor on HTC Vive? #86

Closed patrickdown closed 7 years ago

patrickdown commented 7 years ago

Using experimental chromium VR build (56.0.2910.0) with HTC Vive

I created an example app with: react-vr init WelcomeToVR

When running the application when I press 'Enter VR' and put on the headset I see the scene as expect except there is no gaze based cursor.

I modified client.js to add the cursor visibility options I could find.

const vr = new VRInstance(bundle, 'WelcomeToVR', parent, { // Add custom options here cursorVisibility: 'visible', cursorEnabled: true, cursorAutoHide: false, ...options, });

After reloading I'm still not seeing the cursor. Am I missing some other configuration?

andrewimm commented 7 years ago

You should only need to use cursorVisibility: 'visible' to show the cursor in the headset at all times. The other two options you've used there don't do anything. I've tried this on a new project and it worked as expected, showing the cursor at all times in the headset.

That being said, I highly recommend using the automatic cursor functionality. To paraphrase John Carmack, when you show a cursor at all times, you're unwittingly creating a fps meter that shows your user when your applications is performing badly.

patrickdown commented 7 years ago

I agree about the automatic cursor but it's not showing in any of the sample apps in any context.

jedrichards commented 7 years ago

I'm using Firefox Nightly and a Vive. Scaffolded a new project and not seeing any sort of cursor inside VR either with or without the cursorVisibility: 'visible' option. Very confused in general about how to add button interactivity to my project ...

Edit: Just tried the VideoSample360 example fresh from the repo (copying example files into a newly init'd project) and no cursor there either. As I understand it there should be cursor visible there to interact with the media player?

fbaiodias commented 7 years ago

I'm having the same issue. Tried cursorVisibility: 'visible' using a Vive with both Chromium and Firefox Nightly and no cursors show up inside VR 😟

iox commented 7 years ago

I'm having the same problem, the cursor is missing (Vive + Chromium).

@andrewimm You said it worked as expected for you. I assummed you tested it on a different device?

andrewimm commented 7 years ago

React VR applications only come with a mouse + touch raycaster implementation out of the box. If you want to use VR input systems, you'll need to customize and configure your application to use the input systems you need. This is because there are so many different potential input systems: gaze, 3dof, 6dof, touch... There is no one-size-fits-all solution, so we'd rather let developers decide what works best for their applications. We provide an example of a 3dof controller in the Examples directory of this repo, and implementing something like a gaze cursor is very easy to do with the APIs we've provided. You can learn more about this here: https://facebook.github.io/react-vr/docs/input.html#cursor-systems

jedrichards commented 7 years ago

I can see the sense of the mouse/touch raycaster being the default since it allows ubiquitous interaction outside of VR. Odd that there's no in VR default input scheme though, since doesn't this render all your examples initially non-interactive in VR? The only way to interact with the 360 video demo in VR is to first therefore code our own raycaster? If the objective is to bring VR dev to web devs with little to no knowledge of 3d/vr programing this seems to be a bit of a barrier to entry? Seems to me that gaze is the only platform agnostic in-VR input scheme, so could be a good candidate for including, if only as some example code on the input docs?

bcwilhelm commented 7 years ago

Ever since upgrading to react-vr v1.1.0 (from 0.1.2), I'm having the same issue on a Rift, with Chromium Experimental WebVR v1.11. Falling back to 0.1.2, however, the cursor appears again. Switching back and forth between the versions consistently reproduces/resolves the error.

I am using cursorVisibility: 'visible', but I've tried 'auto' as well, with no luck.

andrewimm commented 7 years ago

@bcwilhelm in 0.1.x, the cursor was hardcoded and we realized that would not account for a variety of input devices. In 1.x.x, we now have a pluggable cursor system, which means you can build custom bindings for your unique input devices, or use ones already available (like our sample for 3dof controllers, or this gaze cursor implementation: https://www.npmjs.com/package/simple-raycaster). We can't determine the best solution for your apps, so instead we make it very simple to configure, and hope the community builds out support for cases we haven't already covered.

bcwilhelm commented 7 years ago

Thank you, @andrewimm, the simple raycaster works fine!

fmnxl commented 7 years ago

Just FYI, I've published a 6DOF raycaster for Vive/Oculus controllers here: https://www.npmjs.com/package/react-vr-6dof-raycaster

patrickdown commented 7 years ago

I understand how it works now. Thanks for information about the various raycaster implementations.

jgwinner commented 7 years ago

I know this is closed, but as a suggestion, maybe there should be a mention in the VR Button? Oddly, I found the answer over on StackOverflow, not on the docs here :)

The reason I suggest this is the docs say: "Out of the box, React VR ships with a cursor implementation that allows users to use a mouse or touchscreen to interface with your application."

It doesn't say "Except on mobile headsets" (etc.).

So my assumption was I'd have some kind of cursor on the Samsung Gear VR.

I'll use the simple-raycaster, but I think it would be great to update the docs to say:

"Out of the box, PC based React VR ships with a cursor implementation that allows users to use a mouse or touchscreen to interface with your application when out of VR mode. Any VR modes, including Mobile solutions, due to the wide range of input devices, have no cursor by default, although you can implement one with the raycaster system."

I know you probably can't point people to a 3rd party raycaster; I DO think it would be neat if the default on mobile and PC (Vive, Rift) was a simple gaze cursor, as that is the lowest common denominator, but that's not a big deal. It IS frustrating to read the docs and assume I'd have a cursor :)

Great answer here, by the way, it just takes a little digging.

== John ==