Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
CogSimGuy's avatar
CogSimGuy
Protege
9 years ago

Rendering to Oculus

I have successfully added Oculus support to some rendering code I'm working on however I'm noticing a slight perceived "sway" when looking around. Currently I do all my rendering and post processing passes then copy my color buffer over to an OculusEyeTexture. My suspicion is that the TimeWarp/SpaceWarp needs the depth buffer as well which I'm not currently copying over...looking for some thoughts here before diving into the code.

Thanks  

4 Replies

  • volgaksoy's avatar
    volgaksoy
    Expert Protege
    There is no need to pass in a depth buffer. The sway you're seeing could be related to how you're gathering the tracking info via the ovr_GetTrackingState() call. Make sure you're not accidentally requesting the current tracking state, but rather the future/predicted state. For an example, I would recommend you check out the OculusRoomTiny code provided in the SDK samples.
  • volgaksoy's avatar
    volgaksoy
    Expert Protege
    Another possible problem is how you're dealing with the texture swap chain indices. If you accidentally lag behind by one frame, this will show similar problems. So make sure you're properly querying the new texture swap chain index via ovr_GetTextureSwapChainCurrentIndex() to render into as well as calling ovr_CommitTextureSwapChain() on that texture at the proper time.
  • Thanks for the feedback. The ovr_GetTranckingState() call is good, but I'll take a closer look into the swap chain index...thanks again.
  • For anyone who might be of interest, I resolved the issue I was seeing. At some point I'd moved the DirectX12 execute command list call to after the ovr_SubmitFrame call. Once I moved it back to immediately after the swap chain commit call everything was fine again.