Forum Discussion

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

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

  • 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).
  • 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...
  • ... 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).
  • obzen's avatar
    obzen
    Expert Protege
    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.