Forum Discussion

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

DirectX9

I'm trying to build the OculusRoomTiny example for Direct X 9.
But it has code specific to DirectX11 (RenderTiny_D3D11_Device.cpp)
Our system (www.geosimcities.com) uses Direct X 9 so as first step I want to run a small example with Direct X 9.
The OculusSDK seems to support Direct X 9 (am I wrong)?
But I need and example like OculusRoomTiny to check that.
Thanks,
Yigal

5 Replies

  • While the samples do use DirectX11, the SDK itself does not require it. DirectX9 should work.

    You can try running OculusWorldDemo with the command line parameters '-r D3D9'.
  • Sorry, I think I may have been mistaken. It looks like the sample demos may not support DirectX9.
  • yeilam's avatar
    yeilam
    Honored Guest
    Is there a possibility to get a sample (even a simple one) that works with DirectX9?
    Yigal
  • Some of the newer stuff where you let the Oculus SDK interface with the graphics API may not work 100% out-of-box with DirectX9. However, the basic things (like reading sensor values) should work with any graphics API.
  • Anonymous's avatar
    Anonymous
    Sorry I can't give you a sample code.

    However "in 2 words" yes you can make it work with DirectX 9 ( June 2010 SDK ).

    How ?

    Well in short the sensor part I believe has "nothing to do" with DirectX so it just works, you can initialize the sensor using the lib and you'll just get the data in.

    The visual part well .. the Oculus itself is "just a secondary monitor", you enumerate it 'as usual' and you'll find it.

    Then .. well .. "all you need" is the Util_Renderer_Stereo.cpp have "a good look" at it and re-create the distortion shaders ( you need both the vertex and the pixel shaders ).

    Beware that you'll need to call the OVR::System:Init from within the WINMAIN or it won't work.

    I recommend spending quite some time studying the TinyRoom demo, possibly getting nuts re-doing all the math and checking all the matrices one by one by hand, finding out the little tiny "missing things" in the documentation, swapping everything because your own coordinate system is the opposite reverse of the one used in the example, discover the joy of row vectors VS column vectors and reverse matrix order, discovering the joys of how a - there and a + there that should not be there will give you something that seems quite right but it is not ( don't trust your eyes too much, they can be easily fooled ), interpreting the deep meaning of sentences like "a quad that covers half the screen" and wondering where those viewports are gone and stuff like that ...

    After all that you may get something that works in DX9 ( but that actually you haven't tried on a truly old DX9 only machine ) but it could also makes you question if you would have learnt faster how to use DX10/11 instead ( well no maybe still not ) instead of taking a road that supposedly "should have saved you some time" because "you had pieces of code you knew it well already" but ended up in making a brand totally new "engine" all over again for the Nth time where the only bits of code you managed to re-use where maybe 50 lines ..

    But yes I suppose "in some way" it should be working in DX9 too but as I said I haven't really tried yet on an XP machine or so ..