A lightweight OpenXR runtime that enables VR applications to run in a desktop window for development and testing without requiring a physical VR headset.
- Desktop VR Preview - Run VR applications in a resizable desktop window with side-by-side stereo view
- Mouse & Keyboard Controls - Navigate the virtual space using standard input devices
- Proper sRGB Handling - Automatic gamma correction for accurate color reproduction
- Unity Compatible - Fully tested with Unity's OpenXR plugin
- Minimal Dependencies - Only requires Windows and DirectX 11
- Easy Setup - Simple PowerShell scripts for registration/unregistration
- Windows 10/11 (64-bit)
- DirectX 11 compatible GPU
- Visual Studio 2022 (for building from source)
- CMake 3.20 or later (for building from source)
- Download the latest release from the Releases page
- Extract the archive to your preferred location
- Run PowerShell as Administrator
- Navigate to the
scriptsfolder - Run
.\register-runtime.ps1to set as active OpenXR runtime
cd C:\Path\To\OpenXR-Simulator\scripts
.\register-runtime.ps1Once registered, any OpenXR application will automatically use the simulator:
- Launch your VR application (e.g., Unity project with OpenXR)
- A desktop window will appear showing left/right eye views
- Use the following controls:
- Mouse: Look around (hold right-click)
- WASD: Move forward/backward/strafe
- Q/E: Move up/down
- Shift: Move faster
- ESC: Release mouse capture
To restore your previous OpenXR runtime:
cd C:\Path\To\OpenXR-Simulator\scripts
.\unregister-runtime.ps1git clone https://github.com/yourusername/OpenXR-Simulator.git
cd OpenXR-Simulatormkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -A x64
cmake --build . --config ReleaseThe built runtime will be in build/bin/Release/openxr_simulator.dll
The simulator implements the OpenXR runtime interface, intercepting all OpenXR calls from applications:
- Instance & Session Management - Handles OpenXR instance creation and session lifecycle
- Swapchain Rendering - Creates D3D11 swapchains that applications render into
- View Composition - Blits stereo views to a desktop window using optimized shaders
- Input Simulation - Converts mouse/keyboard input to head pose and controller data
- โ Core OpenXR 1.0 specification
- โ
D3D11 graphics binding (
XR_KHR_D3D11_enable) - โ
Win32 time conversion (
XR_KHR_win32_convert_performance_counter_time) - โ Multiple swapchain formats (sRGB, UNORM, HDR)
- โ Stereo rendering with configurable FOV
- โ Reference space tracking (LOCAL, STAGE, VIEW)
- โ Basic action system for input
- โ No hand tracking
- โ No haptic feedback
- โ No foveated rendering
- โ Limited to seated/standing experiences
- โ No OpenGL/Vulkan support (D3D11 only)
The default FOV is set to 70ยฐ for comfortable desktop viewing. To modify, edit the FOV value in src/runtime.cpp:
// In xrLocateViews_runtime function
views[i].fov = { -0.7f, 0.7f, 0.7f, -0.7f }; // tan(35ยฐ) โ 0.7Default preview window is 1920x540 (960x540 per eye). Modify in runtime.cpp:
static UINT g_persistentWidth = 1920; // Total width
static UINT g_persistentHeight = 540; // HeightThe preview window background can be customized:
const float clearColor[4] = {0.1f, 0.1f, 0.2f, 1.0f}; // Dark blue- Verify registration:
Get-Content "$env:LOCALAPPDATA\openxr\1\active_runtime.json"- Check for conflicting API layers:
reg query "HKLM\SOFTWARE\Khronos\OpenXR\1\ApiLayers\Implicit"- Ensure no other VR runtime is running (SteamVR, Oculus, etc.)
- Disable any OpenXR API layers that modify rendering
- Ensure your application uses sRGB swapchain formats
- Check that no post-processing is double-applying gamma
- Check the log file:
%LOCALAPPDATA%\OpenXR-Simulator\openxr_simulator.log - Verify D3D11 support on your system
- Try running the application as administrator
- Reduce swapchain resolution in your application
- Disable MSAA if enabled
- Close other GPU-intensive applications
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Khronos Group for the OpenXR specification
- OpenXR SDK for headers and loader interfaces
- Unity OpenXR Plugin team for compatibility testing
- Community contributors and testers
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Documentation: Wiki
- Linux support via Vulkan
- Configurable controller emulation
- Multi-monitor support
- Recording and playback functionality
- OpenXR validation layer integration
- GUI configuration tool
Note: This is a development tool and not intended for end-user VR experiences. For production VR applications, use a proper VR headset and runtime.
