Forum Discussion
yeilam
11 years agoHonored Guest
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 ...
Anonymous
11 years agoSorry 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 ..
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 ..
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 11 years ago
- 11 years ago