Configuring Interpupillary Distance (IPD) in Game Code
In our practice, we've repeatedly seen projects where after the first tests, users complained of headaches and blurry images. The cause—ignoring Interpupillary Distance (IPD). IPD is the distance between pupil centers, averaging 63–65 mm in adults, but the real range is 54 to 74 mm. A VR headset that doesn't account for a specific user's IPD delivers blurry images, double vision, and headaches within 15–20 minutes. IPD configuration is not an optional feature—it's a basic requirement for any VR application. Our experience shows that proper software IPD support reduces negative feedback by 30% and increases retention.
How IPD Is Implemented: Hardware and Software
Most VR headsets handle IPD physically: Quest 3 and Index have mechanical adjustable IPD (Quest 3—three fixed positions: 58, 63, 68 mm; Index—smooth adjustment 58–70 mm). PSVR2 uses software adjustment without a mechanical slider.
On the software side: even with correctly set physical IPD, the game engine must properly position the virtual cameras. In Unity via OVR SDK, physical IPD is read automatically through OVRPlugin.GetFloat(OVRPlugin.BoolType.ipd) and applied to eye offset—the distance between left and right cameras. You don't need to touch this manually unless using a non-standard camera rig.
The problem arises in projects with custom camera rigs—for example, when a developer builds their own VRCameraController on top of OVRCameraRig or XRRig and hardcodes eye separation = 0.064f (standard). A user with an IPD of 57 mm gets incorrect stereo and experiences eye strain. After a few days—negative reviews like "my eyes hurt".
How to Get IPD Programmatically in Unity
For Meta Quest via OVR SDK:
float ipd = OVRPlugin.GetEyeRecommendedResolutionScale() > 0
? OVRPlugin.ipd
: 0.064f; // fallback to default
leftCamera.transform.localPosition = new Vector3(-ipd / 2f, 0, 0);
rightCamera.transform.localPosition = new Vector3(ipd / 2f, 0, 0);
OVRPlugin.ipd returns the current value in meters, read from the sensor or system settings. It updates dynamically when physical IPD changes (on devices with mechanical adjustment)—recommend subscribing to OVRManager.DisplayRefreshRateChanged or checking in Update() with throttling every 0.5 seconds.
For OpenXR (XR Interaction Toolkit): eye offset is managed via XRCameraSubsystem, which gets data from the specific XR Provider. Direct IPD access via UnityEngine.XR.InputDevice.TryGetFeatureValue(CommonUsages.eyesData, out Eyes eyes)—returns positions of both eyes in world coordinates, from which IPD is calculated as Vector3.Distance(leftEyePos, rightEyePos).
Why Incorrect IPD Causes Discomfort
IPD in code affects not only physical comfort but also the perception of object scale. Eye separation in the engine controls parallax—the difference between images for the left and right eyes. When eye separation is larger than real IPD, objects appear smaller ("macro scale" effect). When smaller, they appear larger ("gigantism effect"). This is used artistically in games—giant scale VR intentionally reduces eye separation.
For realistic simulators and educational VR applications, deviation of eye separation from the user's real IPD is unacceptable. Accuracy is critical.
A common mistake in Unity projects: Camera.stereoSeparation and IPD are different things. stereoSeparation is a software parameter added on top of hardware IPD. If both are non-zero, a double shift occurs. The value of Camera.stereoSeparation should be 0.0f in most VR projects unless intentional artistic offset is used.
Configuring IPD in the User Interface
For PSVR2 and other headsets with software IPD, a settings screen is needed in the application. Standard UX: a horizontal slider from 54 to 74 mm with a 1 mm step, real-time preview. Applied via vendor-specific API—for PSVR2 this is Unity PS VR2 Plugin with VRSamples.IPDInterop.
IPD test: the settings screen shows two vertical lines or crosshairs—one for the left eye, one for the right. With correct IPD, the lines appear as one. This is a standard technique used by headset manufacturers themselves. Software adjustment is 1.5 times more accurate than mechanical due to the absence of play.
Comparison of Mechanical and Software IPD
| Parameter | Mechanical IPD | Software IPD |
|---|---|---|
| Adjustment accuracy | 1–3 mm | 0.1 mm |
| Support during session | Fixed | Dynamic |
| UI required | No | Yes |
| Implementation cost | Built into headset | Requires development |
What's Included in IPD Configuration Work
- Audit of the current camera rig for hardcoded eye offsets.
- Reading IPD via OVR SDK or OpenXR.
- Implementing a UI slider for software IPD (if needed).
- Cross-platform integration (Quest, PSVR2, PC VR).
- Testing with users of different IPDs.
- Documentation and team training.
We guarantee that after the upgrade, your game will be comfortable for users with any IPD. Our engineers are certified in Unity and Unreal Engine, and have over 10 years of experience in VR development. See Unity OVRPlugin documentation.
| Task | Estimated Time |
|---|---|
| Audit and fix IPD in existing camera rig | 1 business day |
| Implement software IPD UI with preview | 2–4 business days |
| Cross-platform IPD layer (Quest + OpenXR + PSVR2) | 1–2 weeks |
Pricing is determined individually after analyzing the current camera rig state and target platforms. Contact us for a consultation on your project. Order IPD refinement and ensure comfort for your users.





