Thanks. Prepare what you can, and I'll take it from there, starting on Friday evening USA eastern time. There is a good chance that the DK2 would work with a future VR 3D mode. I'm sketching out the procedural flow for HMD VR modes now, but I won't finalize it until we finish reimplementing the already published modes for the upcoming release. I'm curious whether the OpenVR API would work with the DK2. If you have the time and inclination, I encourage you to install SteamVR and try configuring it for the DK2. If that works, then you would have the capability to help implement and test the future OpenVR mode. If that does not work, it would be possible to create another mode using the Oculus Rift SDK, a la GZ3Doom, but I'm more motivated to focus on OpenVR at the moment, which might work for both Rift (CV1) and Vive.dpJudas wrote:I have an Oculus DK2, although I'm not sure if it even works anymore after they released the consumer version. That's about the only thing I have. But I can prepare FGLRenderBuffers and the eye handling code to run like I described. I don't have any plans this weekend, so sure, I'll be around.
I've expanded the process flow for the new way below. I identified seven locations in the control flow where 3D-mode-specific hooks may be needed. We only need to do six of them now. The seventh is reserved for future HMD modes.
I think the proposed mBuffers->BindEyeTexture() method might require two arguments: an eye index, and an OpenGL texture unit index.
Time sequence for non-HMD 3D rendering in gzdoom:
- * At Program-Startup Time:
- Detect whether each 3D mode is available
- gl_renderbuffers == true?
other mode-specific requirements?
- gl_renderbuffers == true?
- Double check whether mode is available
if not, issue warning and revert to mono mode...
for example, quad-buffered 3D mode needs a 120Hz full-screen display mode on non-Quadro nvidia boards
Allocate Left renderbuffer, if necessary
- Set up view parameters for left eye view
Activate scene renderbuffer
Clear scene renderbuffer
Render 3D scene
Apply postprocessing (resolve multisampling, bloom, etc.)
Apply (invulnerability) "colormap" effect
Store final Left-eye view into Left renderbuffer [mBuffers->BlitToEyeTexture(0)]
Set up view parameters for right eye view
Activate scene renderbuffer
Clear scene renderbuffer
Render 3D scene
Apply postprocessing (resolve multisampling, bloom, etc.)
Apply (invulnerability) "colormap" effect
[mBuffers->BlitToEyeTexture(1)]
- (Do nothing for now, but future HMD modes need to do something clever here)
- Compose 2D HUD Elements onto left eye view [mBuffers->BindEyeFB(0)]
Compose 2D HUD Elements onto right eye view [mBuffers->BindEyeFB(1)]
Compose left and right eye textures, using a mode-specific present shader
mBuffers->BindEyeTexture(0, 0) // 2 arguments: buffer index, and OpenGL texture unit
mBuffers->BindEyeTexture(1, 1) // 2 arguments: buffer index, and OpenGL texture unit
load mode-specific shader program
render
- Undo mode-specific trickery
clear GL_BACK, GL_BACK_LEFT, GL_BACK_RIGHT buffers in case of quad stereo
restore GL_BACK target in case of quad stereo
- Delete any locally acquired OpenGL resources
- Detect whether each 3D mode is available