Skip to content

Conversation

@toji
Copy link
Contributor

@toji toji commented Apr 28, 2021

Related issue: #21666

Fixes unspeakable horrors caused by using the previous hand meshes with conformant WebXR implementations.

This replaces the FBX hand meshes with the generic-hand glTF assets from the webxr-input-profiles repo (provided by Oculus). Currently I have those assets included as part of this PR, but we could also simply point at the webxr-input-profiles CDN for them as we do with other WebXR controllers.

In the process of changing the assets we've been able to make several improvements. The bone names for the meshes now match the joint names reported by the API, making it easier to correlate them and removing a fair amount of code in the process. Also the meshes are appropriately scaled now, so that the previous scaling up/down by 100x is no longer needed. Also, the new assets are only ~40% the size of the old ones, allowing them to load significantly faster!

We do lose the "Low poly" option with this switch, but the assets as provided are low poly enough that I can't imagine any device that is capable of hand tracking struggling to render them.

@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 28, 2021

Um, it seems #21712 also tries to fix this issue.

@toji
Copy link
Contributor Author

toji commented Apr 28, 2021

Ah! I hadn't noticed that.

So on a quick review, their PR has additional samples that seem like they could be nice, as well as a couple new variants of the HandMesh object which I'm not really clear on the purpose of and aren't explained in the PR. Seems like potentially a more complete solution.

This one uses slightly modified version of the same hand assets that matches what's in the webxr-input-profiles repo and can pull it from a CDN if needed. The changes to that asset also make the skinning logic a bit simpler as the name of the bones matches the names exposed by the API so it gets rid of one level of indirection. Also their code still has some scaling in it that should no longer be necessary with the updated assets.

Seems like the optimal solution would be to have #21712 update the .glb assets to the newest ones from webxr-input-profiles and make the necessary changes/simplifications to their new loaders.

@mrdoob
Copy link
Owner

mrdoob commented May 6, 2021

I've merged #21712.

@toji Would you like to rebase this PR or make a new one with the clean up?

@mrdoob
Copy link
Owner

mrdoob commented May 6, 2021

I've updated the code with the changes in this PR: 571347f

@toji Let me know if I missed anything.

@mrdoob mrdoob closed this May 6, 2021
light.position.set( 0, 6, 0 );
light.castShadow = true;
// Prevent shadow acne on the hands
light.shadow.bias = -0.0001;
Copy link
Owner

Choose a reason for hiding this comment

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

My solution was to force set material.side to THREE.FrontSide.:

mesh.material.side = 0; // Workaround: force FrontSide

@toji Any reason the models are double sided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, there's not. Thanks for pointing that out. I'll fix the meshes and push them to the webxr-input-profiles CDN.

Copy link
Owner

Choose a reason for hiding this comment

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

Sweet! Let me know when you do that so I can remove the workaround.

@toji
Copy link
Contributor Author

toji commented May 6, 2021

Thanks! Glad this proved useful! Just tested dev branch in my Quest and it's working great! The new button example is especially fun.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants