Skip to main content
New Participant
October 2, 2014

Is there a perpixel map or formula of the dk2 distortion?

I should be getting my dk2 in soon and from what I understand the current way distortion is being handled is to apply a post process warp to a rendered buffer. I would prefer to take a stab at implementing the warp in my own rendering code, but I would need information like an image or formula of the distortion in some form (like unit vectors centered at each eye's focus). Does anyone have any information?

    4 replies

    Inspiring
    October 2, 2014
    We aren't using pixel shader based distortion anymore. The distortion is created by a mesh, which the SDK supplies. If you use SDK-rendered mode, this is all handled for you. All you have to do is send in your stereo render targets.
    AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
    Up and Coming
    October 3, 2014
    There is an option for doing the distortion yourself that is explained in the documentation.
    Inspiring
    October 3, 2014
    There's an example of doing client side distortion on my github repository here: https://github.com/OculusRiftInAction/OculusRiftInAction/blob/master/examples/cpp/Example_X_ClientSideDistortion.cpp

    The SDK will provide you with a set of vertices which have information about the distortion baked into them. From that you can construct an OpenGL or Direct3D mesh and write a shader which will render the distortion. However, unless you have very specialized needs, it's simpler to let the SDK do the distortion and rendering for you.
    Brad Davis - Developer for High Fidelity Co-author of Oculus Rift in Action
    firaltAuthor
    New Participant
    October 3, 2014
    No in this case I wouldn't be letting the sdk do the distortion, my goal is to render based on the distortion rather than to use the distortion as a post-process on a render target (bad for pixel density).

    I hadn't read through the documentation yet :oops: , but I'm reading through it now and it's helpful.