SteamVR lens distortion adjustment utility for custom spherical lenses. (I'm working on another utility for nonspherical lenses like GearVR.)
With Compositor Distortion | WireFrame Rendering | Without Compositor Correction |
Download link (Requires .Net4.5 or higher)
Purpose is to find optimal values for the lens coefficients and intrinsics in the JSON file, after replacing the original frensel lenses with GearVR or other lenses other spherical lenses.
The JSON file is read to file LH_Config_In.json via the lighthouse console at startup automatically.
Adjusted values are saved to LH_Config_Out.json file on exit. (No auto update to device because it's unsafe, you can lose your original configuration. Manually update after backing up original config!) You can write your adjusted config by selecting the appropriate menu item.
Environment model is rendered three times for each RGB color. (except center crosshair, hidden mesh, controllers and adjustment panel). The environment model path is hardcoded and points to the "environment" folder. Download any single .obj environment and put it in the "environment" folder and rename the .obj and .mtl files to "environment".
Rendering is switchable between solid (textured) and wireframe (white). Lens distortion correction can be toggled, and you can see the result of the new values immediately.
Distortion correction is done inside the pixelshader. Therefore the rendering, especially the adjustment panel rendering may be slow in some cases.
Adjustment is done with two motion controllers. Here are the mappings for the Vive:
TouchPad MIDDLE: Hide/Show hidden mesh.
Trigger: Hold to show original unadjusted values. Also enables/disables rendering of selected color channels.
I had very limited knowledge about D3D11, matrices and transformations when starting this project. So code is unoptimized, with minimum comments.
https://interplayoflight.wordpress.com/2013/03/03/sharpdx-and-3d-model-loading/