Specific code for SteamVR Windows Mixed Reality headsets C++

Hi guys,

I tested my VR game on the 3 following headsets:

  • HTC Vive
  • Oculus Rift
  • Lenovo Explorer (Windows Mixed Reality)

I noticed the colors were really different on each platform. I started developing for the HTC Vive, so I’m trying to reproduce the same colors/brightness on the Oculus Rift and the Windows Mixed Reality platforms, which are the platforms supported on Steam. So in order to do that, I tweak the Saturation and Gamma of my Post Process according to the platform.

My problem is that Windows Mixed Reality headsets will return EHMDDeviceType::DT_SteamVR as device type if you call GEngine->XRSystem->GetHMDDevice()->GetHMDDeviceType(). So I’m trying to figure out how to know what VR headset is being used.

I found out that:

  1. Calling GEngine->XRSystem->GetHMDDevice()->GetHMDMonitorInfo(MonitorInfo) gives “WindowsHolographic” in the returned MonitorInfo.MonitorName variable, which hopefully is the case for ALL Windows Mixed Reality headsets. This string is obtained by querying vr::Prop_SerialNumber_String (see FSteamVRHMD::Startup() function).
  2. Querying the vr::Prop_ModelNumber_String like in the FSteamVRHMD::RecordAnalytics() function will give “Lenovo Explorer” as a DeviceName.

If you have another Windows Mixed Reality headset, could you check what do vr::Prop_SerialNumber_String and vr::Prop_ModelNumber_String return for this other Windows Mixed Reality headset? (so that we can make a list and have specific code for each of them)


Windows Mixed Reality headsets:

  • Lenovo Explorer: Prop_SerialNumber_String = “WindowsHolographic” and Prop_ModelNumber_String = “Lenovo Explorer”
  • Samsung Odyssey: ?
  • HP: ?
  • Acer: ?
  • Dell Visor: ?

I will test this for you. However, I am having trouble accessing the functions. What libraries did you include to get access to vr::Prop_ModelNumber_String ?

I added a GetHMDDeviceName() function in the FSteamVRHMD class so I did not need to add any include (SteamVRHMD.cpp having all it needs).

If you just want to test it though, you can add a breakpoint in one of the 2 occurences of (still in SteamVRHMD.cpp) to check what is returned by:

GetFStringTrackedDeviceProperty(VRSystem, vr::k_unTrackedDeviceIndex_Hmd, vr::Prop_ModelNumber_String);

I believe it gets called when you start the game.

It appears I still don’t have access to these functions. I’m trying to include “openvr.h” but it says it can’t find it.

I can’t help you there. I did not access these functions directly. I added a GetHMDDeviceName() function in the FSteamVRHMD class, because this class can call GetFStringTrackedDeviceProperty(…). Then from my project, I call GetHMDDeviceName().

If you want to do the same as me, take a look at how the GetVersionString() function works and do the same.