You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
some days ago I received my Oculus Rift Development Kit 2 (http://www.oculusvr.com/dk2/), and I tried to make an Irrlicht integration last weekend. Now I have a problem: using the SDK distortion mode would be nice (according to the documentation this is "the way to go"), but I need to render the scene to a texture between the calls to the SDK functions "ovrHmd_BeginFrame" and "ovrHmd_EndFrame". In these functions the DirectX handling (I think it was "beginScene" and "present") is called, so I must make sure Irrlicht doesn't call these functions. If I simply leave out beginScene and endScene the rendered texture is empty. As my knowledge of DirectX and of the Irrlicht internals is .. ahem .. limited I wonder if anyone of you has an idea how I can achieve this. Thanx.
Btw: if I call "beginScene" and "endScene" from the video driver the console just gets flooded with "direct3Dendscene failed" messages.
Btw2: I made a hack to the CD3D9Texture to obtain the DirectX texture (IDirect3DTexture9* getRenderTargetTexture() { return Texture; }). Maybe the problem comes from here?
I gave up on trying to get the SDK distortion working myself since it seemed like they were still doing everything the same way anyways.
However, I did notice that the SDK's BeginFrame just seems to initialize the frame timing but not exactly call the BeginScene of DirectX. Also the SDK's distortion rendering function calls both Begin and EndScene-functions.
Did you call video driver's endScene before or after the Oculus SDK's EndFrame? I'm guessing you may need to call Irrlicht's endScene first and only then pass the RTT(s) to Oculus.
You may also need to define somewhere that Oculus SDK uses DirectX 9 instead of 11.
I switched the oculus SDK zu to DirectX 9. I think I'll try the applications distortion first, the SDK contains nice examples for that approach AS well