Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

fixes 2d fallback #157

Merged
merged 1 commit into from
Mar 1, 2018
Merged

fixes 2d fallback #157

merged 1 commit into from
Mar 1, 2018

Conversation

caseyyee
Copy link
Contributor

doesn't send framedata into unity.

@caseyyee caseyyee requested a review from cvan February 23, 2018 23:29
@cvan
Copy link
Contributor

cvan commented Feb 23, 2018

did you test this in Chrome Canary to make sure there are no console errors/warnings? (I can check in a bit.)

@caseyyee
Copy link
Contributor Author

Hmm yeah, Im getting view frustum errors in canary with win MR.

@caseyyee
Copy link
Contributor Author

@cvan r?

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good work on figuring out the fix 👍

thanks for spending the time to track that down.

orientation: Array.from(orientation),
position: Array.from(position)
});
if (vrDisplay.isPresenting || isPolyfilled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add a comment explaining why we are checking isPolyfilled?


gameInstance.SendMessage('WebVRCameraSet', 'WebVRData', JSON.stringify(vrData));
gameInstance.SendMessage('WebVRCameraSet', 'WebVRData', JSON.stringify(vrData));
}

if (!vrDisplay.isPresenting) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this include || isPolyfilled like above?

@@ -299,7 +301,7 @@
}

// Check to see if we are polyfilled.
var isPolyfilled = (vrDisplay.deviceId || '').indexOf('polyfill') > 0 ||
isPolyfilled = (vrDisplay.deviceId || '').indexOf('polyfill') > 0 ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be a function defined elsewhere, but I suppose this is fine until #104 is addressed

@@ -0,0 +1,10 @@
fileFormatVersion: 2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accidental commit?

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first off, thank you for fixing my mistake!

want to address this JS Console error (Error: VR display is not capable of presenting) that was introduced from this change though. also, see my few other comments.

@@ -323,6 +319,14 @@
});
}

// Check to see if we are using polyfill.
function isPolyfilled() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should take a single argument (can name it display) instead of the global vrDisplay, but that can be handled in #104. regardless, thanks for making this a function! 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah good call.

for (var i = 0; i < gamepads.length; ++i) {
var gamepad = gamepads[i];
if (gamepad && (gamepad.pose || gamepad.displayId)) {
if (gamepad.pose.position && gamepad.pose.orientation) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this indentation level is getting pretty deep; can you move this up a line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could, but this is all changing anyways. we will be handling this in another object class altogether.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, that's fine

vrDisplay.hardwareUnitId;

if (isPolyfilled) {
if (isPolyfilled()) {
showInstruction(document.querySelector('#novr'));
} else {
status.dataset.enabled = 'true';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting this Console error:

Error occurred getting VR display: Error: VR display is not capable of presenting
    at webvr.js:310
    at <anonymous>

from line 310:

screen shot 2018-02-26 at 10 06 52 pm

screen shot 2018-02-26 at 10 06 44 pm

screen shot 2018-02-26 at 10 06 43 pm

screen shot 2018-02-26 at 10 06 40 pm

screen shot 2018-02-26 at 10 06 30 pm

screen shot 2018-02-26 at 10 06 24 pm

screen shot 2018-02-26 at 10 06 14 pm

screen shot 2018-02-26 at 10 05 31 pm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's because of this value: vrDisplay.capabilities.canPresent === false; do you know why that is?

position: Array.from(position)
});
// Check for polyfill so that we can utilize its mouse-look controls.
if (vrDisplay.isPresenting || isPolyfilled()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we'll need to modify this check when the FPS controls are added (#125) and webvr-polyfill (#113) are upgraded, respectively

after we get this regression fixed (my bad – sorry! and thank you!) …

we can ask @jsantell if there's any work in this area to support desktop.

Copy link
Contributor

@cvan cvan Feb 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and look what I found: https://github.com/jsantell/three-simple-fp-controls/blob/master/src/SimpleFPControls.js 👍

this is specific to three.js, but we have all the Unity-equivalent properties we need in WebVRCamera.cs.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The desktop (mouse, webcam) controls were removed because extra complexity, and it was unclear what the "native" desktop controls should be (something like OrbitControls were the default, only 3DOF, I prefer something FPS-y usually, like simple-fp-controls linked above). More explanation here. The example was updated to show supporting desktop in a few lines

That being said, I think something like polyfill.addDisplay(FPSControlsVRDisplay) could be implemented so that people could use shared desktop solutions (and link to it in polyfill) if they wanted. Open to hear more about supporting desktop!

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the simple-fp-controls were mostly lifted from Three's FPS controls, simplified a bit, and avoided pointer lock, could change key bindings, used mostly for experiments, use at your own peril 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsantell: thanks for stopping by to provide this info - all extremely helpful.

I 💯 agree re: FPS controls being preferable on desktop. I've seen first hand in person and across GitHub issues and social media much confusion with both users and developers in interacting with mouse-look controls. it just doesn't translate well, unless the scene is auto-rotating (à la Flickr's equirectangular photos) and/or with text hints + icons (à la Facebook's 360° embeds).

Copy link
Contributor

@delapuente delapuente Feb 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the nature of this project, I would provide all the fallbacks on the Unity side. To be honest, I don't see the need of the polyfill on the desktop since Unity developers are not creating Web content but using the Web as the distribution platform. The discussion on mobile is different.

@cvan
Copy link
Contributor

cvan commented Mar 1, 2018

this isn't working for me on Android phones (tested with S8 and Pixel)

@caseyyee can you try on your phone?

Copy link
Contributor

@cvan cvan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 looks good in the Vive (Windows), Daydream (Pixel)

(unrelated, but filed #181 for iOS)

@delapuente
Copy link
Contributor

LGTM too. Good work here @caseyyee 👏

@caseyyee
Copy link
Contributor Author

caseyyee commented Mar 1, 2018

Thanks guys!

@caseyyee caseyyee merged commit 2aef756 into MozillaReality:master Mar 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants