servo: Unity export doesn't load

https://de-panther.github.io/unity-webxr-export/Build/

Possible cause:

So it seems I can't iterate on xrSession.inputSources on firefox reality for Hololens 2.
godot:servo jdm$ ./mach run -d https://de-panther.github.io/unity-webxr-export/Build/
[UnityCache] indexedDB database could not be opened
Warning: Unsupported graphics API WebGL 2.0
[UnityCache] 'https://de-panther.github.io/unity-webxr-export/Build/Build/Build.wasm.framework.unityweb' successfully downloaded but not stored in the indexedDB cache due to the error: Error: indexedDB access denied
[CachedXMLHttpRequest] indexedDB is not available
IndexedDB is not available. Data will not persist in cache and PlayerPrefs will not be saved.
Assertion failed: IDBFS used, but indexedDB not supported
Assertion failed: IDBFS used, but indexedDB not supported
[UnityCache] 'https://de-panther.github.io/unity-webxr-export/Build/Build/Build.data.unityweb' successfully downloaded but not stored in the indexedDB cache due to the error: Error: indexedDB access denied
Loading player data from data.unity3d

Initialize engine version: 2019.3.0f6 (27ab2135bccf)

Creating WebGL 1.0 context.
Renderer: Mozilla/Servo

Vendor:   Mozilla/Servo

Version:  OpenGL ES 2.0 (WebGL 1.0)

GLES:     2

 EXT_shader_texture_lod GL_EXT_shader_texture_lod OES_texture_half_float GL_OES_texture_half_float ANGLE_instanced_arrays GL_ANGLE_instanced_arrays OES_element_index_uint GL_OES_element_index_uint OES_standard_derivatives GL_OES_standard_derivatives OES_texture_float_linear GL_OES_texture_float_linear EXT_frag_depth GL_EXT_frag_depth EXT_color_buffer_half_float GL_EXT_color_buffer_half_float WEBGL_color_buffer_float GL_WEBGL_color_buffer_float EXT_texture_filter_anisotropic GL_EXT_texture_filter_anisotropic WEBGL_compressed_texture_s3tc GL_WEBGL_compressed_texture_s3tc OES_texture_float GL_OES_texture_float OES_texture_half_float_linear GL_OES_texture_half_float_linear OES_vertex_array_object GL_OES_vertex_array_object EXT_blend_minmax GL_EXT_blend_minmax

OPENGL LOG: Creating OpenGL ES 2.0 graphics device ; Context level  <OpenGL ES 2.0> ; Context handle 18005728

UnloadTime: 1.540000 ms

Active Graphics Tier: Tier2
(Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)


Input Manager initialize...

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 22 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Managed to run it on the Hololens emulator using the version from the store. The hands works now 😃 Thanks again

And this is why I think that it’s not so straightforward.

it’s a couple lines of code:

if (input.gamepad) {
  selected = input.gamepad.buttons[0];
} else {
  selected = input.selected;
}

Ultimately it is not the goal of web specifications to do additional stuff that can be handled by frameworks. From the WebXR side, this is code that people can write, and ideally user agents implement the gamepad API, the problem is solved. Servo doesn’t do the latter but you can still do the former.

Also, does the onselect event is called before the rAF iteration is called? If so, adding inputSource.selected will work, but if it may happen after, there may be some issues.

It doesn’t matter, if it happens after it will be exposed on the next frame. Frames occur quite rapidly after each other. When you are accessing .gamepads.button you have this exact same issue as well, if a button was pressed shortly after a frame was kicked off, it will show up on the next frame.

Servo does indeed trigger it before the rAF, though; we only check for button presses right before rAF.

But I do want to get the analog value of the trigger/squeeze buttons if there is one.

Right, read from gamepad if it exists, or read from selected if it doesn’t. Hand input doesn’t expose an analog value.

IMO, Straightforward: Iterating each frame on an object and child objects to get Pose and input events states.

Usable: Registering to input events, Cache boolean states of those events, Iterating each frame on an object and child objects to get Pose and compare with the cached input events states.

It’s usable, and this is what I’ll end up doing. But it’s not straightforward.

Having the Hand input events in the inputSource (as gamepad), would be the straightforward solution IMO. And as I understand, this is the direction that the discussion there is going to. So it’s a good thing and I encourage it.

@De-Panther (re: your comment on the webxr issue) you misunderstand, the issue I linked is not about “some browsers do not implement the gamepad module”. It’s the reason I haven’t added the gamepad module to servo yet, because there’s a chance it may be resolved in a way that affects how we do it.

The core issue issue is that for physical controllers “select” and “squeeze” are independent events, and you can treat them as separate buttons that the user may press separately. However, on hand tracking devices, select and squeeze can happen simultaneously in resposne to the same gesture, and in fact most select events trigger squeeze events. Content relying on this to not happen breaks.

Remember, .gamepads is a separate module, browsers may decide to implement WebXR without implementing gamepads.

onselect is spec-wise guaranteed to be emitted when the trigger button is pressed, but it can theoretically be emitted when other buttons are pressed, up to the UA choice (it is allowed to designate multiple select buttons). No device/UA does this as of now, and I don’t expect that to change

Squeeze won’t work for hands right now because for the hololens (and Quest iirc) there is overlap between select and squeeze. See https://github.com/immersive-web/webxr/issues/997 for more info, input from a user’s perspective is appreciated!

I’m not super comfortable exposing a fake button just yet because the resolution of https://github.com/immersive-web/webxr/issues/997 may involve exposing select and squeeze as buttons through a specially named profile.

@De-Panther We do not expose a gamepad, as there are no buttons. You can use onselect to get a select event. The profile we use is “generic-hand”, which is being discussed in https://github.com/immersive-web/webxr-input-profiles/issues/105

gripSpace and targetRaySpace will work.

The problem is actually that this line is silently ignored for XRInputSourceArray, so it is in fact not iterable. I’ve got some code changes that should fix that and an automated test that verifies it.