Direct2D: stereo 2D drawing at apparent screen depth

    General discussion

  • Hi all, I'd like to use Direct2D to draw 2D elements at apparent screen depth when stereo is enabled. Think of a 2D cursor or HUD that do not appear aligned with the screen but at a user-defined depth. So that the 2D cursor will look like it is at the same depth of a 3D element; the 2D hud will appear to be inside the screen.

    In order to do this I'm using a custom vertex shader which is called once for the left eye rendering pass and once for the right eye rendering pass. The only source of information that I have been able to find on the matter was nVidia's 3D Vision Automatic whitepaper where they suggest calculating it as follows:

    1. scale the vertex's position in clip space by the depth value that we want to use:
      pClip *= depth/pClip.w
    2. compute the horizontal offset by calculating:
      pClip.x += (+-EyeSign) * separation * (pClip.w - convergence)

    I'm using as interocular separation 1.25f and as convergence a value of 24.0 units (also known as the distance to the screen). If those values are plugged into the equation it results in a horizontal offset that is too big to be fused. I have eyeballed a value of 0.15f for separation that seems to produce better results, but still it's not correct.

    However I'd like to know how to properly calculate the horizontal offset or if there is any other technique to render 2D elements at a user-defined screen depth.

    Thanks in advance!

    Monday, July 22, 2013 2:19 PM

All replies

  • Hello,

    I have changed this to a general discussion as you are asking for general guidance rather than having a specific problem with a Microsoft API. Unfortunately I don't know enough about NVidia's Active Shutter technology to really help you out here. Hopefully someone else in the community will be able to help out.



    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

    Monday, July 29, 2013 9:37 PM