mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
100.49k stars 35.21k forks source link

ShaderMaterial for Hand breaks their motion tracking in WebXR (Quest3 tested) #28538

Closed nosy-b closed 1 month ago

nosy-b commented 1 month ago

Description

In WebXR on the Quest 3, I can easily change the Hand material with MeshPhongMaterial for example and specific textures,

BUT when I try to create my own ShaderMaterial it breaks the hand tracking -> They appear at (0,0,0) (with the right ShaderMaterial), and don't follow my hands.

Any idea?

Reproduction steps

  1. Create a ShaderMaterial ( even tried the most basic one)
  2. Set it to the Hands

Code

// Create a ShaderMaterial ( I even tried the most basic one) // THEN hand1 = renderer.xr.getHand(0); const handModel1 = new OculusHandModel(hand1); hand1.add(handModel1); scene.add(hand1); hand1.children[0].children[0].children[0].material = myShaderMaterial;

Live example

https://whenistheweekend.com/k/hand.html

Screenshots

handbug

Version

163.0

Device

Headset

Browser

No response

OS

No response

Mugen87 commented 1 month ago

Does your custom shader material fully support skeletal animation? If not, that would explain the issue.

Meaning you must provide a material that is compatible to SkinnedMesh.

nosy-b commented 1 month ago

Oooo you re right, it's all good by adding shaderchunks!

   #include <skinbase_vertex>
  #include <begin_vertex>
  #include <skinning_vertex>
  #include <project_vertex>

Thanks @Mugen87 !