Skip to main content
Up and Coming
March 25, 2014

Oculus compatible with dx9 ??

Is there any reason I cant get a DX9 application to work with the oculus?

I am worried about the oculus post process shaders. Do they use something only available in dx10+?

thanks

    4 replies

    New Participant
    March 28, 2014
    Here's an example of a DXD9 warp shader from Vireio:

    https://github.com/cybereality/Perception/blob/master/Release/Perception/fx/OculusRift.fx

    I just added chromatic aberration correction to it the other day. Someone can probably help out and make it more efficient, I had never written any shaders before and was modifying it without any compiler tools so I couldn't tell the reasons it was failing (I think each shader model has limited registers and instruction count).
    Up and Coming
    March 28, 2014
    The post process shaders do nothing more than a texture lookup controlled by a relatively simple function (could also be done by a second indirection texture), maybe three lookups if the chromatic aberration gets corrected. So you can implement this on *any* 3D API that supports basic fragment shaders (DX9, GL 2.0, GL ES 2.0 etc.) - probably even DirectX 8 shaders...
    Up and Coming
    March 28, 2014
    ... and shaders aren't really necessary anyway, so you could even use OpenGL ES 1.x, simple unextended OpenGL 1.2 or DirectX 7 if you liked. Just generate a tesselated quad with the pre-distortion function applied to either texture coordinates or vertex positions, and use that to show the textures with the two views instead of simple quad(s).
    John Tsiombikas webpage - blog - youtube channel
    Up and Coming
    March 29, 2014
    valve's method, iirc, is to precompute the distortion and chromatic abherations onto a texture. There are loads of methods to do the barrel distortion shader.
    DK1 FREAK ...