Skip to content

feat(vr): implement OpenXR controller haptics and bypass mobile suppr… - #22

Merged
CoderDayton merged 6 commits into
CoderDayton:vrfrom
dim-ghub:vr
Oct 15, 2026
Merged

CoderDayton merged 6 commits into
CoderDayton:vrfrom
dim-ghub:vr

Conversation

@dim-ghub

Copy link
Copy Markdown
Collaborator

…ession

  • Implement RobloxHapticProtocolBridge for MessageBus HapticProtocol (SupportsHaptics, GetMotors, SetMotorState, UpdateSingletonVibration).
  • Wire bridge into RobloxExperienceComposition and direct game runtime.
  • Call JNI NativeGLInterface.nativeUpdateMobileHapticsState during startup and game completion.
  • Enable FFlagKeepHapticsOnMobileWhenGamepadConnected and FFlagVRHaptics in VR client settings overrides to bypass gamepad haptic suppression in libroblox.
  • Directly activate KeepHaptics and VRHaptics fast flag bytes in memory within RobloxVrDeviceBridge::Activate for builds 2998 and 3222.
  • Check xrApplyHapticFeedback result code and add diagnostic logging.

Closes #

…ession

- Implement RobloxHapticProtocolBridge for MessageBus HapticProtocol
  (SupportsHaptics, GetMotors, SetMotorState, UpdateSingletonVibration).
- Wire bridge into RobloxExperienceComposition and direct game runtime.
- Call JNI NativeGLInterface.nativeUpdateMobileHapticsState during startup
  and game completion.
- Enable FFlagKeepHapticsOnMobileWhenGamepadConnected and FFlagVRHaptics in
  VR client settings overrides to bypass gamepad haptic suppression in libroblox.
- Directly activate KeepHaptics and VRHaptics fast flag bytes in memory
  within RobloxVrDeviceBridge::Activate for builds 2998 and 3222.
- Check xrApplyHapticFeedback result code and add diagnostic logging.
@CoderDayton CoderDayton self-assigned this Oct 14, 2026
CoderDayton and others added 5 commits October 14, 2026 03:14
…ting

- Register HapticProtocol and report motors only when MOCKTAIL_VR_ENABLED is on.
- Drop the per-message [haptic] dispatch log; log each OpenXR haptic result once per hand.
- Write a fast flag only when its name pointer matches the expected name.
- Remove the state-sync fallback that dlsym can never resolve.
… of pinning it

The Vulkan adapter exports vk* symbols globally, so a runtime loaded again after it bound its Vulkan calls to the adapter and deadlocked the join. Pinning avoided the reload but left SteamVR with its old VkInstance, which aborted the join with "vkGetInstanceProcAddr: Invalid instance". Later instances now load the runtime libraries with RTLD_DEEPBIND and let them unload with their instance.
…m them

The Android client drops HapticService:SetMotor on the Gamepad1 LeftHand and
RightHand motors: its haptics backend only consumes Large and Small. VR games
such as VR Hands drive those motors, so they never vibrated.

- Interpose HapticService::SetMotor through its reflection descriptor, call
  the original, and forward Gamepad1 LeftHand/RightHand to OpenXR. The
  descriptor and the engine's intensity reader are found by pattern at load,
  for both the 2998 (tuple span) and 3222 (shared tuple) reader ABIs. The held
  level renews a 50 ms lease every presented frame.
- Report the hand motors at x = -1/+1 in GetMotors. Positional HapticEffects
  aim at a hand there with a 0.5 radius (VOXEL DESTRUCT 2 does), so at +-0.2
  every effect mixed to zero.
- Play SetMotorState buffers sample by sample with trailing silence trimmed.
  Roblox sends 100 x 25 ms look-ahead buffers; taking the peak for the whole
  buffer turned a short bump into 2.5 s at full strength.
- Stop vibrating from the DebugDeviceVR haptic slot. The engine pulls it every
  frame but with each mix buffer's first sample, held about a second, so it
  duplicated the buffers as a long buzz.
- Enable SupportGenericHapticsOnVR and FixRegisterMotors with the other haptic
  flags.
@CoderDayton
CoderDayton merged commit 42b5138 into CoderDayton:vr Oct 15, 2026
7 checks passed
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.

2 participants