-
Notifications
You must be signed in to change notification settings - Fork 124
Conversation
did you test this in Chrome Canary to make sure there are no console errors/warnings? (I can check in a bit.) |
Hmm yeah, Im getting view frustum errors in canary with win MR. |
@cvan r? |
There was a problem hiding this 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.
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
orientation: Array.from(orientation), | ||
position: Array.from(position) | ||
}); | ||
if (vrDisplay.isPresenting || isPolyfilled) { |
There was a problem hiding this comment.
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
?
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
|
||
gameInstance.SendMessage('WebVRCameraSet', 'WebVRData', JSON.stringify(vrData)); | ||
gameInstance.SendMessage('WebVRCameraSet', 'WebVRData', JSON.stringify(vrData)); | ||
} | ||
|
||
if (!vrDisplay.isPresenting) { |
There was a problem hiding this comment.
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?
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
@@ -299,7 +301,7 @@ | |||
} | |||
|
|||
// Check to see if we are polyfilled. | |||
var isPolyfilled = (vrDisplay.deviceId || '').indexOf('polyfill') > 0 || | |||
isPolyfilled = (vrDisplay.deviceId || '').indexOf('polyfill') > 0 || |
There was a problem hiding this comment.
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
Assets/WebVR/Models/Materials.meta
Outdated
@@ -0,0 +1,10 @@ | |||
fileFormatVersion: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
accidental commit?
There was a problem hiding this 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.
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
@@ -323,6 +319,14 @@ | |||
}); | |||
} | |||
|
|||
// Check to see if we are using polyfill. | |||
function isPolyfilled() { |
There was a problem hiding this comment.
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! 👍
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that's fine
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
vrDisplay.hardwareUnitId; | ||
|
||
if (isPolyfilled) { | ||
if (isPolyfilled()) { | ||
showInstruction(document.querySelector('#novr')); | ||
} else { | ||
status.dataset.enabled = 'true'; |
There was a problem hiding this comment.
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:
There was a problem hiding this comment.
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?
Assets/WebGLTemplates/WebVR/webvr.js
Outdated
position: Array.from(position) | ||
}); | ||
// Check for polyfill so that we can utilize its mouse-look controls. | ||
if (vrDisplay.isPresenting || isPolyfilled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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 😄
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
this isn't working for me on Android phones (tested with S8 and Pixel) @caseyyee can you try on your phone? |
There was a problem hiding this 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)
LGTM too. Good work here @caseyyee 👏 |
Thanks guys! |
doesn't send framedata into unity.