Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
firalt's avatar
firalt
Honored Guest
12 years ago

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

  • 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.
  • owenwp's avatar
    owenwp
    Expert Protege
    There is an option for doing the distortion yourself that is explained in the documentation.
  • 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.
  • firalt's avatar
    firalt
    Honored Guest
    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.