Getting started

Getting started with HPTK (Oculus Quest)

1. Obtain HPTK

In Unity Editor, open Package Manager. Click on Add package from git URL and paste the following URL:

  https://github.com/jorgejgnz/HPTK.git

Click on Add and Unity will download the UPM package. This package has no dependencies.

2. Import Oculus Integration

Download Oculus Integration 20.1 from Asset Store or the Oculus Archive and import it.

  Oculus Integration is a dependency for the InputDataProvider OVRSkeletonTracker, which reads hand data from OVRHand and OVRSkeleton components.
  OVRSkeletonTracker is not included in the HPTK package. We will download it in following steps.

3. Build Settings (Oculus Quest)

  • Switch platfrom to Android.

  • Set Texture compression to ASTC.

This may take a while, you can take a break 😊

4. Project Settings (!)

HPTK relies on nVidia PhysX and Unity's built-in Configurable Joints to simulate hand physics. HPTK has been tested under the following recommended settings:

Physics:

  • Default Solver Iterations: 50.

  • Default Solver Velocity Iterations: 25.

  • Enable Adaptative Force: enabled

  • Friction Type: Two Directional Friction Type.

  • Solver Type: Temporal Gauss Seidel.

  • Default values for other variables.

Time:

  • Fixed Timestep: 0.01.

Player/Other (Oculus Quest):

  • Scripting backend: ILCPP.

  • Target architecture: ARM64.

  • Graphic APIs: Remove Vulkan (only OpenGLES3).

The following table shows a comparison of how this configuration affects the realism of the simulation:

5. Setup a scene with hand tracking support (Oculus Quest)

  • Install XR Plugin Management. Add Oculus in Plug-in Providers.

  • Set Stereo Rendering Mode (Android) to Multiview.

The built-in URP shader will not work in the default Oculus stereo rendering mode (PC): Single Pass Instanced. If you want to use this shader and you're experiencing rendering issues, please check that you are targeting to Android platform and that you are using Multiview as Oculus stereo rendering mode (Android).

  • Delete any MainCamera in scene. Add OVRCameraRig prefab.

  • Add OVRHandPrefabs for each hand as children of LeftHandAnchor and RightHandAnchor (children of OVRCameraRig object).

  • Set Hand Tracking Support (OVRManager component in OVRCameraRig object) to Controllers And Hands.

  • Set Hand Type & Skeleton Type for OVRHand & OVRSkeleton components.

  • Disable components OVRSkeletonRender, OVRMesh, OVRMeshRenderer & SkinnedMeshRenderer for every OVRHandPrefab.

6. Setup HPTK specific components

  • Add SpAvatar+Dummy prefab to the Scene (make sure that SpAvatar is close to OVRCameraRig).

  • Add HPTKCore prefab to the Scene. Drag & drop CenterEyeAnchor (child of OVRCameraRig) into TrackedCamera field in CoreModel component (HPTKCore).

7. Setup platform specific HPTK components (Oculus Quest)

  • Download OVRSkeletonTracker.cs. Store it in Assets/(YourCustomFolder)/Scripts/Input/.

  • Add 2 empty gameobjects as children of SpAvatar>InputDataProviders in the scene. Rename them to OVRSkeletonTracker.L and OVRSkeletonTracker.R.

  • Add a OVRSkeletonTracker component to each of them.

  • Set Hand Data and Bone Data fields for each OVRSkeletonTracker component with their corresponding OVRHandPrefabs.

  • Set OVRSkeletonTracker.x as Input Data Provider in SpAvatar>ProxyHand.X>[Modules]>Input.X>InputModel.X (InputModel component).

8. HPTK Configuration Assets

HPTK includes different configuration assets which default values have already been fine-tuned for a generic purpose. If you need more sensible gesture detection or different hand physics configurations, you can modify the following configuration assets:

  • CoreConfiguration.

  • HandPhysicsConfiguration.

    You can create new configuration assets by doing right-click on the Project window in the Unity Editor. Then go to Create/HPTK/*.
    To use these assets, drag & drop them in any CoreModel or HandPhysicsModel component.

Last updated