OSVR / distortionizer

Tool for determining distortion parameters of arbitrary HMDs, and a corresponding set of shaders to correct that distortion.
Apache License 2.0
36 stars 16 forks source link

Shaders #13

Open rpavlik opened 9 years ago

rpavlik commented 9 years ago

Currently in vizard/ShaderTest.* in GLSL versions:

and the Unity ShaderLab/Cg/HLSL version:

which is more widely used but seems to be basically derived from the GLSL ones.

Questions:

cc @russell-taylor @DuFF14

rpavlik commented 9 years ago

FWIW - distortion not yet implemented in OSVR-Unity, OSVR-Unreal, SteamVR-OSVR, or OSVR-MonoGame AFAICT.

russell-taylor commented 9 years ago

When I handed off the distortionizer, it had buttons that the user could use to adjust the centers of projection for the eyes, and I think it only allowed mirror symmetric solutions (left eye X = -right eye X, left eye Y = right eye Y).

OpenCV radial distortion parameters look consistent with the one the distortionizer originally used, which would match the k1 (quadratic) term in OpenCV. There are also 4th and 6th power coefficients available in the numerator and denominator. I was able to get pretty good results with just the quadratic term on the DK2 (with a different parameter for each color).

Good to reduce sqrt() in the shader. Yuval was thinking that should be possible to remove.