if you want to write code for the Rift using DirectX 12 you might want to take
a look at the code I provided on GitHub https://github.com/ClemensX/ShadedPath12.git
The sample engine is extremely limited on draw abilities: I can only draw lines!
But it may serve as a learning playground for DirectX 12 and Rift programming.
I find it fascinating how a bunch of simple lines suddenly become great if you can walk around them and view them from any direction when you wear the Rift!
The current state of the code is a first step to porting my older DX 11 engine to DX 12.
If you want you are allowed to use any code you like in your own projects.
I want to express gratitude to galopin, who came up with a detailed 8-step guide on how to combine
DirectX 12 with Oculus SDK rendering. See this thread https://forums.oculus.com/viewtopic.php?f=20&t=25900
When I found out that using oculus API ovr_CreateSwapTextureSetD3D11 on a
D3D11On12Device throws NullPointerExceptions I would have given up if he had not given this advice!
Some features of the code example:
- Engine / Sample separation. Look at Sample1.cpp to see what you can currently do with this engine and see how it is done.
- Oculus Rift support (head tracking and rendering). See vr.cpp
- Post Effect Shader: Copy rendered frame to texture - Rift support is built on top of this feature
- Use Threads to update GPU data. See LinesEffect::update()
- Synchronize GPU and CPU via Fences
- Free float camera - use WASD or arrow keys to navigate. Or just walk/turn/duck if you wear the Rift
Any feedback welcome.